Package org.apache.jetspeed.om.portlet

Examples of org.apache.jetspeed.om.portlet.LocalizedField


        }
        boolean found = false;
        Iterator fields = cfields.iterator();
        while (fields.hasNext())
        {
            LocalizedField field = (LocalizedField) fields.next();
            if (areFieldsSame(field.getName(), oldMetaData.getName())
                    && areFieldsSame(field.getLocale().toString(), oldMetaData
                            .getLanguage()))
            {
                field.setName(metaData.getName());
                field.setLocale(new Locale(metaData.getLanguage()));
                field.setValue(metaData.getValue());
                found = true;
                break;
            }
        }
        if (!found) insertMetadata(metaData, node);
View Full Code Here


        if (cfields == null || cfields.size() == 0) { return; }
        boolean found = false;
        Iterator fields = cfields.iterator();
        while (fields.hasNext())
        {
            LocalizedField field = (LocalizedField) fields.next();
            if (areFieldsSame(field.getName(), metaData.getName())
                    && areFieldsSame(field.getLocale().toString(), metaData
                            .getLanguage()))
            {
                cfields.remove(field);
                if (allFields.remove(field))
                {
View Full Code Here

        if (c != null)
        {
            Iterator it = c.iterator();
            if (it.hasNext())
            {
                LocalizedField roleField = (LocalizedField) it.next();
                String role = roleField.getValue();
                if (role != null)
                {
                    if (role.equals("*"))
                        doFilter = true;
                    else
View Full Code Here

       
        Collection<LocalizedField> fields = pd.getMetadata().getFields("selector.conditional.role");
       
        if (fields != null && !fields.isEmpty())
        {
            LocalizedField field = fields.iterator().next();
            String role = field.getValue();
           
            if (!StringUtils.isBlank(role))
            {
                if (role.equals("*"))
                {
View Full Code Here

        return null;
    }
   
    private void setLocalizedField(GenericMetadata metadata, Locale locale, String name, String value)
    {
        LocalizedField field = getLocalizedField(metadata, locale, name);
       
        if (field != null)
        {
            field.setValue(value);
        }
        else
        {
            metadata.addField(locale, name, value);
        }
View Full Code Here

            if ((pageOrTemplate.getMetadata() != null) && (pageOrTemplate.getMetadata().getFields() != null))
            {
                Iterator fieldIter = pageOrTemplate.getMetadata().getFields().iterator();
                while (fieldIter.hasNext())
                {
                    LocalizedField field = (LocalizedField)fieldIter.next();
                    Locale fieldLocale = field.getLocale();
                    String fieldName = field.getName();
                    if (fieldName != null)
                    {
                        boolean containsField = false;
                        Iterator containsFieldIterator = contentPageImpl.getMetadata().getFields().iterator();
                        while (!containsField && containsFieldIterator.hasNext())
                        {
                            LocalizedField testField = (LocalizedField)containsFieldIterator.next();
                            Locale testFieldLocale = testField.getLocale();
                            String testFieldName = testField.getName();
                            containsField = (fieldName.equals(testFieldName) &&
                                    (((fieldLocale == null) && (testFieldLocale == null)) ||
                                            ((fieldLocale != null) && fieldLocale.equals(testFieldLocale))));
                        }
                        if (!containsField)
View Full Code Here

    static protected boolean updateMetaField(Collection<LocalizedField> fields, Locale locale, String name, String value)
    {
        Iterator<LocalizedField> it = fields.iterator();
        while (it.hasNext())
        {
            LocalizedField field = it.next();
            if (locale == null || field.getLocale().equals(locale))
            {
              if (field.getName().equals(name))
              {
                field.setValue(value);
                return true;
              }
            }
        }      
        return false;
View Full Code Here

        if (fields != null)
        {
            Iterator<LocalizedField> it = fields.iterator();
            while (it.hasNext())
            {
                LocalizedField field = it.next();
                if (locale == null || field.getLocale().equals(locale))
                {               
                  if (field.getName().equals(name))
                  {
                    return field.getValue();
                  }
                }
            }
        }
        return null;
View Full Code Here

        if (c != null)
        {
            Iterator it = c.iterator();
            if (it.hasNext())
            {
                LocalizedField field = (LocalizedField) it.next();
                return Boolean.parseBoolean(field.getValue());
            }
        }
        return false;
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.apache.jetspeed.om.common.GenericMetadata#addField(java.util.Locale, java.lang.String, java.lang.String)
     */
    public void addField(Locale locale, String name, String value)
    {
        LocalizedField field = createLocalizedField();
        field.setName(name);
        field.setValue(value);
        field.setLocale(locale);
       
        addField(field);
    }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.om.portlet.LocalizedField

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.