Examples of IStylesheetUserPreferences


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

        }
       
        final Scope scope = this.getWriteScope(request, prefScope, stylesheetPreferencesKey, stylesheetParameterDescriptor);
        switch (scope) {
            case PERSISTENT: {
                final IStylesheetUserPreferences stylesheetUserPreferences = this.getStylesheetUserPreferences(request, stylesheetPreferencesKey);
                if (stylesheetUserPreferences == null) {
                    return null;
                }
               
                final String oldValue = stylesheetUserPreferences.removeStylesheetParameter(name);
                this.stylesheetUserPreferencesDao.storeStylesheetUserPreferences(stylesheetUserPreferences);
                return oldValue;
            }
            default: {
                return removeDataValue(request, stylesheetPreferencesKey, scope, STYLESHEET_PARAMETERS_KEY, name);
View Full Code Here

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

            PreferencesScope prefScope, P stylesheetParameters) {
        final StylesheetPreferencesKey stylesheetPreferencesKey = this.getStylesheetPreferencesKey(request, prefScope);
        final IStylesheetDescriptor stylesheetDescriptor = stylesheetPreferencesKey.stylesheetDescriptor;
       
        //Get the scoped sources once
        final IStylesheetUserPreferences stylesheetUserPreferences = this.getStylesheetUserPreferences(request, stylesheetPreferencesKey);
        final Map<String, String> sessionStylesheetParameters;
        final HttpSession session = request.getSession(false);
        if (session == null) {
            sessionStylesheetParameters = null;
        }
        else {
            sessionStylesheetParameters = PortalWebUtils.getMapSessionAttribute(session, STYLESHEET_PARAMETERS_KEY + stylesheetPreferencesKey.toString(), false);
        }
        final Map<String, String> requestStylesheetParameters = PortalWebUtils.getMapRequestAttribute(request, STYLESHEET_PARAMETERS_KEY + stylesheetPreferencesKey.toString(), false);
       
        //Try getting each stylesheet parameter to populate the Map
        for (final IStylesheetParameterDescriptor stylesheetParameterDescriptor : stylesheetDescriptor.getStylesheetParameterDescriptors()) {
            final String name = stylesheetParameterDescriptor.getName();

            final String value;
            final Scope scope = stylesheetParameterDescriptor.getScope();
            switch (scope) {
                case PERSISTENT: {
                    if (stylesheetUserPreferences == null) {
                        value = null;
                        break;
                    }
                   
                    value = stylesheetUserPreferences.getStylesheetParameter(name);
                    break;
                }
                case SESSION: {
                    if (sessionStylesheetParameters == null) {
                        value = null;
View Full Code Here

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

    @Transactional
    @Override
    public void clearStylesheetParameters(HttpServletRequest request, PreferencesScope prefScope) {
        final StylesheetPreferencesKey stylesheetPreferencesKey = this.getStylesheetPreferencesKey(request, prefScope);
       
        final IStylesheetUserPreferences stylesheetUserPreferences = this.getStylesheetUserPreferences(request, stylesheetPreferencesKey);
        if (stylesheetUserPreferences != null) {
            stylesheetUserPreferences.clearStylesheetParameters();
            this.stylesheetUserPreferencesDao.storeStylesheetUserPreferences(stylesheetUserPreferences);
        }
       
        final HttpSession session = request.getSession(false);
        if (session != null) {
View Full Code Here

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


       
        //Load the default value
        String defaultValue = null;
        final IStylesheetUserPreferences distributedStylesheetUserPreferences = this.getDistributedStylesheetUserPreferences(request, prefScope);
        if (distributedStylesheetUserPreferences != null) {
            defaultValue = distributedStylesheetUserPreferences.getLayoutAttribute(nodeId, name);
           
            if (this.compareValues(defaultValue, layoutAttributeDescriptor.getDefaultValue())) {
                //DLM attribute value matches the stylesheet descriptor default, remove the DLM value
                distributedStylesheetUserPreferences.removeLayoutAttribute(nodeId, name);
                defaultValue = null;
            }
        }
       
        final String value;
        final Scope scope = layoutAttributeDescriptor.getScope();
        switch (scope) {
            case PERSISTENT: {
                final IStylesheetUserPreferences stylesheetUserPreferences = this.getStylesheetUserPreferences(request, stylesheetPreferencesKey);
                if (stylesheetUserPreferences == null) {
                    value = null;
                    break;
                }
               
                value = stylesheetUserPreferences.getLayoutAttribute(nodeId, name);
                break;
            }
            default: {
                final Map<String, String> nodeAttributes = this.getDataValue(request, stylesheetPreferencesKey, scope, LAYOUT_ATTRIBUTES_KEY, nodeId);
                if (nodeAttributes == null) {
View Full Code Here

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

        if (session.getAttribute(key) != null) {
            request.setAttribute(key, Boolean.TRUE);
            return null;
        }
       
        final IStylesheetUserPreferences stylesheetUserPreferences = this.stylesheetUserPreferencesDao.getStylesheetUserPreferences(stylesheetPreferencesKey.stylesheetDescriptor, stylesheetPreferencesKey.person, stylesheetPreferencesKey.userProfile);
       
        if (stylesheetUserPreferences == null) {
            session.setAttribute(key, Boolean.TRUE);
            request.setAttribute(key, Boolean.TRUE);
        }
View Full Code Here

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

        if (this.compareValues(value, layoutAttributeDescriptor.getDefaultValue())) {
            //Value matches the default value, remove the attribute
            return this.removeLayoutAttribute(request, prefScope, nodeId, name);
        }
       
        final IStylesheetUserPreferences distributedStylesheetUserPreferences = this.getDistributedStylesheetUserPreferences(request, prefScope);
        if (distributedStylesheetUserPreferences != null) {
            final String defaultValue = distributedStylesheetUserPreferences.getLayoutAttribute(nodeId, name);
            if (this.compareValues(value, defaultValue)) {
                //Value matches the DLM preferences value, remove the value
                return this.removeLayoutAttribute(request, prefScope, nodeId, name);
            }
        }
       
        final Scope scope = this.getWriteScope(request, prefScope, stylesheetPreferencesKey, layoutAttributeDescriptor);
        switch (scope) {
            case PERSISTENT: {
                IStylesheetUserPreferences stylesheetUserPreferences = this.getStylesheetUserPreferences(request, stylesheetPreferencesKey);
                if (stylesheetUserPreferences == null) {
                    stylesheetUserPreferences = this.stylesheetUserPreferencesDao.createStylesheetUserPreferences(stylesheetDescriptor, stylesheetPreferencesKey.person, stylesheetPreferencesKey.userProfile);
                    this.clearStylesheetUserPreferencesCache(request, stylesheetPreferencesKey);
                }
               
                final String oldValue = stylesheetUserPreferences.setLayoutAttribute(nodeId, name, value);
                this.stylesheetUserPreferencesDao.storeStylesheetUserPreferences(stylesheetUserPreferences);
                return oldValue;
            }
            default: {
               
View Full Code Here

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

        }
       
        final Scope scope = this.getWriteScope(request, prefScope, stylesheetPreferencesKey, layoutAttributeDescriptor);
        switch (scope) {
            case PERSISTENT: {
                final IStylesheetUserPreferences stylesheetUserPreferences = this.getStylesheetUserPreferences(request, stylesheetPreferencesKey);
                if (stylesheetUserPreferences == null) {
                    break;
                }
               
                final String oldValue = stylesheetUserPreferences.removeLayoutAttribute(nodeId, name);
                if (oldValue != null) {
                    this.stylesheetUserPreferencesDao.storeStylesheetUserPreferences(stylesheetUserPreferences);
                    return oldValue;
                }
            }
            default: {
                final Map<String, String> nodeAttributes = this.getDataValue(request, stylesheetPreferencesKey, scope, LAYOUT_ATTRIBUTES_KEY, nodeId);
                if (nodeAttributes == null) {
                    break;
                }
               
                final String oldValue = nodeAttributes.remove(name);
                if (oldValue != null) {
                    return oldValue;
                }
            }
        }
       
        final IStylesheetUserPreferences distributedStylesheetUserPreferences = this.getDistributedStylesheetUserPreferences(request, prefScope);
        if (distributedStylesheetUserPreferences != null) {
            return distributedStylesheetUserPreferences.removeLayoutAttribute(nodeId, name);
        }
       
        return null;
    }
View Full Code Here

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

    public Iterable<String> getAllLayoutAttributeNodeIds(HttpServletRequest request, PreferencesScope prefScope) {
        final StylesheetPreferencesKey stylesheetPreferencesKey = this.getStylesheetPreferencesKey(request, prefScope);
       
        final LinkedHashSet<String> allNodeIds = new LinkedHashSet<String>();
       
        final IStylesheetUserPreferences stylesheetUserPreferences = this.getStylesheetUserPreferences(request, stylesheetPreferencesKey);
        if (stylesheetUserPreferences != null) {
            allNodeIds.addAll(stylesheetUserPreferences.getAllLayoutAttributeNodeIds());
        }
       
        final HttpSession session = request.getSession(false);
        if (session != null) {
            final Map<String, Map<String, String>> sessionLayoutAttributes = getSessionLayoutAttributes(session, stylesheetPreferencesKey);
            if (sessionLayoutAttributes != null) {
                allNodeIds.addAll(sessionLayoutAttributes.keySet());
            }
           
        }

        final Map<String, Map<String, String>> requestLayoutAttributes = getRequestLayoutAttributes(request, stylesheetPreferencesKey);
        if (requestLayoutAttributes != null) {
            allNodeIds.addAll(requestLayoutAttributes.keySet());
        }
       
        final IStylesheetUserPreferences distributedStylesheetUserPreferences = this.getDistributedStylesheetUserPreferences(request, prefScope);
        if (distributedStylesheetUserPreferences != null) {
            allNodeIds.addAll(distributedStylesheetUserPreferences.getAllLayoutAttributeNodeIds());
        }
       
        return allNodeIds;
    }
View Full Code Here

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

    }
   
    @Override
    public Map<String, String> getAllNodesAndValuesForAttribute(HttpServletRequest request, PreferencesScope prefScope, String name) {
        final StylesheetPreferencesKey stylesheetPreferencesKey = this.getStylesheetPreferencesKey(request, prefScope);
        final IStylesheetUserPreferences stylesheetUserPreferences = this.getStylesheetUserPreferences(request, stylesheetPreferencesKey);

        final Builder<String, String> result = ImmutableMap.builder();
       
        final IStylesheetUserPreferences distributedStylesheetUserPreferences = this.getDistributedStylesheetUserPreferences(request, prefScope);
        if (distributedStylesheetUserPreferences != null) {
            final Map<String, String> allNodesAndValuesForAttribute = distributedStylesheetUserPreferences.getAllNodesAndValuesForAttribute(name);
            result.putAll(allNodesAndValuesForAttribute);
        }
       
        if (stylesheetUserPreferences != null) {
            final Map<String, String> allNodesAndValuesForAttribute = stylesheetUserPreferences.getAllNodesAndValuesForAttribute(name);
View Full Code Here

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

            PreferencesScope prefScope, String nodeId, P layoutAttributes) {
        final StylesheetPreferencesKey stylesheetPreferencesKey = this.getStylesheetPreferencesKey(request, prefScope);
        final IStylesheetDescriptor stylesheetDescriptor = stylesheetPreferencesKey.stylesheetDescriptor;
       
        //Get the scoped sources once
        final IStylesheetUserPreferences stylesheetUserPreferences = this.getStylesheetUserPreferences(request, stylesheetPreferencesKey);
        final Map<String, Map<String, String>> sessionLayoutAttributes;
        final HttpSession session = request.getSession(false);
        if (session == null) {
            sessionLayoutAttributes = null;
        }
        else {
            sessionLayoutAttributes = getSessionLayoutAttributes(session, stylesheetPreferencesKey);
        }
        final Map<String, Map<String, String>> requestLayoutAttributes = getRequestLayoutAttributes(request, stylesheetPreferencesKey);
       
        final IStylesheetUserPreferences distributedStylesheetUserPreferences = this.getDistributedStylesheetUserPreferences(request, prefScope);
        if (distributedStylesheetUserPreferences != null) {
            distributedStylesheetUserPreferences.populateLayoutAttributes(nodeId, layoutAttributes);
        }
       
        //Try getting each layout attribute to populate the Map
        for (final ILayoutAttributeDescriptor layoutAttributeDescriptor : stylesheetDescriptor.getLayoutAttributeDescriptors()) {
            final String name = layoutAttributeDescriptor.getName();
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.