Examples of LocalizedField


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

            {               
                boolean modified = false;
                Iterator fieldsIter = meta.getFields().iterator();           
                while (fieldsIter.hasNext())
                {
                    LocalizedField field = (LocalizedField) fieldsIter.next();
                    String id = field.getId().toString();
                    String value = actionRequest.getParameter(id + ":value");
                    if (value != null)
                    {
                        if (!value.equals(field.getValue()))
                        {
                            field.setValue(value);
                            modified = true;
                        }
                    }
                }
                if (modified)
                {
                    if (pd == null)
                    {                       
                        registry.updatePortletApplication(pa);
                    }
                    else
                    {                       
                        registry.savePortletDefinition(pd);
                    }                                        
                }
            }
            catch (RegistryException e)
            {
                throw new PortletException("Failed update meta data attributes: "
                        + paName + ", " + ((pdName == null) ? "" : pdName), e);                                   
            }           
        }
        else if (action.equals("remove_metadata"))
        {
            String[] ids = actionRequest.getParameterValues("metadata_id");           
            if (ids != null)
            {
                try
                {
                    Iterator fieldsIter = meta.getFields().iterator();
                    int count = 0;                       
                    while (fieldsIter.hasNext())
                    {
                        LocalizedField field = (LocalizedField) fieldsIter.next();
                        String id = field.getId().toString();
   
                        for(int i=0; i<ids.length; i++)
                        {
                            String mid = ids[i];
                            if(mid.equals(id))
View Full Code Here

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

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

        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

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

    {
        this.metaData = new ArrayList<JetspeedDocumentMetaData>();
        if (objectMetaData.getFields() != null)
        {
            Iterator metaData = objectMetaData.getFields().iterator();
            LocalizedField field;
            while (metaData.hasNext())
            {
                field = (LocalizedField) metaData.next();
                this.metaData.add(new JetspeedDocumentMetaData(field.getName(), field.getLocale().toString(), field.getValue()));
            }
        }
    }
View Full Code Here

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

        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

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

            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

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

       
        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

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

    {
        this.metaData = new ArrayList<JetspeedDocumentMetaData>();
        if (objectMetaData.getFields() != null)
        {
            Iterator metaDataIterator = objectMetaData.getFields().iterator();
            LocalizedField field;
            while (metaDataIterator.hasNext())
            {
                field = (LocalizedField) metaDataIterator.next();
                this.metaData.add(new JetspeedDocumentMetaData(field.getName(), field.getLocale().toString(), field.getValue()));
            }
        }
    }
View Full Code Here

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

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

        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
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.