Package org.jasig.portal.channel

Examples of org.jasig.portal.channel.IChannelParameter


    private void processParams() {
        // Process params by passing through the overrideable parms list and
        // pushing the submitted value for that param into the description
        Iterator iter = overridableChanParams.iterator();
        while (iter.hasNext()) {
          IChannelParameter parm = (IChannelParameter)iter.next();
          String paramValue = runtimeData.getParameter(parm.getName());
          channelDesc.setParameterValue(parm.getName(), paramValue);
        }
      }
View Full Code Here


            for(Iterator i = descParms.entrySet().iterator(); i.hasNext();)
            {
                Map.Entry e = (Entry) i.next();
                String name = (String) e.getKey();
                String value = (String) e.getValue();
                IChannelParameter parm = new ChannelParameterImpl(name, value, true);
                overridableParams.add(parm);
            }
        }
        return overridableParams;
    }
View Full Code Here

                        {
                            // can't override
                        } else
                        {
                            // override only for adhoc or if diff from chan def
                            IChannelParameter cp = channelDef.getParameter(parmName);
                            if (cp == null || !cp.getValue().equals(parmValue))
                            {
                                parmStmt.clearParameters();
                                parmStmt.setInt(1, saveStructId);
                                parmStmt.setString(2, parmName);
                                parmStmt.setString(3, parmValue);
View Full Code Here

    private void updateParams(IUserLayoutChannelDescription cd) throws PortalException {
      // Process params
      Iterator iter = overridableChanParams.iterator();
      while (iter.hasNext()) {
          IChannelParameter parm = (IChannelParameter)iter.next();
          String paramValue = runtimeData.getParameter(parm.getName());
          cd.setParameterValue(parm.getName(), paramValue);
      }
      ulm.updateNode(cd);
      context.saveLayout(false);
    }
View Full Code Here

                NodeList ovrdnodes = anode.getElementsByTagName("ovrd");
                if (ovrdnodes.getLength() > 0)
                {
                    povrd = XML.getElementText((Element) ovrdnodes.item(0)).trim();
                }
                IChannelParameter chanParam =
                    new ChannelParameterImpl(pname, pvalue, RDBMServices.dbFlag(povrd));
                chanParam.setDescription(pdescr);
                parameters.add(chanParam);
            }
        }
       
        ci.chanDef.replaceParameters(parameters);
View Full Code Here

            return true;
        }
        if (!(object instanceof IChannelParameter)) {
            return false;
        }
        IChannelParameter rhs = (IChannelParameter) object;
        return new EqualsBuilder()
            .append(this.name, rhs.getName())
            .isEquals();
    }
View Full Code Here

  public void addParameter(ChannelParameterImpl newParameter) {
      final String newName = newParameter.getName();
       
      for (final Iterator<IChannelParameter> paramIter = this.parameters.iterator(); paramIter.hasNext();) {
          final IChannelParameter param = paramIter.next();
          if (newName.equals(param.getName())) {
              paramIter.remove();
              break;
          }
      }
     
View Full Code Here

     */
    public Tuple<String, String> getPortletDescriptorKeys(IPortletDefinition portletDefinition) {
        final IChannelDefinition channelDefinition = portletDefinition.getChannelDefinition();
       
        final String portletApplicationId;
        final IChannelParameter isFrameworkPortletParam = channelDefinition.getParameter(IPortletAdaptor.CHANNEL_PARAM__IS_FRAMEWORK_PORTLET);
        if (isFrameworkPortletParam != null && Boolean.valueOf(isFrameworkPortletParam.getValue())) {
            portletApplicationId = this.servletContext.getContextPath();
        }
        else {
            final IChannelParameter portletApplicaitonIdParam = channelDefinition.getParameter(IPortletAdaptor.CHANNEL_PARAM__PORTLET_APPLICATION_ID);
            if (portletApplicaitonIdParam == null) {
                throw new DataRetrievalFailureException("The specified ChannelDefinition does not provide the needed channel parameter '" + IPortletAdaptor.CHANNEL_PARAM__PORTLET_APPLICATION_ID + "'. ChannelDefinition=" + channelDefinition);
            }
           
            portletApplicationId = portletApplicaitonIdParam.getValue();
        }
       
        final IChannelParameter portletNameParam = channelDefinition.getParameter(IPortletAdaptor.CHANNEL_PARAM__PORTLET_NAME);
        if (portletNameParam == null) {
            throw new DataRetrievalFailureException("The specified ChannelDefinition does not provide the needed channel parameter '" + IPortletAdaptor.CHANNEL_PARAM__PORTLET_NAME + "'. ChannelDefinition=" + channelDefinition);
        }
        final String portletName = portletNameParam.getValue();
       
        return new Tuple<String, String>(portletApplicationId, portletName);
    }
View Full Code Here

                    {
                        /*
                         * so fragment doesn't override. See if the value
                         * specified matches that of the channel definition
                         */
                        IChannelParameter cp =
                            (IChannelParameter) pubParms.get(name);
                       
                        if (cp != null && cp.getValue().equals(newVal))
                            /*
                             * new value matches that of published channel to
                             * remove any user parameter spec since not needed
                             */
                            pendingActions.add(new LPARemoveParameter
                                    (nodeId, name, owner, ilfNode));
                        else
                            /*
                             * value doesn't match that of published chanel so
                             * we need change any existing parameter spec or add
                             * a new one if it doesn't exist.
                             */
                            pendingActions.add(new LPAChangeParameter
                                    (nodeId, name, newVal, owner, ilfNode));
                    } else if (!fragValue.equals(newVal))
                    {
                        /*
                         * so fragment does specify and user value is different
                         * so change any existing parameter spec or add a new
                         * one if it doesn't exist.
                         */
                        pendingActions.add(new LPAChangeParameter
                                (nodeId, name, newVal, owner, ilfNode));
                    } else
                    {
                        /*
                         * new val same as fragment value so don't persist.
                         * remove any parameter spec if it exists.
                         */
                        pendingActions.add(new LPAResetParameter
                                (nodeId, name, fragValue, owner, ilfNode));
                    }
                }
                else // not incorporated from a fragment
                {
                    /*
                     * see if the value specified matches that of the channel
                     * definition.
                     */
                    IChannelParameter cp =
                        (IChannelParameter) pubParms.get(name);
                   
                    if (cp != null && cp.getValue().equals(newVal))
                        pendingActions.add(new LPARemoveParameter
                                (nodeId, name, owner, ilfNode));
                    else
                        pendingActions.add(new LPAChangeParameter
                                (nodeId, name, newVal, owner, ilfNode));
View Full Code Here

            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);
            }
            else if (parm.getOverride())
                parameters.put(parameterName, parm.getValue());
        }
        catch(Exception e)
        {
            throw new PortalException("Unable to reset parameter [" +
                    parameterName + "] for channel [" + getTitle() +
View Full Code Here

TOP

Related Classes of org.jasig.portal.channel.IChannelParameter

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.