Examples of PsmlPortlets


Examples of org.apache.jetspeed.om.profile.psml.PsmlPortlets

    {
        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");
        portlets.setController(controller);
        skin = new PsmlSkin();
        skin.setName("orange-red");
        portlets.setSkin(skin);
        rootPortletSet = portlets;

        portlets = new PsmlPortlets();
        // Add entries
        portlets.addEntry( createEntry(ALL_PORTLET, "ST_01.all"));
        portlets.addEntry( createEntry(USER_PORTLET, "ST_01.user"));
        portlets.addEntry( createEntry(ADMIN_PORTLET, "ST_01.admin"));
        rootPortletSet.addPortlets(portlets);

        Profile newProfile = Profiler.createProfile(newLocator, rootPortletSet);
        PSMLDocument doc = newProfile.getDocument();
        System.out.println("doc = " + doc.getName());
View Full Code Here

Examples of org.apache.jetspeed.om.profile.psml.PsmlPortlets

        else if (profiles.size() > 0)
        {
            try
            {
                // Create an empty portlet container
                Portlets portlets = new PsmlPortlets();
                Control control = new PsmlControl();
                control.setName(this.rolemergeControl);
                portlets.setControl(control);
                Controller controller = new PsmlController();
                controller.setName(this.rolemergeController);
                portlets.setController(controller);

                // Set the skin
                Skin skin = new PsmlSkin();
                skin.setName(PortalToolkit.getSkin((String) null).getName());
                portlets.setSkin(skin);

                String mediaType = null;

                // Process each role profile
                int paneCount = 0;
                for (Iterator it = profiles.iterator(); it.hasNext();)
                {
                    Profile roleProfile = (Profile) it.next();
                    mediaType =
                        mediaType == null
                            ? roleProfile.getMediaType()
                            : mediaType;
                    Profile tmpProfile = (Profile) roleProfile.clone();
                    Portlets tmpPortlets =
                        tmpProfile.getDocument().getPortlets();

                    // If topmost control is a tab control, then add each tab to the container
                    Control paneControl = tmpPortlets.getControl();
                    if (paneControl != null
                        && paneControl.getName().equals(this.rolemergeControl))
                    {
                        for (int i = 0;
                            i < tmpPortlets.getPortletsCount();
                            i++)
                        {
                            Portlets pane = tmpPortlets.getPortlets(i);
                            pane.setLayout(null);
                            portlets.addPortlets(pane);
                            paneCount++;
                        }
                    }
                    // Otherwise, add the contents of profile as a pane
                    else
                    {
                        if (tmpPortlets.getTitle() == null)
                        {
                            String title =
                                org
                                    .apache
                                    .turbine
                                    .util
                                    .StringUtils
                                    .firstLetterCaps(
                                    roleProfile.getRoleName());
                            tmpPortlets.setTitle(title + " Home");
                        }
                        tmpPortlets.setLayout(null);
                        portlets.addPortlets(tmpPortlets);
                        paneCount++;
                    }

                    if (logger.isDebugEnabled())
                    {
View Full Code Here

Examples of org.apache.jetspeed.om.profile.psml.PsmlPortlets

            });

            try
            {
                // Create an empty portlet container
                Portlets portlets = new PsmlPortlets();
                Control control = new PsmlControl();
                control.setName(this.groupmergeControl);
                portlets.setControl(control);
                Controller controller = new PsmlController();
                controller.setName(this.groupmergeController);
                portlets.setController(controller);

                // Set title
                portlets.setTitle("Home Page");

                // Set the skin
                Skin skin = new PsmlSkin();
                skin.setName(PortalToolkit.getSkin((String) null).getName());
                portlets.setSkin(skin);

                // Set top level security ref
                if (groupmergeSecurityref != null)
                {
                    SecurityEntry entry =
                        (SecurityEntry) Registry.getEntry(
                            Registry.SECURITY,
                            groupmergeSecurityref);
                    if (entry != null)
                    {
                        SecurityReference ref = new BaseSecurityReference();
                        ref.setParent(entry.getName());
                        portlets.setSecurityRef(ref);
                    }
                }

                String mediaType = null;

                // Process each group profile
                int paneCount = 0;
                for (Iterator it = profiles.iterator(); it.hasNext();)
                {
                    Profile groupProfile = (Profile) it.next();
                    mediaType =
                        mediaType == null
                            ? groupProfile.getMediaType()
                            : mediaType;
                    Profile tmpProfile = (Profile) groupProfile.clone();
                    Portlets tmpPortlets =
                        tmpProfile.getDocument().getPortlets();

                    // If topmost control is a tab control, then add each tab to the container
                    Control paneControl = tmpPortlets.getControl();
                    if (paneControl != null
                        && paneControl.getName().equals(this.groupmergeControl))
                    {
                        for (int i = 0;
                            i < tmpPortlets.getPortletsCount();
                            i++)
                        {
                            Portlets pane = tmpPortlets.getPortlets(i);
                            pane.setLayout(null);
                            portlets.addPortlets(pane);
                            paneCount++;
                        }
                    }
                    // Otherwise, add the contents of profile as a pane
                    else
                    {
                        if (tmpPortlets.getTitle() == null)
                        {
                            String title =
                                org
                                    .apache
                                    .turbine
                                    .util
                                    .StringUtils
                                    .firstLetterCaps(
                                    groupProfile.getRoleName());
                            tmpPortlets.setTitle(title + " Home");
                        }
                        tmpPortlets.setLayout(null);
                        portlets.addPortlets(tmpPortlets);
                        paneCount++;
                    }

                    if (logger.isDebugEnabled())
                    {
View Full Code Here

Examples of org.apache.jetspeed.om.profile.psml.PsmlPortlets

    public Profile createProfile(ProfileLocator locator, Portlets portlets)
        throws ProfileException
    {
        if (portlets == null)
        {
            portlets = new PsmlPortlets();
        }

        Profile profile = createProfile(locator);
        PSMLDocument doc = new BasePSMLDocument(null, portlets);
        profile.setDocument(doc);
View Full Code Here

Examples of org.apache.jetspeed.om.profile.psml.PsmlPortlets

        else if (profiles.size() > 0)
        {
            try
            {
                // Create an empty portlet container
                Portlets portlets = new PsmlPortlets();
                Control control = new PsmlControl();
                control.setName(this.rolemergeControl);
                portlets.setControl(control);
                Controller controller = new PsmlController();
                controller.setName(this.rolemergeController);
                portlets.setController(controller);

                // Set the skin
                Skin skin = new PsmlSkin();
                skin.setName(PortalToolkit.getSkin((String) null).getName());
                portlets.setSkin(skin);

                String mediaType = null;

                // Process each role profile
                int paneCount = 0;
                for (Iterator it = profiles.iterator(); it.hasNext(); )
                {
                    Profile roleProfile = (Profile)it.next();
                    mediaType = mediaType == null ? roleProfile.getMediaType() : mediaType;
                    Profile tmpProfile = (Profile) roleProfile.clone();
                    Portlets tmpPortlets = tmpProfile.getDocument().getPortlets();

                    // If topmost control is a tab control, then add each tab to the container
                    Control paneControl = tmpPortlets.getControl();
                    if (paneControl != null && paneControl.getName().equals(this.rolemergeControl))
                    {
                        for (int i = 0; i < tmpPortlets.getPortletsCount(); i++)
                        {
                            Portlets pane = tmpPortlets.getPortlets(i);
                            pane.setLayout(null);                           
                            portlets.addPortlets(pane);
                            paneCount++;
                        }
                    }
                    // Otherwise, add the contents of profile as a pane
                    else
                    {
                        if (tmpPortlets.getTitle() == null)
                        {
                            String title = org.apache.turbine.util.StringUtils.firstLetterCaps(roleProfile.getRoleName());
                            tmpPortlets.setTitle(title + " Home");
                        }
                        tmpPortlets.setLayout(null);
                        portlets.addPortlets(tmpPortlets);
                        paneCount++;
                    }

                    if (logger.isDebugEnabled())
                    {
View Full Code Here

Examples of org.apache.jetspeed.om.profile.psml.PsmlPortlets

    public Profile createProfile(ProfileLocator locator, Portlets portlets)
            throws ProfileException
    {
        if (portlets == null)
        {
            portlets = new PsmlPortlets();
        }
       
        Profile profile = createProfile(locator);
        PSMLDocument doc = new BasePSMLDocument(null, portlets);
        profile.setDocument(doc);
View Full Code Here

Examples of org.apache.jetspeed.om.profile.psml.PsmlPortlets

                                                           .getDocument()
                                                           .getPortletsById(set.getID());
           
            if (portlets != null)
            {
                Portlets p = new PsmlPortlets();
                p.setMetaInfo(new PsmlMetaInfo());
                p.getMetaInfo().setTitle(title);
                p.setId(JetspeedIdGenerator.getNextPeid());
                SecurityReference defaultRef = PortalToolkit.getDefaultSecurityRef(
                    ((JetspeedRunData) rundata).getCustomizedProfile());
                if (defaultRef != null)
                {
                    if (logger.isDebugEnabled())
                    {
                        logger.debug("CustomizeSetAction: setting default portlet set security to [" + defaultRef.getParent() + "]");
                    }
                    p.setSecurityRef(defaultRef);
                }
                portlets.addPortlets(p);
            }
        }
View Full Code Here

Examples of org.apache.jetspeed.om.profile.psml.PsmlPortlets

        else if (profiles.size() > 0)
        {
            try
            {
                // Create an empty portlet container
                Portlets portlets = new PsmlPortlets();
                Control control = new PsmlControl();
                control.setName(this.rolemergeControl);
                portlets.setControl(control);
                Controller controller = new PsmlController();
                controller.setName(this.rolemergeController);
                portlets.setController(controller);

                // Set the skin
                Skin skin = new PsmlSkin();
                skin.setName(PortalToolkit.getSkin((String) null).getName());
                portlets.setSkin(skin);

                String mediaType = null;

                // Process each role profile
                int paneCount = 0;
                for (Iterator it = profiles.iterator(); it.hasNext(); )
                {
                    Profile roleProfile = (Profile)it.next();
                    mediaType = mediaType == null ? roleProfile.getMediaType() : mediaType;
                    Profile tmpProfile = (Profile) roleProfile.clone();
                    Portlets tmpPortlets = tmpProfile.getDocument().getPortlets();

                    // If topmost control is a tab control, then add each tab to the container
                    Control paneControl = tmpPortlets.getControl();
                    if (paneControl != null && paneControl.getName().equals(this.rolemergeControl))
                    {
                        for (int i = 0; i < tmpPortlets.getPortletsCount(); i++)
                        {
                            Portlets pane = tmpPortlets.getPortlets(i);
                            pane.setLayout(null);                           
                            portlets.addPortlets(pane);
                            paneCount++;
                        }
                    }
                    // Otherwise, add the contents of profile as a pane
                    else
                    {
                        String title = org.apache.turbine.util.StringUtils.firstLetterCaps(roleProfile.getRoleName());
                        tmpPortlets.setTitle(title + " Home");
                        tmpPortlets.setLayout(null);
                        portlets.addPortlets(tmpPortlets);
                        paneCount++;
                    }

                    if (Log.getLogger().isDebugEnabled())
                    {
View Full Code Here

Examples of org.apache.jetspeed.om.profile.psml.PsmlPortlets

    public Profile createProfile(ProfileLocator locator, Portlets portlets)
            throws ProfileException
    {
        if (portlets == null)
        {
            portlets = new PsmlPortlets();
        }
        Profile profile = createProfile(locator);
        PSMLDocument doc = new BasePSMLDocument(null, portlets);
        profile.setDocument(doc);
        doc = PsmlManager.createDocument(profile);
View Full Code Here

Examples of org.apache.jetspeed.om.profile.psml.PsmlPortlets

    {
        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");
        portlets.setController(controller);
        skin = new PsmlSkin();
        skin.setName("orange-red");
        portlets.setSkin(skin);
        rootPortletSet = portlets;

        portlets = new PsmlPortlets();
        // Add entries
        portlets.addEntry( createEntry(ALL_PORTLET, "ST_01.all"));
        portlets.addEntry( createEntry(USER_PORTLET, "ST_01.user"));
        portlets.addEntry( createEntry(ADMIN_PORTLET, "ST_01.admin"));
        rootPortletSet.addPortlets(portlets);

        Profile newProfile = Profiler.createProfile(newLocator, rootPortletSet);
        PSMLDocument doc = newProfile.getDocument();
        System.out.println("doc = " + doc.getName());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.