Package org.apache.jetspeed.om.profile

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


        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

        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

            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() )
                    {
                        logger.debug("JetspeedPortletTag: retrieved [" + entry + "] from psml [" + this.psml);
                    }
                }
View Full Code Here

     * mailto: A.Kempf@web.de
     */
    public Profile createProfile(RunData data, Profile profile)
        throws ProfileException
    {
        Profile current = null;
        CapabilityMap map;

        String newTemplate;

        if (data == null)
        {
            map = CapabilityMapFactory.getDefaultCapabilityMap();
        }
        else
        {
            map = ((JetspeedRunData) data).getCapability();
        }
        String mediaType = getMediaType(data, map);

        // if template is null then use role-based psml
        if (newUserTemplate == null)
            return current;

        // If we see a group use it, else fall back to the prrior method
        // Remember that Roles can also have profiles so it is not enough to just check for profile.getGroup() == null
        // newTemplate is then passed into the createProfile call a few lines later
        if (profile.getGroup() != null)
        {
            newTemplate = newGroupTemplate;
        }
        else
        {
            newTemplate = newUserTemplate;
        }

        if (mediaTypes != null)
        {
            Profile dummy;
            for (int ix = 0; ix < mediaTypes.length; ix++)
            {
                dummy =
                    createProfile(data, profile, mediaTypes[ix], newTemplate);
                if (mediaTypes[ix].equalsIgnoreCase(mediaType))
View Full Code Here

     */
    public Profile getProfile(RunData data, CapabilityMap cm)
        throws ProfileException
    {
        JetspeedRunData rundata = (JetspeedRunData) data;
        Profile profile = fallbackProfile(rundata, cm);
        if (null == profile && useRoleFallback)
        {
            JetspeedUser user = rundata.getJetspeedUser();
            if (user != null)
            {
View Full Code Here

        JetspeedRunData data = (JetspeedRunData) pageContext.getAttribute(JspService.RUNDATA, PageContext.REQUEST_SCOPE);
       
        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)
            {               
View Full Code Here

     */
    protected Profile getRoleProfile(JetspeedRunData rundata, CapabilityMap cm)
        throws Exception
    {
        Vector profiles = new Vector();
        Profile profile = null;
        String paramRole =
            rundata.getParameters().getString(Profiler.PARAM_ROLE);
        Iterator groupRoles =
            JetspeedSecurity.getRoles(rundata.getUser().getUserName());
        if (groupRoles != null)
View Full Code Here

     * @exception Exception
     */
    protected Profile mergeRoleProfiles(RunData data, Vector profiles)
        throws Exception
    {
        Profile result = null;
        // If merge feature is not turned on, return
        // profile for the first role (if any)
        if (!this.useRoleMerge)
        {
            if (profiles.size() > 0)
            {
                result = (Profile) profiles.get(0);
            }
        }
        // Proceed with merging all profiles
        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))
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.