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

            {               
                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

            {               
                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

        fieldMap.remove(name);
       
        Iterator fieldIter = fields.iterator();
        while(fieldIter.hasNext())
        {
            LocalizedField field = (LocalizedField)fieldIter.next();
            if(field != null && field.getName() != null && field.getName().equals(name))
            {
                fieldIter.remove();
            }
        }
       
        if(values != null)
        {   
            Iterator iter = values.iterator();
            while(iter.hasNext())
            {
                LocalizedField field = (LocalizedField)iter.next();
                fieldMap.put(field.getName(), field);
            }
           
            fields.addAll(values);
        }
    }
View Full Code Here

        if(fields != null)
        {   
            Iterator fieldIter = fields.iterator();
            while(fieldIter.hasNext())
            {
                LocalizedField field = (LocalizedField)fieldIter.next();
                fieldMap.put(field.getName(), field);
            }
        }
       
    }
View Full Code Here

   
    private void addLocalizedFieldToCollection(Collection fields, Locale locale, String value)
    {
        try
        {
            LocalizedField localizedField = metadata.createLocalizedField();
            //TODO: switch to object creation through another mechanism
            //(LocalizedField) JetspeedPortletRegistry.getNewObjectInstance(MutableDescription.TYPE_WEB_APP, true);
            localizedField.setLocale(locale);
            localizedField.setValue(value);
            fields.add(localizedField);
        }
        catch(Exception e)
        {
            String msg = "Unable to instantiate LocalizedField implementor, " + e.toString();
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.