Examples of IOutputPropertyDescriptor


Examples of org.jasig.portal.layout.om.IOutputPropertyDescriptor

        when(stylesheetDescriptor.getLayoutAttributeDescriptor("minimized")).thenReturn(skinLayoutAttributeDescriptor);
        when(skinLayoutAttributeDescriptor.getName()).thenReturn("minimized");
        when(skinLayoutAttributeDescriptor.getScope()).thenReturn(Scope.REQUEST);
        when(skinLayoutAttributeDescriptor.getTargetElementNames()).thenReturn(Collections.singleton("folder"));
       
        final IOutputPropertyDescriptor mediaOutputPropertyDescriptor = mock(IOutputPropertyDescriptor.class);
        when(stylesheetDescriptor.getOutputPropertyDescriptor("media")).thenReturn(mediaOutputPropertyDescriptor);
        when(mediaOutputPropertyDescriptor.getName()).thenReturn("media");
        when(mediaOutputPropertyDescriptor.getScope()).thenReturn(Scope.SESSION);
       
        final IStylesheetParameterDescriptor skinStylesheetParameterDescriptor = mock(IStylesheetParameterDescriptor.class);
        when(stylesheetDescriptor.getStylesheetParameterDescriptor("skin")).thenReturn(skinStylesheetParameterDescriptor);
        when(skinStylesheetParameterDescriptor.getName()).thenReturn("media");
        when(skinStylesheetParameterDescriptor.getScope()).thenReturn(Scope.PERSISTENT);
View Full Code Here

Examples of org.jasig.portal.layout.om.IOutputPropertyDescriptor

    @Override
    public String getOutputProperty(HttpServletRequest request, PreferencesScope prefScope, String name) {
        final StylesheetPreferencesKey stylesheetPreferencesKey = this.getStylesheetPreferencesKey(request, prefScope);
        final IStylesheetDescriptor stylesheetDescriptor = stylesheetPreferencesKey.stylesheetDescriptor;
        final IOutputPropertyDescriptor outputPropertyDescriptor = stylesheetDescriptor.getOutputPropertyDescriptor(name);
        if (outputPropertyDescriptor == null) {
            logger.warn("Attempted to get output property {} but no such output property is defined in stylesheet descriptor {}. null will be returned", new Object[] {name, stylesheetDescriptor.getName()});
            return null;
        }


        final String value;
        final Scope scope = outputPropertyDescriptor.getScope();
        switch (scope) {
            case PERSISTENT: {
                final IStylesheetUserPreferences stylesheetUserPreferences = this.getStylesheetUserPreferences(request, stylesheetPreferencesKey);
                if (stylesheetUserPreferences == null) {
                    return null;
                }
               
                value = stylesheetUserPreferences.getOutputProperty(name);
                break;
            }
            default: {
                value = this.getDataValue(request, stylesheetPreferencesKey, scope, OUTPUT_PROPERTIES_KEY, name);
                break;
            }
        }
       
        if (value == null) {
            return null;
        }
       
        //If the value is equal to the default value remove the property and return null
        if (this.compareValues(value, outputPropertyDescriptor.getDefaultValue())) {
            this.removeOutputProperty(request, prefScope, name);
            return null;
        }
       
        return value;
View Full Code Here

Examples of org.jasig.portal.layout.om.IOutputPropertyDescriptor

    @Transactional
    @Override
    public String setOutputProperty(HttpServletRequest request, PreferencesScope prefScope, String name, String value) {
        final StylesheetPreferencesKey stylesheetPreferencesKey = this.getStylesheetPreferencesKey(request, prefScope);
        final IStylesheetDescriptor stylesheetDescriptor = stylesheetPreferencesKey.stylesheetDescriptor;
        final IOutputPropertyDescriptor outputPropertyDescriptor = stylesheetDescriptor.getOutputPropertyDescriptor(name);
        if (outputPropertyDescriptor == null) {
            logger.warn("Attempted to set output property {}={} but no such output property is defined in stylesheet descriptor {}. It will be ignored", new Object[] {name, value, stylesheetDescriptor.getName()});
            return null;
        }
       
        if (this.compareValues(value, outputPropertyDescriptor.getDefaultValue())) {
            return this.removeOutputProperty(request, prefScope, name);
        }
       
        final Scope scope = this.getWriteScope(request, prefScope, stylesheetPreferencesKey, outputPropertyDescriptor);
        switch (scope) {
View Full Code Here

Examples of org.jasig.portal.layout.om.IOutputPropertyDescriptor

    @Transactional
    @Override
    public String removeOutputProperty(HttpServletRequest request, PreferencesScope prefScope, String name) {
        final StylesheetPreferencesKey stylesheetPreferencesKey = this.getStylesheetPreferencesKey(request, prefScope);
        final IStylesheetDescriptor stylesheetDescriptor = stylesheetPreferencesKey.stylesheetDescriptor;
        final IOutputPropertyDescriptor outputPropertyDescriptor = stylesheetDescriptor.getOutputPropertyDescriptor(name);
        if (outputPropertyDescriptor == null) {
            logger.warn("Attempted to remove output property {} but no such output property is defined in stylesheet descriptor {}. It will be ignored", new Object[] {name, stylesheetDescriptor.getName()});
            return null;
        }
       
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.