Examples of FragmentProperty


Examples of org.apache.jetspeed.om.page.FragmentProperty

        // copy properties, (only properties for global and
        // current user/group/role specific values copied)
        Iterator props = source.getProperties().iterator();
        while (props.hasNext())
        {
            FragmentProperty prop = (FragmentProperty)props.next();
            String propName = prop.getName();
            String propScope = prop.getScope();
            String propScopeValue = prop.getScopeValue();
            if (FragmentProperty.GROUP_AND_ROLE_PROPERTY_SCOPES_ENABLED ||
                (propScope == null) ||
                (!propScope.equals(FragmentProperty.GROUP_PROPERTY_SCOPE) && !propScope.equals(FragmentProperty.ROLE_PROPERTY_SCOPE)))
            {
                if (copy.getProperty(propName, propScope, propScopeValue) == null)
                {
                    copy.setProperty(propName, propScope, propScopeValue, prop.getValue());
                }
            }
        }
                 
        // copy preferences
View Full Code Here

Examples of org.apache.jetspeed.om.page.FragmentProperty

    {
        // iterate through properties list to get property value
        Iterator propertiesIter = getProperties().iterator();
        while (propertiesIter.hasNext())
        {
            FragmentProperty fragmentProperty = (FragmentProperty)propertiesIter.next();
            if (fragmentProperty.getName().equals(propName))
            {
                // compare scopes
                String fragmentPropertyScope = fragmentProperty.getScope();
                if ((fragmentPropertyScope == null) && (scope == null))
                {
                    return fragmentProperty.getValue();                   
                }
                else if ((fragmentPropertyScope != null) && fragmentPropertyScope.equals(scope))
                {
                    // default user scope value
                    if ((scopeValue == null) && scope.equals(USER_PROPERTY_SCOPE))
                    {
                        scopeValue = Utils.getCurrentUserScopeValue();
                    }
                    // compare scope values
                    String fragmentPropertyScopeValue = fragmentProperty.getScopeValue();
                    if (((fragmentPropertyScopeValue == null) && (scopeValue == null)) ||
                        ((fragmentPropertyScopeValue != null) && fragmentPropertyScopeValue.equals(scopeValue)))
                    {
                        return fragmentProperty.getValue();                       
                    }
                }
            }
        }
        return null;
View Full Code Here

Examples of org.apache.jetspeed.om.page.FragmentProperty

     * @param value property value
     */
    public void setProperty(String propName, String scope, String scopeValue, String value)
    {
        // iterate through properties list to find property
        FragmentProperty fragmentProperty = null;
        Iterator propertiesIter = getProperties().iterator();
        while (propertiesIter.hasNext())
        {
            FragmentProperty findFragmentProperty = (FragmentProperty)propertiesIter.next();
            if (findFragmentProperty.getName().equals(propName))
            {
                // compare scopes
                String findFragmentPropertyScope = findFragmentProperty.getScope();
                if ((scope == null) && (findFragmentPropertyScope == null))
                {
                    fragmentProperty = findFragmentProperty;
                    break;
                }
                else if ((findFragmentPropertyScope != null) && findFragmentPropertyScope.equals(scope))
                {
                    // default user scope value
                    if ((scopeValue == null) && scope.equals(USER_PROPERTY_SCOPE))
                    {
                        scopeValue = Utils.getCurrentUserScopeValue();
                    }
                    // compare scope values                   
                    String findFragmentPropertyScopeValue = findFragmentProperty.getScopeValue();
                    if ((findFragmentPropertyScopeValue != null) && findFragmentPropertyScopeValue.equals(scopeValue))
                    {
                        fragmentProperty = findFragmentProperty;
                        break;
                    }
View Full Code Here

Examples of org.apache.jetspeed.om.page.FragmentProperty

        {
            propScopeValue = FragmentPropertyImpl.getCurrentUserScopeValue();
        }

        // find specified scoped property value
        FragmentProperty fragmentProperty = FragmentPropertyImpl.findFragmentProperty(propName, propScope, propScopeValue, getProperties());
        if (fragmentProperty != null)
        {
            return fragmentProperty.getValue();
        }
        return null;
    }
View Full Code Here

Examples of org.apache.jetspeed.om.page.FragmentProperty

        {
            propScopeValue = FragmentPropertyImpl.getCurrentUserScopeValue();
        }

        // find specified scoped property value
        FragmentProperty fragmentProperty = FragmentPropertyImpl.findFragmentProperty(propName, propScope, propScopeValue, getProperties());
        if (fragmentProperty != null)
        {
            return Integer.parseInt(fragmentProperty.getValue());
        }
        return -1;
    }
View Full Code Here

Examples of org.apache.jetspeed.om.page.FragmentProperty

        {
            propScopeValue = FragmentPropertyImpl.getCurrentUserScopeValue();
        }

        // find specified scoped property value
        FragmentProperty fragmentProperty = FragmentPropertyImpl.findFragmentProperty(propName, propScope, propScopeValue, getProperties());
        if (fragmentProperty != null)
        {
            return Float.parseFloat(fragmentProperty.getValue());
        }
        return -1.0F;
    }
View Full Code Here

Examples of org.apache.jetspeed.om.page.FragmentProperty

        {
            propScopeValue = FragmentPropertyImpl.getCurrentUserScopeValue();
        }

        // find specified scoped property value
        FragmentProperty fragmentProperty = FragmentPropertyImpl.findFragmentProperty(propName, propScope, propScopeValue, getProperties());

        // add, set, or remove property
        if (propValue != null)
        {
            if (fragmentProperty == null)
            {
                fragmentProperty = new FragmentPropertyImpl();
                fragmentProperty.setName(propName);
                fragmentProperty.setScope(propScope);
                fragmentProperty.setScopeValue(propScopeValue);
                fragmentProperty.setValue(propValue);
                getProperties().add(fragmentProperty);
            }
            else
            {
                fragmentProperty.setValue(propValue);
            }
        }
        else if (fragmentProperty != null)
        {
            getProperties().remove(fragmentProperty);
View Full Code Here

Examples of org.apache.jetspeed.om.page.FragmentProperty

        // get property names
        Set propertyNames = new HashSet();
        Iterator propertiesIter = getProperties().iterator();
        while (propertiesIter.hasNext())
        {
            FragmentProperty fragmentProperty = (FragmentProperty)propertiesIter.next();
            propertyNames.add(fragmentProperty.getName());
        }
       
        // construct and return properties map
        Map propertiesMap = new HashMap();
        Iterator propertyNamesIter = propertyNames.iterator();
View Full Code Here

Examples of org.apache.jetspeed.om.page.FragmentProperty

        // property value; assumes properties are already filtered
        // for current user user, group, and role scopes
        Iterator propertiesIter = getProperties().iterator();
        while ((userValue == null) && propertiesIter.hasNext())
        {
            FragmentProperty fragmentProperty = (FragmentProperty)propertiesIter.next();
            if (fragmentProperty.getName().equals(propName))
            {
                String fragmentPropertyScope = fragmentProperty.getScope();
                if (fragmentPropertyScope != null)
                {
                    if (fragmentPropertyScope.equals(USER_PROPERTY_SCOPE))
                    {
                        userValue = fragmentProperty.getValue();
                    }
                    else if (GROUP_AND_ROLE_PROPERTY_SCOPES_ENABLED)
                    {
                        if (groupValue == null)
                        {
                            if (fragmentPropertyScope.equals(GROUP_PROPERTY_SCOPE))
                            {
                                groupValue = fragmentProperty.getValue();
                            }
                            else if (roleValue == null)
                            {
                                if (fragmentPropertyScope.equals(ROLE_PROPERTY_SCOPE))
                                {
                                    roleValue = fragmentProperty.getValue();
                                }
                            }
                        }
                    }
                }
                else if ((groupValue == null) && (roleValue == null) && (globalValue == null))
                {
                    globalValue = fragmentProperty.getValue();
                }
            }
        }

        // return most specifically scoped property value
View Full Code Here

Examples of org.apache.jetspeed.om.page.FragmentProperty

                    // and here we are assuming that only the current user has
                    // access to the new objects
                    Iterator sourceIter = transientList.iterator();
                    while (sourceIter.hasNext())
                    {
                        FragmentProperty sourceProperty = (FragmentProperty)sourceIter.next();
                        FragmentProperty targetProperty = list.getMatchingProperty(sourceProperty);
                        if (targetProperty != null)
                        {
                            targetProperty.setValue(sourceProperty.getValue());
                        }
                        else
                        {
                            list.add(sourceProperty);
                        }
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.