Examples of Preference


Examples of org.apache.pluto.om.common.Preference


    public Preference remove(String name) {
        Iterator iterator = this.iterator();
        while (iterator.hasNext()) {
            Preference preference = (Preference)iterator.next();
            if (preference.getName().equals(name)) {
                this.preferences.remove(preference);
                return preference;
            }
        }
        return null;
View Full Code Here

Examples of org.exoplatform.portal.application.Preference

   public void testCreatePortletPreferences() throws Exception
   {
      ArrayList<Preference> prefs = new ArrayList<Preference>();
      for (int i = 0; i < 5; i++)
      {
         Preference pref = new Preference();
         pref.setName("name" + i);
         pref.addValue("value" + i);
         prefs.add(pref);
      }

      //
      PortletPreferences portletPreferences = new PortletPreferences();
View Full Code Here

Examples of org.exoplatform.portal.application.Preference

      assertEquals("web/BannerPortlet", storage_.getId(banner1.getState()));

      // Update site prefs
      PortletPreferences sitePrefs = new PortletPreferences();
      sitePrefs.setWindowId("portal#test:/web/BannerPortlet/banner");
      sitePrefs.setPreferences(new ArrayList<Preference>(Collections.singleton(new Preference())));
      sitePrefs.getPreferences().get(0).setName("template");
      sitePrefs.getPreferences().get(0).getValues().add("bar");
      storage_.save(sitePrefs);

      // Check that page prefs have not changed
View Full Code Here

Examples of org.exoplatform.portal.application.Preference

               if (state != null)
               {
                  ArrayList<Preference> list = new ArrayList<Preference>();
                  for (org.exoplatform.portal.pom.spi.portlet.Preference preference : state)
                  {
                     Preference pref = new Preference();
                     pref.setName(preference.getName());
                     pref.setValues(new ArrayList<String>(preference.getValues()));
                     pref.setReadOnly(preference.isReadOnly());
                     list.add(pref);
                  }
                  PortletPreferences prefs = new PortletPreferences();
                  prefs.setWindowId(windowId);
                  prefs.setPreferences(list);
View Full Code Here

Examples of org.exoplatform.portal.application.Preference

         {
            PortletBuilder builder = new PortletBuilder();
            ctx.parsePastStartTag(m_uri, "preferences");
            while (ctx.isAt(m_uri, "preference"))
            {
               Preference value = (Preference)ctx.unmarshalElement();
               builder.add(value.getName(), value.getValues(), value.isReadOnly());
            }
            ctx.parsePastEndTag(m_uri, "preferences");
            state = new TransientApplicationState<Portlet>(applicationName + "/" + portletName, builder.build());
         }
         else
View Full Code Here

Examples of org.exoplatform.portal.application.Preference

      //
      ctx.parsePastStartTag(m_uri, m_name);
      while (ctx.isAt(m_uri, "preference"))
      {
         Preference value = (Preference)ctx.unmarshalElement();
         builder.add(value.getName(), value.getValues(), value.isReadOnly());
      }
      ctx.parsePastEndTag(m_uri, m_name);

      //
      return builder.build();
View Full Code Here

Examples of org.exoplatform.portal.application.Preference

            if (ctx.isAt(m_uri, "preferences")) {
                PortletBuilder builder = new PortletBuilder();
                ctx.parsePastStartTag(m_uri, "preferences");
                while (ctx.isAt(m_uri, "preference")) {
                    Preference value = (Preference) ctx.unmarshalElement();
                    builder.add(value.getName(), value.getValues(), value.isReadOnly());
                }
                ctx.parsePastEndTag(m_uri, "preferences");
                state = new TransientApplicationState(contentId, builder.build());
            } else {
                state = new TransientApplicationState(contentId, null);
View Full Code Here

Examples of org.grouplens.lenskit.data.pref.Preference

                try {
                    PrintWriter writer = closer.register(new PrintWriter(file));
                    Cursor<Rating> ratings = closer.register(eventDAO.streamEvents(Rating.class));
                    for (Rating r: ratings) {
                        writer.printf("%d,%d,", r.getUserId(), r.getItemId());
                        Preference p = r.getPreference();
                        if (p != null) {
                            writer.print(p.getValue());
                        }
                        writer.print(",");
                        long ts = r.getTimestamp();
                        if (ts >= 0) {
                            writer.print(ts);
View Full Code Here

Examples of org.jasig.portal.portletpublishing.xml.Preference

    public static Preference createSingleTextPreference(String name, String label, TextDisplay displayType, String defaultValue) {
        SingleTextPreferenceInput input = new SingleTextPreferenceInput();
        input.setDefault(defaultValue);
        input.setDisplay(displayType);
       
        Preference pref = new Preference();
        pref.setName(name);
        pref.setLabel(label);
        pref.setPreferenceInput(new JAXBElement<SingleTextPreferenceInput>(new QName("single-text-parameter-input"), SingleTextPreferenceInput.class, input));
    
        return pref;
    }
View Full Code Here

Examples of org.netbeans.modules.exceptions.entity.Preference

        Statistic statist = Statistic.getExists(stat.name);
        return new DbPreferences(null, "", statist, log, null, em);
    }

    protected void putSpi(String key, String value) {
        Preference p = null;
        for (Preference current : getPreferences()) {
            if (key.equals(current.getKey())) {
                p = current;
                p.setValue(persist, value);
                break;
            }
        }
        if (p == null) {
            p = new Preference(persist, statistic, log, prefix, key);
            p.setValue(persist, value);
            preferences.add(p);
            persist.persist(p);
        } else {
            persist.merge(p);
        }
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.