Package org.jasig.portal

Examples of org.jasig.portal.ChannelDefinition


              String publishId =  channelDesc.getChannelPublishId();

              if ( publishId != null ) {

               ChannelDefinition channelDef = crs.getChannelDefinition(CommonUtils.parseInt(publishId));

               if ( channelDef == null || !channelApproved(channelDef.getApprovalDate()) ) {
                 // Create an error channel if channel is missing or not approved
                 ChannelDefinition cd = new ChannelDefinition(Integer.parseInt(publishId));
                 cd.setTitle("Missing channel");
                 cd.setName("Missing channel");
                 cd.setTimeout(20000);
                 cd.setJavaClass(CError.class.getName());
                 cd.setEditable(false);
                 cd.setHasAbout(false);
                 cd.setHasHelp(false);
                 String missingChannel = "Unknown";
                 if (channelDef != null) {
                   missingChannel = channelDef.getName();
                 }
               
                 String errMsg = "The '" + missingChannel + "' channel is no longer available. Please remove it from your layout.";
                 cd.addParameter("CErrorChanId",publishId,String.valueOf(false));
                 cd.addParameter("CErrorMessage",errMsg,String.valueOf(false));
                 cd.addParameter("CErrorErrorId",ErrorCode.CHANNEL_MISSING_EXCEPTION.getCode()+"",String.valueOf(false));
                 channelDef = cd;
               }   

                 channelDesc.setChannelTypeId(channelDef.getTypeId()+"");
                 channelDesc.setClassName(channelDef.getJavaClass());
View Full Code Here


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

                ChannelDefinition 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

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

        if ( null == chanDef ){
            String fname = getFname(subId);
            if (log.isDebugEnabled())
View Full Code Here

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

        IUserLayoutChannelDescription ulnd = new UserLayoutChannelDescription();
        try
        {
            // check cache first
            ChannelDefinition chanDef = (ChannelDefinition)mChanMap.get(nodeId);

            if ( null == chanDef ) {
                chanDef = ChannelRegistryStoreFactory.getChannelRegistryStoreImpl().getChannelDefinition(fname);
                mChanMap.put(nodeId,chanDef);
            }

            ulnd.setId(nodeId);
            ulnd.setName(chanDef.getName());
            ulnd.setUnremovable(true);
            ulnd.setImmutable(true);
            ulnd.setHidden(false);
            ulnd.setTitle(chanDef.getTitle());
            ulnd.setDescription(chanDef.getDescription());
            ulnd.setClassName(chanDef.getJavaClass());
            ulnd.setChannelPublishId("" + chanDef.getId());
            ulnd.setChannelTypeId("" + chanDef.getTypeId());
            ulnd.setFunctionalName(chanDef.getFName());
            ulnd.setTimeout(chanDef.getTimeout());
            ulnd.setEditable(chanDef.isEditable());
            ulnd.setHasHelp(chanDef.hasHelp());
            ulnd.setHasAbout(chanDef.hasAbout());

            ChannelParameter[] parms = chanDef.getParameters();
            for ( int i=0; i<parms.length; i++ )
            {
                ChannelParameter parm = (ChannelParameter)parms[i];
                ulnd.setParameterValue(parm.getName(),parm.getValue());
                ulnd.setParameterOverride(parm.getName(),parm.getOverride());
View Full Code Here

        String r = null;
        if (entityID.getType().equals(chan)) {
            try {
                //Element c = ChannelRegistryManager.getChannel("chan"+entityID.getKey());
                //r = c.getAttribute(name);
                ChannelDefinition cd = ChannelRegistryStoreFactory.getChannelRegistryStoreImpl().getChannelDefinition(Integer.parseInt(entityID.getKey()));
                if (name.equals("Name")){
                  r = cd.getName();
                }
                if (name.equals("Title")){
                  r = cd.getTitle();
                }
                if (name.equals("Description")){
                  r = cd.getDescription();
                }
                if (name.equals("Functional Name")){
                  r = cd.getFName();
                }
                if (name.equals("Timeout")){
                  r = String.valueOf(cd.getTimeout());
                }
                if (name.equals("Secure")){
                  r = String.valueOf(cd.isSecure());
                }               
            } catch (Exception e) {
                log.error( "ChannelRegistryPropertyFinder.getProperty("+entityID.getKey()+"-"+entityID.getType().getName()+","+name+") :", e);
            }
        }
View Full Code Here

                        // append channel element iff subscribeId describes
                        // a transient channel, and not a regular layout channel

                        if ( null != subscribeId && !subscribeId.equals("") && mSubIdMap.containsKey(subscribeId))
                        {
                            ChannelDefinition chanDef = getChannelDefinition(subscribeId);
                            AttributesImpl channelAttrs = new AttributesImpl();
                            channelAttrs.addAttribute("","ID","ID","ID",subscribeId);
                            channelAttrs.addAttribute("","typeID","typeID","CDATA",
                                                      "" + chanDef.getTypeId());
                            channelAttrs.addAttribute("","hidden","hidden","CDATA","false");
                            channelAttrs.addAttribute("","editable","editable","CDATA",
                                                      CommonUtils.boolToStr(chanDef.isEditable()));
                            channelAttrs.addAttribute("","unremovable","unremovable","CDATA","true");
                            channelAttrs.addAttribute("","name","name","CDATA",chanDef.getName());
                            channelAttrs.addAttribute("","description","description","CDATA",
                                                      chanDef.getDescription());
                            channelAttrs.addAttribute("","title","title","CDATA",chanDef.getTitle());
                            channelAttrs.addAttribute("","class","class","CDATA",chanDef.getJavaClass());
                            channelAttrs.addAttribute("","chanID","chanID","CDATA",
                                                      "" + chanDef.getId());
                            channelAttrs.addAttribute("","fname","fname","CDATA",chanDef.getFName());
                            channelAttrs.addAttribute("","timeout","timeout","CDATA",
                                                      "" + chanDef.getTimeout());
                            channelAttrs.addAttribute("","hasHelp","hasHelp","CDATA",
                                                      CommonUtils.boolToStr(chanDef.hasHelp()));
                            channelAttrs.addAttribute("","hasAbout","hasAbout","CDATA",
                                                      CommonUtils.boolToStr(chanDef.hasAbout()));

                            startElement("",CHANNEL,CHANNEL,channelAttrs);

                            // now add channel parameters
                            ChannelParameter[] chanParms = chanDef.getParameters();
                            for( int i=0; i<chanParms.length; i++ )
                            {
                                AttributesImpl parmAttrs = new AttributesImpl();
                                ChannelParameter parm = (ChannelParameter)chanParms[i];
                                parmAttrs.addAttribute("","name","name","CDATA",parm.getName());
View Full Code Here

            // Create the PortletDefinition
            PortletDefinitionImpl portletDefinition = (PortletDefinitionImpl)InformationProviderAccess.getStaticProvider().getPortletDefinition(ObjectIDImpl.createFromString(portletDefinitionId));
            if (portletDefinition == null) {
                throw new PortalException("Unable to find portlet definition for ID '" + portletDefinitionId + "'");
            }
            ChannelDefinition channelDefinition = ChannelRegistryStoreFactory.getChannelRegistryStoreImpl().getChannelDefinition(Integer.parseInt(sd.getChannelPublishId()));
            portletDefinition.setChannelDefinition(channelDefinition);
            portletDefinition.loadPreferences();

            // Create the PortletApplicationEntity
            final PortletApplicationEntityImpl portAppEnt = new PortletApplicationEntityImpl();
View Full Code Here

  }

  protected Element getStructure(Document doc, LayoutStructure ls) throws Exception {
      Element structure = null;
      if (ls.isChannel()) {
        ChannelDefinition channelDef = crs.getChannelDefinition(ls.getChanId());
        if (channelDef != null && channelApproved(channelDef.getApprovalDate())) {
            if (localeAware) {
                channelDef.setLocale(ls.getLocale()); // for i18n by Shoji
            }
          structure = channelDef.getDocument(doc, channelPrefix + ls.getStructId());
        } else {
          // Create an error channel if channel is missing or not approved
          ChannelDefinition cd = new ChannelDefinition(ls.getChanId());
          cd.setTitle("Missing channel");
          cd.setName("Missing channel");
          cd.setTimeout(20000);
          String missingChannel = "Unknown";
          if (channelDef != null) {
            missingChannel = channelDef.getName();
          }
          structure = cd.getDocument(doc, channelPrefix + ls.getStructId(),
           "The '" + missingChannel + "' channel is no longer available. Please remove it from your layout.",
           ErrorCode.CHANNEL_MISSING_EXCEPTION.getCode());
        }
      } else {
        structure = doc.createElement("folder");
View Full Code Here

     * Given the key, returns the entity's name.
     * @param key java.lang.String
     */
    public String getName (String key) throws Exception {
        IChannelRegistryStore crs = ChannelRegistryStoreFactory.getChannelRegistryStoreImpl();
        ChannelDefinition cd = crs.getChannelDefinition(Integer.parseInt(key));
        return  cd.getName();
    }
View Full Code Here

TOP

Related Classes of org.jasig.portal.ChannelDefinition

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.