Package org.apache.jetspeed.om.security

Examples of org.apache.jetspeed.om.security.Group


    {
        StringBuffer keybuf = new StringBuffer();

        JetspeedUser user = locator.getUser();
        Role role = locator.getRole();
        Group group = locator.getGroup();
        String name = locator.getName();
        String mediaType = locator.getMediaType();
        String country = locator.getCountry();
        String language = locator.getLanguage();

       synchronized (this)
       {
            if (user != null)
            {
                keybuf.append("User:").append(user.getUserName());
           }
            else if (group != null)
            {
                keybuf.append("Group:").append(group.getName());
            }
            else if (role != null)
            {
                keybuf.append("Role:").append(role.getName());
            }
View Full Code Here


            throw new IllegalArgumentException(message);
        }

        JetspeedUser user = profile.getUser();
        Role role = profile.getRole();
        Group group = profile.getGroup();
        String tableName = null;

        Connection dbCon = getDbConnection();

        try
View Full Code Here

            throw new IllegalArgumentException(message);
        }

        JetspeedUser user = locator.getUser();
        Role role = locator.getRole();
        Group group = locator.getGroup();
        String tableName = null;

        // get a database connection
        Connection dbCon = getDbConnection();
View Full Code Here

            throw new IllegalArgumentException(message);
        }

        JetspeedUser user = locator.getUser();
        Role role = locator.getRole();
        Group group = locator.getGroup();
        String tableName = null;
        List records = null;
        Portlets portlets = null;
        PSMLDocument psmldoc = null;
        String page = null;
View Full Code Here

    public Profile createGroupProfile(JetspeedGroupProfile entity, Portlets portlets)
    {
        Profile profile = Profiler.createProfile();
        try
        {
            Group group = JetspeedSecurity.getGroup(entity.getGroupName());
            if (null == group)
            {
                group = JetspeedGroupFactory.getInstance();
                group.setName(entity.getGroupName());
            }
            profile.setGroup(group);
            profile.setMediaType(entity.getMediaType());
            profile.setLanguage(entity.getLanguage());
            profile.setCountry(entity.getCountry());
View Full Code Here

     */

    public void testGetGroups() throws Exception
    {
        GroupManagement service = getService();
        Group group = null;
        HashMap map = new HashMap();

        try
        {
            Iterator groups = service.getGroups();
            while (groups.hasNext())
            {
                group = (Group)groups.next();
                map.put(group.getName(), group);
            }
            assertTrue(map.get("apache") != null);
            assertTrue(map.get("Jetspeed") != null);
            assertTrue(map.get("bogusGroup") == null);
        }
View Full Code Here

     */

    public void testGetGroupsForUser() throws Exception
    {
        GroupManagement service = getService();
        Group group = null;
        HashMap map = new HashMap();

        try
        {
            Iterator groups = service.getGroups("turbine");
            while (groups.hasNext())
            {
                group = (Group)groups.next();
                map.put(group.getName(), group);
                System.out.println("[turbine] group = " + group.getName());
            }
            assertTrue(map.get("Jetspeed") != null);
            assertTrue(map.get("apache") == null);

            map.clear();
            groups = service.getGroups("admin");           
            while (groups.hasNext())
            {
                group = (Group)groups.next();
                map.put(group.getName(), group);
                System.out.println("[admin] group = " + group.getName());
            }
            assertTrue(map.get("Jetspeed") != null);

        }
        catch (Exception e)
View Full Code Here

     */

    public void testAddGroup() throws Exception
    {
        GroupManagement service = getService();
        Group group = null;

        try
        {
            group = JetspeedGroupFactory.getInstance();
            group.setName("bogus");
            service.addGroup(group);
            System.out.println("new group id = " + group.getId());
            assertTrue(group.getId() != null);
        }
        catch(Exception e)
        {
            fail(StringUtils.stackTrace(e));
        }
        try
        {
            group = JetspeedGroupFactory.getInstance();
            group.setName("bogus");
            service.addGroup(group);
            fail("Should've thrown a dup key exception on group");
        }
        catch(Exception e)
        {
View Full Code Here

     */

    public void testRemoveGroup() throws Exception
    {
        GroupManagement service = getService();
        Group group = null;

        try
        {
            service.removeGroup("bogus");
        }
View Full Code Here

    {
        GroupManagement service = getService();

        try
        {
            Group group = service.getGroup("Jetspeed");
            System.out.println("*** group nm = " + group.getName());
            System.out.println("*** group id = " + group.getId());
            assertTrue(group.getName().equals("Jetspeed"));
        }
        catch (Exception e)
        {
            fail(StringUtils.stackTrace(e));
        }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.om.security.Group

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.