Package org.jasig.portal.portlet.om

Examples of org.jasig.portal.portlet.om.IPortletDefinition


     * @return a <code>ChannelDefinition</code>
     **/
    protected IPortletDefinition getChannelDefinition( String subId )
        throws PortalException
    {
        IPortletDefinition chanDef = mChanMap.get(subId);

        if ( null == chanDef ){
            String fname = getFname(subId);
            if (log.isDebugEnabled())
                log.debug("TransientUserLayoutManagerWrapper>>getChannelDefinition, " +
View Full Code Here


        // obtain a description of the transient channel and
        // assign a new transient channel id
        if ( subId == null ) {
            try {
              IPortletDefinition chanDef = PortletDefinitionRegistryLocator.getPortletDefinitionRegistry().getPortletDefinitionByFname(fname);
                if(chanDef!=null) {
                    // assign a new id
                    subId = getNextSubscribeId();
                    mFnameMap.put(fname,subId);
                    mSubIdMap.put(subId,fname);
View Full Code Here

            return null;
        }

        try {
            // check cache first
            IPortletDefinition chanDef = mChanMap.get(nodeId);

            if (null == chanDef) {
              chanDef = PortletDefinitionRegistryLocator.getPortletDefinitionRegistry().getPortletDefinitionByFname(fname);
                mChanMap.put(nodeId, chanDef);
            }
View Full Code Here

    String owner = IPermission.PORTAL_PUBLISH;
    String target = IPermission.PORTLET_PREFIX + portletDefinitionId;
   
    // retrieve the indicated channel from the channel registry store and
    // determine its current lifecycle state
    IPortletDefinition portlet = this.portletDefinitionRegistry.getPortletDefinition(portletDefinitionId);
    if (portlet == null){
        throw new AuthorizationException("Unable to locate portlet " + portletDefinitionId);
    }
   
    final String activity = IPermission.PORTLET_MODE_CONFIG;
View Full Code Here

    String owner = IPermission.PORTAL_PUBLISH;
    String target = IPermission.PORTLET_PREFIX + portletDefinitionId;
   
    // retrieve the indicated channel from the channel registry store and
    // determine its current lifecycle state
    IPortletDefinition portlet = this.portletDefinitionRegistry.getPortletDefinition(portletDefinitionId);
    if (portlet == null){
      return doesPrincipalHavePermission(principal, owner,
        IPermission.PORTLET_MANAGER_APPROVED_ACTIVITY, target);
//      throw new AuthorizationException("Unable to locate channel " + channelPublishId);
    }   
    PortletLifecycleState state = portlet.getLifecycleState();
    int order = state.getOrder();
   
    /*
     * The following code assumes that later lifecycle states imply permission
     * for earlier lifecycle states.  For example, if a user has permission to
     * manage an expired channel, we assume s/he also has permission to
     * create, approve, and publish channels.  The following code counts
     * channels with auto-publish or auto-expiration dates set as requiring
     * publish or expiration permissions for management, even though the channel
     * may not yet be published or expired.
     */
   
    String activity = IPermission.PORTLET_MANAGER_MAINTENANCE_ACTIVITY;
    if (order <= PortletLifecycleState.MAINTENANCE.getOrder()
            && doesPrincipalHavePermission(principal, owner, activity, target)) {
        return true;
    }

    activity = IPermission.PORTLET_MANAGER_EXPIRED_ACTIVITY;
  if ((order <= PortletLifecycleState.EXPIRED.getOrder()
      || portlet.getExpirationDate() != null)
      && doesPrincipalHavePermission(principal, owner, activity, target)) {
    return true;
    }
 
  activity = IPermission.PORTLET_MANAGER_ACTIVITY;
  if ((order <= PortletLifecycleState.PUBLISHED.getOrder()
        || portlet.getPublishDate() != null)
      && doesPrincipalHavePermission(principal, owner, activity, target)) {
      return true;
    }
 
  activity = IPermission.PORTLET_MANAGER_APPROVED_ACTIVITY;
View Full Code Here

    String owner = IPermission.PORTAL_SUBSCRIBE;

   
    // retrieve the indicated channel from the channel registry store and
    // determine its current lifecycle state
    IPortletDefinition portlet = this.portletDefinitionRegistry.getPortletDefinition(portletDefinitionId);
    if (portlet == null){
      return false;
    }

    String target = PermissionHelper.permissionTargetIdForPortletDefinition(portlet);

    PortletLifecycleState state = portlet.getLifecycleState();
   
    /*
     * Each channel lifecycle state now has its own subscribe permission.  The
     * following logic checks the appropriate permission for the lifecycle.
     */
 
View Full Code Here

        }       
    }

    @Override
    protected void loadBasePortletPreferences(IPortletEntity portletEntity, Map<String, IPortletPreference> basePortletPreferences) {
        final IPortletDefinition portletDefinition = portletEntity.getPortletDefinition();
       
        //Add descriptor prefs to base Map
        final IPortletDefinitionId portletDefinitionId = portletDefinition.getPortletDefinitionId();
        final PortletDefinition portletDescriptor = this.portletDefinitionRegistry.getParentPortletDescriptor(portletDefinitionId);
        final Preferences descriptorPreferences = portletDescriptor.getPortletPreferences();
        for (final Preference preference : descriptorPreferences.getPortletPreferences()) {
            final IPortletPreference preferenceWrapper = new PortletPreferenceImpl(preference);
            basePortletPreferences.put(preferenceWrapper.getName(), preferenceWrapper);
        }

        //Add definition prefs to base Map
        final List<IPortletPreference> definitionPreferences = portletDefinition.getPortletPreferences();
        for (final IPortletPreference preference : definitionPreferences) {
            basePortletPreferences.put(preference.getName(), preference);
        }
    }
View Full Code Here

      // get the list of requested user attributes
        final HttpServletRequest httpServletRequest = this.portalRequestUtils.getPortletHttpRequest(request);
        final IPortletWindow portletWindow = this.portletWindowRegistry.convertPortletWindow(httpServletRequest, plutoPortletWindow);
        final IPortletEntity portletEntity = portletWindow.getPortletEntity();
        final IPortletDefinition portletDefinition = portletEntity.getPortletDefinition();
        final PortletApplicationDefinition portletApplicationDescriptor = this.portletDefinitionRegistry.getParentPortletApplicationDescriptor(portletDefinition.getPortletDefinitionId());
       
        // check to see if the password key is one of the requested user attributes
        List<? extends UserAttribute> requestedUserAttributes = portletApplicationDescriptor.getUserAttributes();
        for (final UserAttribute userAttributeDD : requestedUserAttributes) {
            final String attributeName = userAttributeDD.getName();
View Full Code Here

    @Override
    public IPortletEntity getOrCreateDefaultPortletEntity(HttpServletRequest request, IPortletDefinitionId portletDefinitionId) {
        Validate.notNull(request, "HttpServletRequest cannot be null");
        Validate.notNull(portletDefinitionId, "portletDefinitionId cannot be null");
       
        final IPortletDefinition portletDefinition = this.getPortletDefinition(request, portletDefinitionId);
        if (portletDefinition == null) {
            throw new IllegalArgumentException("No portlet definition found for id '" + portletDefinitionId + "'.");
        }
       
        //Determine the appropriate portlet window ID for the definition
        final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request);
        final IUserPreferencesManager preferencesManager = userInstance.getPreferencesManager();
        final IUserLayoutManager userLayoutManager = preferencesManager.getUserLayoutManager();
       
        //Determine the subscribe ID
        final String portletFName = portletDefinition.getFName();
        final String layoutNodeId = userLayoutManager.getSubscribeId(portletFName);
        if (layoutNodeId == null) {
            throw new IllegalArgumentException("No layout node ID found for fname '" + portletFName + "'.");
        }
       
View Full Code Here

            return null;
        }
       
        final String channelPublishId = channelNode.getChannelPublishId();
       
        final IPortletDefinition portletDefinition = this.getPortletDefinition(request, userInstance, channelPublishId);

        if (portletDefinition != null) {
          final IPerson person = userInstance.getPerson();
        return this.getOrCreatePortletEntity(request, portletDefinition.getPortletDefinitionId(), layoutNodeId, person.getID());
      }
     
      // No permission to see the portlet
      return null;
    }
View Full Code Here

TOP

Related Classes of org.jasig.portal.portlet.om.IPortletDefinition

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.