Package org.apache.jetspeed.om.common

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


        {
            this.localizedTitles = new HashMap(metadataFields.size());
            Iterator fieldsItr = metadataFields.iterator();
            while (fieldsItr.hasNext())
            {
                LocalizedField field = (LocalizedField) fieldsItr.next();
                if (field.getName().equals("title"))
                {
                    localizedTitles.put(field.getLocale(), field);
                }
            }
        }
       
        Locale languageOnly = new Locale(locale.getLanguage());
View Full Code Here

        {
            this.localizedShortTitles = new HashMap(metadataFields.size());
            Iterator fieldsItr = metadataFields.iterator();
            while (fieldsItr.hasNext())
            {
                LocalizedField field = (LocalizedField) fieldsItr.next();
                if (field.getName().equals("short-title"))
                {
                    localizedShortTitles.put(field.getLocale(), field);
                }
            }
        }

        Locale languageOnly = new Locale(locale.getLanguage());
View Full Code Here

        if(action.equals("edit_metadata"))
        {              
            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;
                    }
                }
            }
        }
        else if (action.equals("remove_metadata"))
        {
            String[] ids = actionRequest.getParameterValues("metadata_id");           
            if (ids != null)
            {
                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

                namedLocalizedText = new HashMap(getFields().size());
                localizedText.put(name, namedLocalizedText);
                Iterator fieldsItr = fields.iterator();
                while (fieldsItr.hasNext())
                {
                    LocalizedField field = (LocalizedField)fieldsItr.next();
                    namedLocalizedText.put(field.getLocale(), field);
                }
            }
        }

        // retrieve cached named text by locale if found
View Full Code Here

                namedLocalizedText = new HashMap(getFields().size());
                localizedText.put(name, namedLocalizedText);
                Iterator fieldsItr = fields.iterator();
                while (fieldsItr.hasNext())
                {
                    LocalizedField field = (LocalizedField)fieldsItr.next();
                    namedLocalizedText.put(field.getLocale(), field);
                }
            }
        }

        // retrieve cached named text by locale if found
View Full Code Here

        {
            Iterator it = timeoutFields.iterator();

            if (it.hasNext())
            {
                LocalizedField timeoutField = (LocalizedField) timeoutFields.iterator().next();

                try
                {
                    timeoutMetadata = Long.parseLong(timeoutField.getValue());
                }
                catch (NumberFormatException nfe)
                {
                    log.warn("Invalid timeout metadata: " + nfe.getMessage());
                }
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

        if (versionList != null)
        {
            Iterator it = versionList.iterator();
            if (it.hasNext())
            {
                LocalizedField field = (LocalizedField)it.next();
                version = field.getValue();
            }
        }
        return version;
    }
View Full Code Here

        {
            Iterator it = timeoutFields.iterator();

            if (it.hasNext())
            {
                LocalizedField timeoutField = (LocalizedField) timeoutFields.iterator().next();

                try
                {
                    timeoutMetadata = Long.parseLong(timeoutField.getValue());
                }
                catch (NumberFormatException nfe)
                {
                    log.warn("Invalid timeout metadata: " + nfe.getMessage());
                }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.om.common.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.