Package org.jasig.portal.portlets

Examples of org.jasig.portal.portlets.BooleanAttribute


    for (IChannelParameter param : def.getParameters()) {
      if (def.isPortlet() && param.getName().startsWith("PORTLET.")) {
        this.portletPreferences.put(param.getName(),
            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


            }
           
            // set parameter override value
            if (param.getModify().equals("subscribe")) {
              this.parameterOverrides.put(param.getName(),
                  new BooleanAttribute(true));
            } else {
              this.parameterOverrides.put(param.getName(),
                  new BooleanAttribute(false));
            }
          }
        }
      }
      if (step.getPreferences() != null) {
        for (CPDPreference pref : step.getPreferences()) {
          // if this parameter doesn't currently have a value, check
          // for a default in the CPD
          if (!this.portletPreferences.containsKey(pref.getName())
              || this.portletPreferences.get(pref.getName()).getValue().size() == 0
              || (this.portletPreferences.get(pref.getName()).getValue().size() == 1 && this.portletPreferences.get(pref.getName()).getValue().get(0).trim().equals(""))) {
           
            if (!this.portletPreferences.containsKey(pref.getName())) {
              this.portletPreferences.put(pref.getName(), new StringListAttribute());
            }
           
            // use the default value if one exists
            if (pref.getDefaultValues() != null && pref.getDefaultValues().size() > 0) {
              for (String value : pref.getDefaultValues()) {
                this.portletPreferences.get(pref.getName()).getValue().add(value);
              }
            }
             
            // otherwise look for a default in the type restriction 
            else if (pref.getType() != null
                && pref.getType().getRestriction() != null
                && pref.getType().getRestriction().getDefaultValues() != null
                && pref.getType().getRestriction().getDefaultValues().size() > 0) {
              for (String value : pref.getType().getRestriction().getDefaultValues()) {
                this.portletPreferences.get(pref.getName()).getValue().add(value);
              }
            }
           
            // set parameter override value
            if (pref.getModify().equals("subscribe")) {
              this.parameterOverrides.put(pref.getName(),
                  new BooleanAttribute(true));
            } else {
              this.parameterOverrides.put(pref.getName(),
                  new BooleanAttribute(false));
            }
          }
        }
      }
    }
View Full Code Here

      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

        List<IPortletPreference> preferenceList = new ArrayList<IPortletPreference>();
    for (String key : form.getPortletPreferences().keySet()) {
      List<String> prefValues = form.getPortletPreferences().get(key).getValue();
      if (prefValues != null && prefValues.size() > 0) {
        String[] values = prefValues.toArray(new String[prefValues.size()]);
        BooleanAttribute readOnly = form.getPortletPreferenceReadOnly().get(key);
        preferenceList.add(new PortletPreferenceImpl(key, readOnly.getValue(), values));
      }
    }
    portletDef.setPortletPreferences(preferenceList);

        // Lastly update the PortletDefinition's lifecycle state & lifecycle-related metadata
View Full Code Here

TOP

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

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.