Examples of LocalizedField


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

   
    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

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

        {
            metadata = ((PortletDefinitionComposite) obj).getMetadata();
        }
        if (metadata != null)
        {
            LocalizedField child = metadata.createLocalizedField();

            if (name.equals("metadata"))
            {
                String nameAttr = attributes.getValue("name");
                child.setName(nameAttr);
            }
            else
            {
                child.setName(name);
            }
            String language = attributes.getValue("xml:lang");
            Locale locale = null;
            if (language == null)
            {
                locale = new Locale("en");
            }
            else
            {
                locale = new Locale(language);
            }

            child.setLocale(locale);
            digester.push(child);
        }
        else
        {
            digester.push(null);
View Full Code Here

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

        }
    }

    public void body(String namespace, String name, String text) throws Exception
    {
        LocalizedField child = (LocalizedField) digester.peek(0);
        if (child != null)
        {
            child.setValue(text);
        }
    }
View Full Code Here

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

        }
    }

    public void end(String namespace, String name) throws Exception
    {
        LocalizedField child = (LocalizedField) digester.pop();
        if (child != null)
        {
            Object obj = digester.peek();
            if (null == obj)
            {
View Full Code Here

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

                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

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

        }
        boolean found = false;
        Iterator fields = cfields.iterator();
        while (fields.hasNext())
        {
            LocalizedField field  = (LocalizedField)fields.next();
            if (areFieldsSame(field.getName(), oldName) &&
                areFieldsSame(field.getLocale().toString(), oldLanguage))
            {
                field.setName(name);
                field.setLocale(new Locale(language));
                field.setValue(value);
                found = true;
                break;
            }
        }
        if (!found)
View Full Code Here

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

        }
        boolean found = false;       
        Iterator fields = cfields.iterator();
        while (fields.hasNext())
        {
            LocalizedField field  = (LocalizedField)fields.next();
            if (areFieldsSame(field.getName(), name) &&
                areFieldsSame(field.getLocale().toString(), language))
            {
                cfields.remove(field);
                if (allFields.remove(field))
                {
                    node.getMetadata().setFields(allFields);
View Full Code Here

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

    /* (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

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

        {
            metadata = ((PortletDefinitionComposite) obj).getMetadata();
        }
        if (metadata != null)
        {
            LocalizedField child = metadata.createLocalizedField();

            if (name.equals("metadata"))
            {
                String nameAttr = attributes.getValue("name");
                child.setName(nameAttr);
            }
            else
            {
                child.setName(name);
            }
            String language = attributes.getValue("xml:lang");
            Locale locale = null;
            if (language == null)
            {
                locale = new Locale("en");
            }
            else
            {
                locale = new Locale(language);
            }

            child.setLocale(locale);
            digester.push(child);
        }
        else
        {
            digester.push(null);
View Full Code Here

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

        }
    }

    public void body(String namespace, String name, String text) throws Exception
    {
        LocalizedField child = (LocalizedField) digester.peek(0);
        if (child != null)
        {
            child.setValue(text);
        }
    }
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.