Package org.apache.jetspeed.om

Examples of org.apache.jetspeed.om.BaseSecurityReference


                meta.setDescription("This is the big kahuna meta portlet");
                meta.setTitle("The Meta Kahuna Portlet");
                entry.setMetaInfo(meta);
                entry.setName("BigKahuna");           
                entry.setParent(null);
                SecurityReference ref = new BaseSecurityReference();
                ref.setParent("admin-only");
                entry.setSecurityRef(ref);
                entry.setTitle("The Kahuna Portlet");
                entry.setType(PortletEntry.TYPE_ABSTRACT);               
                entry.setURL("http://bigkahuna.org");
                   
                // parameters
                entry.addParameter("simple", "simple-value");
               
                CachedParameter param = new BaseCachedParameter();
                param.setDescription("pdescription");
                param.setHidden(false);
                meta = new BaseMetaInfo();
                meta.setDescription("meta desc");
                meta.setImage("meta image");
                meta.setTitle("meta title");
                param.setMetaInfo(meta);
                param.setName("coconut");               
                SecurityReference ref2 = new BaseSecurityReference();
                ref2.setParent("admin-only");               
                param.setSecurityRef(ref2);
                param.setTitle("Coconut");
                param.setType("hmm");
                param.setValue("hawaii");
                entry.addParameter(param);
                param.setCachedOnName(true);
                param.setCachedOnValue(false);

               
                param = new BaseCachedParameter();
                param.setDescription("second pdescription");
                param.setHidden(true);
                meta = new BaseMetaInfo();
                meta.setDescription("second meta desc");
                meta.setImage("second meta image");
                meta.setTitle("second meta title");
                param.setMetaInfo(meta);
                param.setName("second coconut");
                SecurityReference ref3 = new BaseSecurityReference();
                ref3.setParent("second admin-only");               
                param.setSecurityRef(ref3);
                param.setTitle("second Coconut");
                param.setType("second hmm");
                param.setValue("second hawaii");
                entry.addParameter(param);
View Full Code Here


        pe.setMetaInfo(meta);               
        pe.setName(pde.getName());           
        pe.setParent(pde.getParent());
        if(pde.getSecurityRef() != null)
        {
            SecurityReference ref = new BaseSecurityReference();
            ref.setParent(pde.getSecurityRef());
            pe.setSecurityRef(ref);
        }

        pe.setTitle(pde.getTitle());
        pe.setType(pde.getType());
        pe.setURL(pde.getURL());
       
        // parameters
        Iterator params = pde.getPortletParameters().iterator();
        while (params.hasNext())
        {
            PortletParameter pp = (PortletParameter)params.next();
            CachedParameter cp = new BaseCachedParameter(pp.getId());
            cp.setCachedOnName(pp.getCachedOnName());
            cp.setCachedOnValue(pp.getCachedOnValue());
            cp.setDescription(pp.getDescription());
            cp.setHidden(pp.getHidden());
            cp.setName(pp.getName());
            cp.setType(pp.getType());
            cp.setValue(pp.getValue());

           
            cp.setTitle(pp.getTitle());
            if (pp.getDescription() != null || pp.getTitle() != null || pp.getImage() != null)
            {
                MetaInfo meta2 = new BaseMetaInfo();
                meta2.setImage(pp.getImage());
                meta2.setDescription(pp.getDescription());
                meta2.setTitle(pp.getTitle());
                cp.setMetaInfo(meta2);
            }
            if (pp.getSecurityRef() != null)
            {
                SecurityReference ref2 = new BaseSecurityReference();
                ref2.setParent(pp.getSecurityRef());
                cp.setSecurityRef(ref2);
            }           
            pe.addParameter(cp);
        }
       
View Full Code Here

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

                String mediaType = null;
View Full Code Here

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

     * @param type of entity to return default security ref for
     * @return default security reference
     */
    public SecurityReference getDefaultSecurityRef(String type)
    {
        BaseSecurityReference result = null;

        SecurityEntry entry = null;

        String defaultRef = null;
        if (type.equals(Profiler.PARAM_USER))
        {
            defaultRef = this.defaultUserSecurityRef;
        }
        else if (type.equals(Profiler.PARAM_ANON))
        {
            defaultRef = this.defaultAnonSecurityRef;
        }
        else if (type.equals(Profiler.PARAM_ROLE))
        {
            defaultRef = this.defaultRoleSecurityRef;
        }
        else if (type.equals(Profiler.PARAM_GROUP))
        {
            defaultRef = this.defaultGroupSecurityRef;
        }

        if (defaultRef != null)
        {
            entry = (SecurityEntry) Registry.getEntry(Registry.SECURITY, defaultRef);
            if (logger.isDebugEnabled())
            {
                logger.debug(
                    "JetspeedPortalToolkit: default security for type: " + type + " is " + defaultRef);
            }
            if (entry != null)
            {
                result = new BaseSecurityReference();
                result.setParent(entry.getName());
                if (logger.isDebugEnabled())
                {
                    logger.debug(
                        "JetspeedPortalToolkit: default security for type: "
                            + type
View Full Code Here

                profile.getDocument().getPortletsById(set.getID());

            if ((securityRefName != null)
                && (securityRefName.trim().length() > 0))
            {
                securityRef = new BaseSecurityReference();
                securityRef.setParent(securityRefName);
            }
            set.getPortletConfig().setSecurityRef(securityRef);
            portlets.setSecurityRef(securityRef);
        }
View Full Code Here

        portletEntry.setHidden(isHidden);
        //portletEntry.

        if (newSecurityParent != null && newSecurityParent.length() > 0)
        {
            SecurityReference securityRef = new BaseSecurityReference();
            securityRef.setParent(newSecurityParent);
            portletEntry.setSecurityRef(securityRef);
        }

        if (newSecurityRole != null && newSecurityRole.length() > 0)
        {
View Full Code Here

            Profile profile = ((JetspeedRunData) rundata).getCustomizedProfile();
            Portlets portlets = profile.getDocument().getPortletsById(set.getID());

            if ((securityRefName != null) && (securityRefName.trim().length() > 0))
            {
                securityRef = new BaseSecurityReference();
                securityRef.setParent(securityRefName);
            }
            set.getPortletConfig().setSecurityRef(securityRef);
            portlets.setSecurityRef(securityRef);
        }
View Full Code Here

     * @param type of entity to return default security ref for
     * @return default security reference
     */
    public SecurityReference getDefaultSecurityRef(String type)
    {
        BaseSecurityReference result = null;

        SecurityEntry entry = null;

        String defaultRef = null;
        if (type.equals(Profiler.PARAM_USER))
        {
            defaultRef = this.defaultUserSecurityRef;
        }
        else if (type.equals(Profiler.PARAM_ANON))
        {
            defaultRef = this.defaultAnonSecurityRef;
        }
        else if (type.equals(Profiler.PARAM_ROLE))
        {
            defaultRef = this.defaultRoleSecurityRef;
        }
        else if (type.equals(Profiler.PARAM_GROUP))
        {
            defaultRef = this.defaultGroupSecurityRef;
        }

        if (defaultRef != null)
        {
            entry = (SecurityEntry) Registry.getEntry(Registry.SECURITY, defaultRef);
            if (logger.isDebugEnabled())
            {
                logger.debug(
                    "JetspeedPortalToolkit: default security for type: " + type + " is " + defaultRef);
            }
            if (entry != null)
            {
                result = new BaseSecurityReference();
                result.setParent(entry.getName());
                if (logger.isDebugEnabled())
                {
                    logger.debug(
                        "JetspeedPortalToolkit: default security for type: "
                            + type
View Full Code Here

            if (securityChanged == true)
            {
                SecurityReference securityRef = null;
                if ((newSecurityParent.trim().length() > 0))
                {
                    securityRef = new BaseSecurityReference();
                    securityRef.setParent( newSecurityParent);
                }
                // Note: setting the portlet's config may not be a good idea -
                // it might be used as the Portlet for other PSMLDocument Entries that
                // have a different idea of security - and the caching of Portlets does
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.om.BaseSecurityReference

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.