Examples of IChannelDefinition


Examples of org.jasig.portal.channel.IChannelDefinition

        try
        {
            IChannelRegistryStore crs = ChannelRegistryStoreFactory
                .getChannelRegistryStoreImpl();
            int pubId = Integer.parseInt(channelPublishId);
            IChannelDefinition def = crs.getChannelDefinition(pubId);
            return def.getParametersAsUnmodifiableMap();
        } catch (Exception e)
        {
            throw new PortalException("Unable to acquire channel definition.",
                    e);
        }
View Full Code Here

Examples of org.jasig.portal.channel.IChannelDefinition

        try
        {
            IChannelRegistryStore crs = ChannelRegistryStoreFactory
                .getChannelRegistryStoreImpl();
            int pubId = Integer.parseInt(getChannelPublishId());
            IChannelDefinition def = crs
                    .getChannelDefinition(pubId);
            IChannelParameter parm = def.getParameter(parameterName);

            if (parm == null) // ad-hoc parm so delete
            {
                parameters.remove(parameterName);
                override.remove(parameterName);
View Full Code Here

Examples of org.jasig.portal.channel.IChannelDefinition

    String owner = IPermission.PORTAL_FRAMEWORK;
    String target = IPermission.CHANNEL_PREFIX + channelPublishId;
   
    // retrieve the indicated channel from the channel registry store and
    // determine its current lifecycle state
    IChannelDefinition channel = this.channelRegistryStore.getChannelDefinition(channelPublishId);
    if (channel == null){
        throw new AuthorizationException("Unable to locate channel " + channelPublishId);
    }
   
    final String activity = IPermission.PORTLET_MODE_CONFIG;
View Full Code Here

Examples of org.jasig.portal.channel.IChannelDefinition

    String owner = IPermission.PORTAL_FRAMEWORK;
    String target = IPermission.CHANNEL_PREFIX + channelPublishId;
   
    // retrieve the indicated channel from the channel registry store and
    // determine its current lifecycle state
  IChannelDefinition channel = this.channelRegistryStore
        .getChannelDefinition(channelPublishId);
    if (channel == null){
      return doesPrincipalHavePermission(principal, owner,
        IPermission.CHANNEL_MANAGER_APPROVED_ACTIVITY, target);
//      throw new AuthorizationException("Unable to locate channel " + channelPublishId);
    }   
    ChannelLifecycleState state = channel.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 all = IPermission.ALL_CHANNELS_TARGET;
    String activity = IPermission.CHANNEL_MANAGER_EXPIRED_ACTIVITY;
  if ((order <= ChannelLifecycleState.EXPIRED.getOrder()
      || channel.getExpirationDate() != null)
      && (doesPrincipalHavePermission(principal, owner, activity, all)
        || doesPrincipalHavePermission(principal, owner,
            activity, target))) {
    return true;
    }
 
  activity = IPermission.CHANNEL_MANAGER_ACTIVITY;
  if ((order <= ChannelLifecycleState.PUBLISHED.getOrder()
        || channel.getPublishDate() != null)
      && (doesPrincipalHavePermission(principal, owner, activity, all)
        || doesPrincipalHavePermission(principal, owner,
            activity, target))) {
      return true;
    }
View Full Code Here

Examples of org.jasig.portal.channel.IChannelDefinition

    String owner = IPermission.PORTAL_FRAMEWORK;
    String target = IPermission.CHANNEL_PREFIX + channelPublishId;
   
    // retrieve the indicated channel from the channel registry store and
    // determine its current lifecycle state
  IChannelDefinition channel = this.channelRegistryStore
        .getChannelDefinition(channelPublishId);
    if (channel == null){
      return false;
    }   
    ChannelLifecycleState state = channel.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

Examples of org.jasig.portal.channel.IChannelDefinition

    public void testIsPortlet() {
        IChannelType channelType = EasyMock.createMock(IChannelType.class);
        EasyMock.expect(channelType.getId()).andReturn(1).anyTimes();
        EasyMock.replay(channelType);
       
        IChannelDefinition cd1 = new ChannelDefinitionImpl(channelType, "fname", CGenericXSLT.class.getName(), "Name", "title");
        assertFalse(cd1.isPortlet());
       
        IChannelDefinition cd2 = new ChannelDefinitionImpl(channelType, "fname", CSpringPortletAdaptor.class.getName(), "Name", "title");
        assertTrue(cd2.isPortlet());
       
    }
View Full Code Here

Examples of org.jasig.portal.channel.IChannelDefinition

    public void testGetDocument() throws ParserConfigurationException {
        IChannelType channelType = EasyMock.createMock(IChannelType.class);
        EasyMock.expect(channelType.getId()).andReturn(12).anyTimes();
        EasyMock.replay(channelType);
       
        IChannelDefinition cd = new ChannelDefinitionImpl(channelType, "test_fname", CGenericXSLT.class.getName(), "testName", "testTitle");
       
        cd.setDescription("A test channel description.");
        cd.setEditable(false);
        cd.setHasAbout(true);
        cd.setHasHelp(false);
        cd.setIsSecure(false);
        cd.setTimeout(500);
       
        Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
       
        Element channelElement = cd.getDocument(doc, "testId");
       
        assertEquals("channel", channelElement.getNodeName());
        assertSame(doc, channelElement.getOwnerDocument());
       
        doc.appendChild(channelElement);
View Full Code Here

Examples of org.jasig.portal.channel.IChannelDefinition

    /* (non-Javadoc)
     * @see org.jasig.portal.api.portlet.PortletDelegationLocator#createRequestDispatcher(java.lang.String)
     */
    @Override
    public PortletDelegationDispatcher createRequestDispatcher(PortletRequest portletRequest, String fName) {
        final IChannelDefinition channelDefinition = this.channelRegistryStore.getChannelDefinition(fName);
        if (channelDefinition == null || !channelDefinition.isPortlet()) {
            return null;
        }
       
        final IPortletDefinition portletDefinition = this.portletDefinitionRegistry.getPortletDefinition(channelDefinition.getId());
        final IPortletDefinitionId portletDefinitionId = portletDefinition.getPortletDefinitionId();
       
        return this.createRequestDispatcher(portletRequest, portletDefinitionId);
    }
View Full Code Here

Examples of org.jasig.portal.channel.IChannelDefinition

        this.portletEntityRegistry.storePortletEntity(portletEntity);
    }
   
    protected IPortletEntity getPortletEntity(String fName, String channelSubscribeId, int userId) {
        //Load the channel definition
        final IChannelDefinition channelDefinition;
        try {
            channelDefinition = this.channelRegistryStore.getChannelDefinition(fName);
        }
        catch (Exception e) {
            throw new DataRetrievalFailureException("Failed to retrieve ChannelDefinition for fName='" + fName + "'", e);
        }
       
        //The channel definition for the fName MUST exist for this class to function
        if (channelDefinition == null) {
            throw new EmptyResultDataAccessException("No ChannelDefinition exists for fName='" + fName + "'", 1);
        }
       
        //get/create the portlet definition
        final int channelDefinitionId = channelDefinition.getId();
        final IPortletDefinition portletDefinition = this.portletDefinitionRegistry.getOrCreatePortletDefinition(channelDefinitionId);
       
        //get/create the portlet entity
        final IPortletDefinitionId portletDefinitionId = portletDefinition.getPortletDefinitionId();
        return this.portletEntityRegistry.getOrCreatePortletEntity(portletDefinitionId, channelSubscribeId, userId);
View Full Code Here

Examples of org.jasig.portal.channel.IChannelDefinition

                final ByteArrayInputStream is = new ByteArrayInputStream(bytes);
                final IChannelPublisher publisher =
                    ChannelPublisher.getChannelArchiveInstance();

                IChannelDefinition chanDef = null;

                chanDef = publisher.publishChannel(is);

                if (chanDef != null && log.isInfoEnabled())
                    log.info(
                        " Successfully published channel "
                            + chanDef.getTitle()
                            + " with fname "
                            + chanDef.getFName());
            }
            catch (Exception e)
            {
                if (log.isInfoEnabled())
                    log.info(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.