Package org.apache.jetspeed.om.profile

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


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


    public ConcreteElement getContent(RunData rundata)
    {
        if (useDelayedRendering(rundata))
        {
            Profile profile = ((JetspeedRunData) rundata).getProfile();
            String path = profile.getPath();
            String portletId = getID();
           
            // FIXME: please use JetspeedLink to create Portal URLs          
            String docUrl = "portal/" + path + "/js_peid/" + portletId + "?action=controls.Print";
            docUrl = URLEncoder.encode(docUrl); //, "UTF-8");
View Full Code Here

            logger.error("The RunData object does not implement the expected interface, "
                       + "please verify the RunData factory settings", e);
            return;
        }

        Profile newProfile = null;
        Profile currentProfile = null;

        try
        {
            // get the profile and store it in the RunData
            newProfile = Profiler.getProfile(jdata);
            currentProfile = jdata.getProfile();
        }
        catch (Throwable other)
        {
            data.setScreenTemplate(JetspeedResources.getString(TurbineConstants.TEMPLATE_ERROR));
            String message = other.getMessage() != null ? other.getMessage() : other.toString();
            data.setMessage(message);
            data.setStackTrace(org.apache.turbine.util.StringUtils.stackTrace(other), other);

            if (currentProfile == null)
            {
                currentProfile = Profiler.createProfile();
            }
            if (newProfile == null)
            {
                newProfile = Profiler.createProfile();
            }
            if (data.getUser() == null)
            {
                JetspeedUser juser = new FakeJetspeedUser(JetspeedSecurity.getAnonymousUserName(), false);
                data.setUser(juser);
            }
        }


        if ((currentProfile == null)
         || (!currentProfile.equals(newProfile)))
        {
            // the profile changed due to the request parameters,
            // change it in the RunData
            jdata.setProfile(newProfile);
        }
View Full Code Here

                    {
                        logger.debug("BaseJetspeedLink: elementValue = " + elementValue);
                    }
                    uriPathElement = JetspeedResources.PATH_PORTLETID_KEY;
                    ProfileLocator baseLocator = Profiler.createLocator();
                    Profile baseProfile = null;
                    switch (rootType)
                    {
                        case JetspeedLink.DEFAULT:
                            break;
                        case JetspeedLink.CURRENT:
                            baseProfile = rundata.getProfile();
                            break;
                        case JetspeedLink.GROUP:
                            baseLocator.setGroupByName(rootValue);
                            break;
                        case JetspeedLink.ROLE:
                            baseLocator.setRoleByName(rootValue);
                            break;
                        case JetspeedLink.USER:
                            try
                            {
                                if (logger.isDebugEnabled())
                                {
                                    logger.debug("BaseJetspeedLink: rootValue user = " + rootValue);
                                }
                                baseLocator.setUser(org.apache.jetspeed.services.JetspeedSecurity.getUser(rootValue));
                            }
                            catch (Exception se)
                            {
                                logger.error("Exception",  se);
                                return null;
                            }
                            break;
                    }
                   
                    if ((rootType != JetspeedLink.CURRENT) && (rootType != JetspeedLink.DEFAULT))
                    {
                        if (mediaType != null && mediaType.length() > 0)
                        {
                            baseLocator.setMediaType(mediaType);
                        }
                        if (language != null && language.length() > 0)
                        {
                            baseLocator.setLanguage(language);
                        }
                        if (country != null && country.length() > 0)
                        {
                            baseLocator.setCountry(country);
                        }
                        if (pageName != null && pageName.length() > 0)
                        {
                            baseLocator.setName(pageName);
                        }
                        baseProfile = Profiler.getProfile(baseLocator);
                    }
                  
                    if (logger.isDebugEnabled())
                    {
                        logger.debug("BaseJetspeedLink: baseLocator = " + baseLocator.getPath());
                    }

                    if ((baseProfile != null) && (elementValue != null))
                    {
                        if (logger.isDebugEnabled())
                        {
                           logger.debug("BaseJetspeedLink: baseProfile = " + baseProfile.toString());
                        }
                        if (baseProfile.getDocument() != null)
                        {
                            if (logger.isDebugEnabled())
                            {
                                logger.debug("BaseJetspeedLink: baseProfile.getDocment() = " + baseProfile.getDocument());
                            }
                            Entry entry = baseProfile.getDocument().getEntry(elementValue);
                            if (entry != null)
                            {
                                if (logger.isDebugEnabled())
                                {
                                    logger.debug("BaseJetspeedLink: entry id = " + entry.getId());
View Full Code Here

    /**
     * @see PortalPersistenceService#store(PortletInstance)
     */
    public void store(PortletInstance pPortlet) throws PortalPersistenceException
    {
        Profile profile = pPortlet.getProfile();
        profile.setDocument(pPortlet.getDocument());
        if (false == this.autoStore)
        {
            if (null == profile.getUser())
            {
                return; // don't store if its not a user profile
            }
        }
       
View Full Code Here

        ConcreteElement result = null;
        String msg = "";

        if (null != rundata)
        {
            Profile profile = rundata.getProfile();
            try
            {
                if (null == profile)
                {
                    profile = Profiler.getProfile(rundata);
                    if (profile == null)
                    {
                        throw new ProfileException("Profile not found.");
                    }
                    rundata.setProfile(profile);
                }

                if ((name == null)
                    || Profiler.DEFAULT_PROFILE.equals(name)
                    || "".equals(name));
                else
                    profile.setName(name);

                PSMLDocument doc = profile.getDocument();
                if (null != doc)
                {
                    result =
                        PortalToolkit.getSet(doc.getPortlets()).getContent(
                            rundata);
View Full Code Here

        {

            if (null != data)
            {
                JetspeedRunData jdata = (JetspeedRunData) data;
                Profile profile = jdata.getProfile();

                if (null == profile)
                {
                    logger.warn("JetspeedTool: profile is null");
                    profile = Profiler.getProfile(jdata);
View Full Code Here

    {
        ConcreteElement result = null;

        if (null != rundata)
        {
            Profile profile = rundata.getProfile();
            try
            {
                if (null == profile)
                {
                    System.out.println("profile is null");
                    profile = Profiler.getProfile(rundata);
                    rundata.setProfile(profile);
                }

                PSMLDocument doc = profile.getDocument();
                if (null != doc)
                {
                    Entry entry = doc.getEntryById(id);
                    if (null == entry)
                    {
View Full Code Here

     * "js_peid" parameter
     */
    public Entry getEntryFromRequest() throws Exception
    {
        String jsPeid = rundata.getParameters().getString("js_peid");
        Profile profile = Profiler.getProfile(rundata);
        PSMLDocument doc = profile.getDocument();
        return doc.getEntryById(jsPeid);
    }
View Full Code Here

       
        // get the customization state for this page
        SessionState customizationState = jdata.getPageSessionState();

        // this will be the profile we are editing
        Profile profile = null;

        // the "reset" parameter's presence signals the start of customization
        if (    (resetStack != null)
            &&  ((resetStack.equalsIgnoreCase("on")) || (resetStack.equalsIgnoreCase("1"))))
        {
            // clear out any prior customization state
            jdata.cleanupFromCustomization();
        }

        // if we have not yet setup for customization, do so now
        if (jdata.getCustomizedProfile() == null)
        {
            ProfileLocator locator = (ProfileLocator)jdata.getProfile().clone();

            if (editMediaType != null)
            {
                locator.setMediaType(editMediaType);
            }

            // get a profile to edit
            profile = (Profile) Profiler.getProfile(locator).clone();
            jdata.setCustomizedProfile(profile);
        }

        // we are continuing an on-going customization
        else
        {
            // get the profile we are working on
            profile = jdata.getCustomizedProfile();
        }

        // Get js_peid parmameter.
        // If it does not exist, we will customize the root of the profile
        if ( peid == null )
        {
            // use the id of the root set of the profile
            peid = profile.getRootSet().getID();
            jdata.setJs_peid(peid);
        }

        // find the portlet within the profile with this peid %%% isn't there a better way to do this? -ggolden
        Portlet found = null;
        Stack sets = new Stack();
        sets.push(profile.getRootSet());

        while ((found==null) && (sets.size() > 0))
        {
            PortletSet set = (PortletSet)sets.pop();
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.