Package org.apache.jetspeed.om.profile

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


            (PortletSet) ((JetspeedRunData) rundata).getCustomized();

        try
        {
            String skin = rundata.getParameters().getString("skin");
            Profile profile =
                ((JetspeedRunData) rundata).getCustomizedProfile();
            Portlets portlets =
                profile.getDocument().getPortletsById(set.getID());

            // skin is neither null nor zero-length
            if ((skin != null) && (skin.trim().length() > 0))
            {
                PortletSkin s = PortalToolkit.getSkin(skin);

                if (s != null)
                {
                    set.getPortletConfig().setPortletSkin(s);

                    Skin psmlSkin = portlets.getSkin();
                    if (psmlSkin == null)
                    {
                        portlets.setSkin(new PsmlSkin());
                    }
                    portlets.getSkin().setName(skin);
                }
                else
                {
                    logger.warn(
                        "Unable to update skin for portlet set "
                            + set.getID()
                            + " because skin "
                            + skin
                            + " does not exist.");
                    return;
                }
            }
            else
            {
                // skin is either null or zero-length
                String custPortletSetID = portlets.getId();
                String rootPortletSetID = profile.getRootSet().getID();

                // set system default skin for root PSML element
                if (custPortletSetID != null
                    && rootPortletSetID != null
                    && custPortletSetID.equals(rootPortletSetID))
View Full Code Here


        try
        {
            String securityRefName =
                rundata.getParameters().getString("securityRef");
            SecurityReference securityRef = null;
            Profile profile =
                ((JetspeedRunData) rundata).getCustomizedProfile();
            Portlets portlets =
                profile.getDocument().getPortletsById(set.getID());

            if ((securityRefName != null)
                && (securityRefName.trim().length() > 0))
            {
                securityRef = new BaseSecurityReference();
View Full Code Here

        try
        {
            JetspeedRunData rundata = getRunData();
            if (rundata != null)
            {
                Profile profile = Profiler.createProfile();
                profile.setUser(user);
                profile.setMediaType("html");
                Profiler.createProfile(getRunData(), profile);
            }
        }
        catch (Exception e)
        {
View Full Code Here

        locator.createFromPath(locatorPath);
        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

                }
                try
                {
                    while (i.hasNext())
                    {
                        Profile profile = (Profile) i.next();
                        String compareValue = null;
                        if (filterType.equals(FILTER_TYPE_USER))
                        {
                            compareValue = profile.getUserName();
                        }
                        else if (filterType.equals(FILTER_TYPE_ROLE))
                        {
                            compareValue = profile.getRoleName();                        }
                        else if (filterType.equals(FILTER_TYPE_GROUP))
                        {
                            compareValue = profile.getGroupName();                       
                        }

                        if (compareValue != null)
                        {
                            if (useRE && r.match(compareValue))
                            {
                                entries.add(profile);
                            }
                            else if (compareValue.startsWith(filterValue))
                            {
                                entries.add(profile);
                            }
                        }
                    }
                }
                catch (Exception e)
                {
                    logger.error("Exception", e);
                }
            }
            else
            {
                while (i.hasNext())
                {
                    Profile profile = (Profile) i.next();
                    //System.out.println("profile["+index+"]="+profile.getPath());
                    entries.add(profile);
                    index++;
                }
            }
View Full Code Here

    public void doDelete(RunData data, Context context) throws Exception
    {
      JetspeedRunData jdata = (JetspeedRunData)data;
      PortletSet customizedSet = (PortletSet)jdata.getCustomized();
      int position = data.getParameters().getInt("position",-1);
      Profile profile = jdata.getCustomizedProfile();

      // ADDED for WML
      //boolean isWML = (profile.getMediaType().equalsIgnoreCase("wml"));


        if (customizedSet == null) return;

        if (position > -1)
        {
            Portlets set = profile.getDocument()
                                  .getPortletsById(customizedSet.getID());
            if (set != null)
            {
                // first try explicit portlets position
                for(int i=0; i < set.getPortletsCount(); i++)
View Full Code Here

    public void doMove(RunData data, Context context, boolean moveUp) throws Exception
    {
        JetspeedRunData jdata = (JetspeedRunData)data;
        PortletSet customizedSet = (PortletSet)jdata.getCustomized();
        int position = data.getParameters().getInt("position",-1);
        Profile profile = jdata.getCustomizedProfile();

        // ADDED for WML
        //boolean isWML = (profile.getMediaType().equalsIgnoreCase("wml"));


        if (customizedSet == null) return;

        if (position > -1)
        {
            int target = -1;

            Portlets set = profile.getDocument()
                                  .getPortletsById(customizedSet.getID());
            Layout targetLayout = null;
            Layout baseLayout = null;

            if (set != null)
View Full Code Here

        try
        {
            JetspeedRunData rundata = getRunData();
            if (rundata != null && Profiler.useRoleProfileMerging() == false)
            {
                Profile profile = Profiler.createProfile();
                profile.setUser(user);
                profile.setMediaType("html");
                Profiler.createProfile(getRunData(), profile);
            }
        }
        catch (Exception 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

    /**
     * @see PortalPersistenceService#store(PortletInstance)
     */
    public void store(PortletInstance pPortlet) throws PortalPersistenceException
    {
        Profile profile = pPortlet.getProfile();
        profile.setDocument(pPortlet.getDocument());
       
        if(!PsmlManager.store(profile))
        {
            throw new PortalPersistenceException("Unable to write portlet information.");
        }
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.