Package org.apache.jetspeed.om.profile

Examples of org.apache.jetspeed.om.profile.ProfileLocator


     * @throws Exception
     */
    public void testCreateTestPSML() throws Exception
    {
        Portlets rootPortletSet = null;
        ProfileLocator currentLocator = null;
        ProfileLocator newLocator = null;
        PsmlController controller = null;
        PsmlPortlets portlets = null;
        PsmlSkin skin = null;

        // Create the RunData object to be used during testing.
        rundata = RunDataFactory.getRunData( request, response, config );
        assertNotNull( "Got rundata", rundata);

        TurbineTestUtilities.setupRunData(rundata);
        // Verify we have a profile
        Profile profile = Profiler.getProfile(rundata);
        assertNotNull( "Got profile from Profiler", profile);

        // Verify the profile location information in the profile
        if (profile instanceof ProfileLocator)
        {
            currentLocator = (ProfileLocator) profile;
        }

        newLocator = Profiler.createLocator();
        newLocator.setGroupByName(TEST_GROUP);
        newLocator.setMediaType(currentLocator.getMediaType());
        newLocator.setName(TEST_SECURITY_PAGE);

        // Create portlet set
        portlets = new PsmlPortlets();
        controller = new PsmlController();
        controller.setName("RowController");
View Full Code Here


        assertNotNull( "Got profile from Profiler", profile);

        // Verify the profile location information in the profile
        if (profile instanceof ProfileLocator)
        {
            ProfileLocator profileLocator = (ProfileLocator) profile;
            assertTrue("Verify the 'anonymous' is not set", !profileLocator.getAnonymous());
            assertNull("Verify the user is null", profileLocator.getUser());
            assertNull("Verify the role is null", profileLocator.getRole());
            assertEquals("Verify the page name", profileLocator.getName(), TEST_SECURITY_PAGE + ".psml");
        } else
        {
            assertTrue( "profile does not implement ProfileLocator", false);
        }
        TurbineTestUtilities.generatePage(rundata);
View Full Code Here

        assertNotNull( "Got profile from Profiler", profile);

        // Verify the profile location information in the profile
        if (profile instanceof ProfileLocator)
        {
            ProfileLocator profileLocator = (ProfileLocator) profile;
            assertTrue("Verify the 'anonymous' is not set", !profileLocator.getAnonymous());
            assertNull("Verify the user is null", profileLocator.getUser());
            assertNull("Verify the role is null", profileLocator.getRole());
            assertEquals("Verify the page name", profileLocator.getName(), TEST_SECURITY_PAGE + ".psml");
        } else
        {
            assertTrue( "profile does not implement ProfileLocator", false);
        }
        TurbineTestUtilities.generatePage(rundata);
View Full Code Here

        assertNotNull( "Got profile from Profiler", profile);

        // Verify the profile location information in the profile
        if (profile instanceof ProfileLocator)
        {
            ProfileLocator profileLocator = (ProfileLocator) profile;
            assertTrue("Verify the 'anonymous' is not set", !profileLocator.getAnonymous());
            assertNull("Verify the user is null", profileLocator.getUser());
            assertNull("Verify the role is null", profileLocator.getRole());
            assertEquals("Verify the page name", profileLocator.getName(), TEST_SECURITY_PAGE + ".psml");
        } else
        {
            assertTrue( "profile does not implement ProfileLocator", false);
        }
        TurbineTestUtilities.generatePage(rundata);
View Full Code Here

            ConcreteElement result = new ConcreteElement();
            Entry entry = null;

            if (this.psml != null)
            {
                ProfileLocator baseLocator = Profiler.createLocator();
                baseLocator.createFromPath(this.psml);
                Profile baseProfile = Profiler.getProfile(baseLocator);
                if (baseProfile != null)
                {
                    entry = baseProfile.getDocument().getEntry(name);
                    if ( logger.isDebugEnabled() )
View Full Code Here

       
        try
        {
            ConcreteElement result = null;
            Profile baseProfile = null;
            ProfileLocator baseLocator = Profiler.createLocator();
            int rootType = JetspeedLink.DEFAULT;
            String rootValue = null;
            int elementType = JetspeedLink.DEFAULT;
            String elementValue = null;

            // Create locator to retrieve profile settings
            if (this.psml != null)
            {
               baseLocator.createFromPath(this.psml);
               if (baseLocator.getUser() != null)
               {
                   rootType = JetspeedLink.USER;
                   rootValue = baseLocator.getUserName();
               }
               else if (baseLocator.getRole() != null)
               {
                   rootType = JetspeedLink.ROLE;
                   rootValue = baseLocator.getRoleName();
               }
               else if (baseLocator.getGroup() != null)
               {
                   rootType = JetspeedLink.GROUP;
                   rootValue = baseLocator.getGroupName();
               }
            }
            else
            {
               rootType = JetspeedLink.CURRENT;
               rootValue = "";
               baseProfile = data.getProfile();
               baseLocator.createFromPath(baseProfile.getPath());
            }

            //  Determine search method
            if (baseLocator != null)
            {               
                // search by portlet name
                if (this.name != null)
                {
                    elementType = JetspeedLink.PORTLET_ID_QUERY;
                    elementValue = this.name;
                }
                else if (this.jspeid != null)
                {
                    elementType = JetspeedLink.PORTLET_ID;
                    elementValue = this.jspeid;
                }
                // Build the link
                JetspeedLink link = JetspeedLinkFactory.getInstance(data);
                DynamicURI uri = link.getLink(rootType,
                                              rootValue,
                                              baseLocator.getName(),
                                              elementType,
                                              elementValue,
                                              this.action == null ? "controls.Maximize" : this.action,
                                              null,
                                              baseLocator.getMediaType(),
                                              baseLocator.getLanguage(),
                                              baseLocator.getCountry());
                result = new StringElement(uri.toString());
                JetspeedLinkFactory.putInstance(link);
            }

            // Output the result
View Full Code Here

        removeUserDocuments(user, enableMessaging);
    }
   
    public void removeUserDocuments( JetspeedUser user, boolean sendMessage)
    {
        ProfileLocator locator = Profiler.createLocator();
        locator.setUser(user);
        StringBuffer buffer = new StringBuffer();
        buffer.append(PATH_USER);
        String name = user.getUserName();
        if (null != name && name.length() > 0)
        {
View Full Code Here

        removeRoleDocuments(role, enableMessaging);
    }
   
    public void removeRoleDocuments(Role role, boolean sendMessage)
    {
        ProfileLocator locator = Profiler.createLocator();
        locator.setRole(role);
        StringBuffer buffer = new StringBuffer();
        buffer.append(PATH_ROLE);
        String name = role.getName();
        if (null != name && name.length() > 0)
        {
View Full Code Here

                                + roleProfile.getRoleName());
                    }
                }

                // Create a new profile for the user
                ProfileLocator locator = createLocator();
                locator.setUser((JetspeedUser) data.getUser());
                locator.setMediaType(mediaType);
                locator.setName(this.resourceDefault + this.resourceExt);

                // Regenerate the portlet ids so they are unique
                org.apache.jetspeed.util.PortletUtils.regenerateIds(portlets);

                // Save the new profile to permament storage
View Full Code Here

        removeGroupDocuments(group, enableMessaging);
    }
   
    public void removeGroupDocuments(Group group, boolean sendMessage)
    {
        ProfileLocator locator = Profiler.createLocator();
        locator.setGroup(group);
        StringBuffer buffer = new StringBuffer();
        buffer.append(PATH_GROUP);
        String name = group.getName();
        if (null != name && name.length() > 0)
        {
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.om.profile.ProfileLocator

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.