Package org.jasig.portal.portlets

Examples of org.jasig.portal.portlets.Attribute


            new StringListAttribute(new String[]{ param.getValue() }));
        this.portletParameterOverrides.put(param.getName(),
            new BooleanAttribute(param.getOverride()));
      } else {
        this.parameters.put(param.getName(),
            new Attribute(param.getValue()));
        this.parameterOverrides.put(param.getName(),
            new BooleanAttribute(param.getOverride()));
      }
    }
   
    if (def.isPortlet()) {
            final IPortletPreferences prefs = portletDef.getPortletPreferences();
            for (IPortletPreference pref : prefs.getPortletPreferences()) {
        List<Attribute> attributes = new ArrayList<Attribute>();
        for (String value : pref.getValues()) {
          attributes.add(new Attribute(value));
        }
        this.portletPreferences.put(pref.getName(), new StringListAttribute(pref.getValues()));
        this.portletParameterOverrides.put(pref.getName(), new BooleanAttribute(!pref.isReadOnly()));
      }
    }
View Full Code Here


          if (!this.parameters.containsKey(param.getName())
              || this.parameters.get(param.getName()).getValue().trim().equals("")) {
           
            // use the default value if one exists
            if (param.getDefaultValue() != null) {
              this.parameters.put(param.getName(), new Attribute(param
                  .getDefaultValue()));
            }
             
            // otherwise look for a default in the type restriction 
            else if (param.getType() != null
                && param.getType().getRestriction() != null
                && param.getType().getRestriction().getDefaultValue() != null) {
              this.parameters.put(param.getName(), new Attribute(param
                  .getType().getRestriction().getDefaultValue()));
            }
           
            // set parameter override value
            if (param.getModify().equals("subscribe")) {
View Full Code Here

       
        final Set<String> swappableAttributes = this.getSwappableAttributes(externalContext);
        for (final String attribute : swappableAttributes) {
            final Object value = person.getAttributeValue(attribute);
            if (value != null) {
                currentAttributes.put(attribute, new Attribute(String.valueOf(value)));
            }
        }
    }
View Full Code Here

        person.setAttributes(attributes);
    }

    protected void copyAttributes(final Map<String, Object> destination, final Map<String, Attribute> source) {
        for (final Map.Entry<String, Attribute> sourceEntry : source.entrySet()) {
            final Attribute attribute = sourceEntry.getValue();
            if (attribute != null && StringUtils.isNotEmpty(attribute.getValue())) {
                final String name = sourceEntry.getKey();
                destination.put(name, attribute.getValue());
            }
        }
    }
View Full Code Here

            return;
        }
       
      form.setTitle(portletDD.getPortletName());
    form.setName(portletDD.getPortletName());
    form.getParameters().put(IPortletAdaptor.CHANNEL_PARAM__PORTLET_APPLICATION_ID, new Attribute(application));
    form.getParameters().put(IPortletAdaptor.CHANNEL_PARAM__PORTLET_NAME, new Attribute(portletDD.getPortletName()));
    for (Object obj : portletDD.getSupports()) {
      SupportsDD supports = (SupportsDD) obj;
      for (Object mode : supports.getPortletModes()) {
        if ("edit".equals(mode)) {
          form.setEditable(true);
View Full Code Here

  }
 
  protected Tuple<String, String> getPortletDescriptorKeys(ChannelDefinitionForm form) {
      final Map<String, Attribute> parameters = form.getParameters();
     
      final Attribute frameworkPortletAttribute = parameters.get(IPortletAdaptor.CHANNEL_PARAM__IS_FRAMEWORK_PORTLET);
        final Attribute portletAppIdAttribute = parameters.get(IPortletAdaptor.CHANNEL_PARAM__PORTLET_APPLICATION_ID);
        final Attribute portletNameAttribute = parameters.get(IPortletAdaptor.CHANNEL_PARAM__PORTLET_NAME);
        if ((portletAppIdAttribute == null && frameworkPortletAttribute == null) || portletNameAttribute == null) {
            return null;
        }
       
        final String portletAppId;
        if (frameworkPortletAttribute != null && Boolean.valueOf(frameworkPortletAttribute.getValue())) {
            portletAppId = this.servletContext.getContextPath();
        }
        else {
            portletAppId = portletAppIdAttribute.getValue();
        }
       
        final String portletName = portletNameAttribute.getValue();
       
        return new Tuple<String, String>(portletAppId, portletName);
  }
View Full Code Here

      if (param.getName().startsWith("PORTLET.")) {
        this.portletPreferences.put(param.getName(),
            new StringListAttribute(new String[]{ param.getValue() }));
      } else {
        this.parameters.put(param.getName(),
            new Attribute(param.getValue()));
      }
    }
   
        for (IPortletPreference pref : def.getPortletPreferences()) {
      List<Attribute> attributes = new ArrayList<Attribute>();
      for (String value : pref.getValues()) {
        attributes.add(new Attribute(value));
      }
      this.portletPreferences.put(pref.getName(), new StringListAttribute(pref.getValues()));
            this.portletPreferenceReadOnly.put(pref.getName(), new BooleanAttribute(pref.isReadOnly()));
    }
           
View Full Code Here

    for (Step step : cpd.getSteps()) {
      if (step.getParameters() != null) {
        for (Parameter param : step.getParameters()) {
          // if this parameter doesn't currently have a value, check
          // for a default in the CPD
          Attribute attribute = this.parameters.get(param.getName());
          if (attribute == null
              || attribute.getValue() == null
              || attribute.getValue().trim().equals("")) {
           
            // use the default value if one exists
              ParameterInputType input = param.getParameterInput().getValue();
            if (input != null) {
              this.parameters.put(param.getName(), new Attribute(input.getDefault()));
            }
          }
        }
      }
      if (step.getPreferences() != null) {
View Full Code Here

        final Map<String, Attribute> parameters = form.getParameters();

        for (final Iterator<Entry<String, Attribute>> parameterEntryItr = parameters.entrySet().iterator(); parameterEntryItr.hasNext();) {
            final Entry<String, Attribute> parameterEntry = parameterEntryItr.next();
            final String key = parameterEntry.getKey();
            final Attribute value = parameterEntry.getValue();
           
            if (!parameterNames.contains(key) || value == null || StringUtils.isBlank(value.getValue())) {
                parameterEntryItr.remove();
            }
        }
    }
View Full Code Here

       
        final Set<String> swappableAttributes = this.getSwappableAttributes(externalContext);
        for (final String attribute : swappableAttributes) {
            final Object value = person.getAttributeValue(attribute);
            if (value != null) {
                currentAttributes.put(attribute, new Attribute(String.valueOf(value)));
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.jasig.portal.portlets.Attribute

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.