Package org.apache.jetspeed.om.profile

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


    */
    public static void save(RunData data)
    {
        try
        {
            Profile profile = ((JetspeedRunData) data).getCustomizedProfile();
            profile.store();
        }
        catch (Exception e)
        {
            logger.error("Error while saving profile", e);
        }
View Full Code Here


                //ql.setMediaType(jdata.getCapability().getPreferredMediaType());
                entries = new Hashtable();
                Iterator i = Profiler.query(ql);
                while (i.hasNext())
                {
                    Profile profile = (Profile) i.next();

                    String mediaType = profile.getMediaType();
                    if (mediaType != null && mediaType.equals(jdata.getCapability().getPreferredMediaType()))
                    {
                        if (PortletUtils.canAccessProfile(rundata, profile))
                        {
                            if (logger.isDebugEnabled())
                            {
                                logger.debug("MyPagesListBox: refreshing user profile list: " + profile.getPath());
                            }
                            String title = profile.getName();
                            if (profile.getRootSet() != null && profile.getRootSet().getTitle() != null)
                            {
                                title = profile.getRootSet().getTitle();
                            }
                            entries.put(profile, title);               
                        }
                    }
                }
View Full Code Here

        locator.createFromPath(path);
        String id = locator.getId();

        try
        {
            Profile profile = Profiler.getProfile(locator);
            PSMLDocument doc = profile.getDocument();

            if (doc == null)
            {
                return null;
            }
View Full Code Here

        locator.createFromPath(path);
        String id = locator.getId();

        try
        {
            Profile profile = Profiler.getProfile(locator);
            PSMLDocument doc = profile.getDocument();
            if (doc == null)
            {
                return null;
            }
            Portlets portlets = doc.getPortlets();
View Full Code Here

    // last modified: 10/31/01
    // Andreas Kempf, Siemens ICM S CP PE, Munich
    // ---------------------------------------------------------------------
    public static List getPortletList (RunData rundata)
    {
      Profile profile = ((JetspeedRunData)rundata).getCustomizedProfile();
      Portlets allPortlets = profile.getDocument().getPortletsById(((PortletSet)((JetspeedRunData)rundata).getCustomized()).getID());

     
      List installed = new ArrayList ();
      Entry iPortlet;
View Full Code Here

        // Verify we have a CapabilityMap
        CapabilityMap cm = ((JetspeedRunData)rundata).getCapability();
        assertNotNull( "Got Capability", cm);

        // 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)
        {
            ProfileLocator profileLocator = (ProfileLocator) profile;
            assertTrue("Verify the 'anonymous' is set", profileLocator.getAnonymous());
            assertNull("Verify the group is null", profileLocator.getGroup());
            assertNull("Verify the role is null", profileLocator.getRole());
        } else
        {
            assertTrue( "profile does not implement ProfileLocator", false);
        }
       

        // Verify we have a Document
        PSMLDocument psmlDoc = profile.getDocument();
        assertNotNull( "Got psmlDocument", psmlDoc);

        System.out.println("DocumentName = " + profile.getDocument().getName());

        // Get and populate the context
        Context context = TurbineVelocity.getContext(rundata);
        assertNotNull( "Got context", context);
        TurbinePull.populateContext( context, rundata);
View Full Code Here

        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)
        {
View Full Code Here

        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)
        {
View Full Code Here

        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)
        {
View Full Code Here

        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());

        // this only works with the default configuration (Castor/Filebased)
        File file = new File(doc.getName());
        assertTrue(file.exists());
View Full Code Here

TOP

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

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.