Package org.jasig.portal.portlet.dao.jpa

Examples of org.jasig.portal.portlet.dao.jpa.PortletPreferenceImpl


                        final IPortletEntity localPortletEntity = portletEntityRegistry.getPortletEntity(request, portletEntity.getPortletEntityId().getStringId());
                        assertEquals(portletEntity, localPortletEntity);
       
                        //T2 - Add a preference
                        final List<IPortletPreference> preferences = localPortletEntity.getPortletPreferences();
                        final IPortletPreference portletPreference = new PortletPreferenceImpl("pref2", false, "value");
                        preferences.add(portletPreference);
                       
                        //T2 - Store the entity
                        portletEntityRegistry.storePortletEntity(request, localPortletEntity);
                       
                        return localPortletEntity.getPortletEntityId();
                    }
                });

                //T2 - verify entity was made persistent
                executeInThread("T2.2", new Callable<Object>() {
                    @Override
                    public Object call() throws Exception {
                       
                        //T2 - Verify it was converted from interim to persistent
                        IPortletEntity portletEntity = portletEntityRegistry.getPortletEntity(request, portletEntityId);
                        assertEquals(PersistentPortletEntityWrapper.class, portletEntity.getClass());
                        List<IPortletPreference> preferences = portletEntity.getPortletPreferences();
                        assertEquals(1, preferences.size());
                       
                        return null;
                    }
                });
       
                //T1 - Add a preference
                final List<IPortletPreference> preferences = portletEntity.getPortletPreferences();
                final IPortletPreference portletPreference = new PortletPreferenceImpl("pref1", false, "value");
                preferences.add(portletPreference);
       
                //T1 - Store the entity
                portletEntityRegistry.storePortletEntity(request, portletEntity);
               
View Full Code Here


            public Object call() throws Exception {
                final IPortletEntity portletEntity = portletEntityRegistry.getPortletEntity(request, portletEntityId);
               
                //Add a preference
                final List<IPortletPreference> preferences = portletEntity.getPortletPreferences();
                final IPortletPreference portletPreference = new PortletPreferenceImpl("pref", false, "value");
                preferences.add(portletPreference);
       
                //Store the entity
                portletEntityRegistry.storePortletEntity(request, portletEntity);
               
View Full Code Here

            public Object call() throws Exception {
                final IPortletEntity portletEntity = portletEntityRegistry.getPortletEntity(request, portletEntityId);
               
                //Add a preference
                final List<IPortletPreference> preferences = portletEntity.getPortletPreferences();
                final IPortletPreference portletPreference = new PortletPreferenceImpl("pref", false, "value");
                preferences.add(portletPreference);
       
                //Store the entity
                portletEntityRegistry.storePortletEntity(request, portletEntity);
               
                return null;
            }
        });

        this.execute(new Callable<Object>() {
            @Override
            public Object call() throws Exception {
                //Verify it was converted from interim to persistent
                final IPortletEntity portletEntity = portletEntityRegistry.getPortletEntity(request, portletEntityId);
                assertEquals(PersistentPortletEntityWrapper.class, portletEntity.getClass());
                final List<IPortletPreference> preferences = portletEntity.getPortletPreferences();
                assertEquals(1, preferences.size());

                //add another preference
                final PortletPreferenceImpl portletPreference = new PortletPreferenceImpl("pref2", false, "valuea");
                preferences.add(portletPreference);
       
                //Store the entity
                portletEntityRegistry.storePortletEntity(request, portletEntity);
               
View Full Code Here

            public Object call() throws Exception {
                final IPortletEntity portletEntity = portletEntityRegistry.getPortletEntity(request, portletEntityId);
               
                //Add a preference
                final List<IPortletPreference> preferences = portletEntity.getPortletPreferences();
                final IPortletPreference portletPreference = new PortletPreferenceImpl("pref", false, "value");
                preferences.add(portletPreference);
       
                //Store the entity
                portletEntityRegistry.storePortletEntity(request, portletEntity);
               
View Full Code Here

            final List<String> valueList = pref.getValues();
            final String[] values = valueList.toArray(new String[valueList.size()]);
           
            final Boolean readOnly = pref.isReadOnly();
            preferenceList.add(
                    new PortletPreferenceImpl(
                            pref.getName(),
                            readOnly != null ? readOnly : false,
                            values));
        }
        def.setPortletPreferences(preferenceList);
View Full Code Here

    for (String key : form.getPortletPreferences().keySet()) {
      List<String> prefValues = form.getPortletPreferences().get(key).getValue();
      if (prefValues != null && prefValues.size() > 0) {
        String[] values = prefValues.toArray(new String[prefValues.size()]);
        BooleanAttribute readOnly = form.getPortletPreferenceReadOnly().get(key);
        preferenceList.add(new PortletPreferenceImpl(key, readOnly.getValue(), values));
      }
    }
    portletDef.setPortletPreferences(preferenceList);

        // Lastly update the PortletDefinition's lifecycle state & lifecycle-related metadata
View Full Code Here

        }
       
        IPortletPreference portletPreference = targetPortletPreferences.get(key);
        //No target preference exists yet, create it and then update the composite map
        if (portletPreference == null) {
            portletPreference = new PortletPreferenceImpl(key, false, values != null ? values.clone() : null);
            targetPortletPreferences.put(key, portletPreference);
           
            final Map<String, IPortletPreference> compositePortletPreferences = this.getCompositePortletPreferences();
            compositePortletPreferences.put(key, portletPreference);
           
View Full Code Here

        //Add descriptor prefs to base Map
        final IPortletDefinitionId portletDefinitionId = portletDefinition.getPortletDefinitionId();
        final PortletDefinition portletDescriptor = this.portletDefinitionRegistry.getParentPortletDescriptor(portletDefinitionId);
        final Preferences descriptorPreferences = portletDescriptor.getPortletPreferences();
        for (final Preference preference : descriptorPreferences.getPortletPreferences()) {
            final IPortletPreference preferenceWrapper = new PortletPreferenceImpl(preference);
            basePortletPreferences.put(preferenceWrapper.getName(), preferenceWrapper);
        }

        //Add definition prefs to base Map
        final List<IPortletPreference> definitionPreferences = portletDefinition.getPortletPreferences();
        for (final IPortletPreference preference : definitionPreferences) {
View Full Code Here

        //Add descriptor prefs to base Map
        final IPortletDefinitionId portletDefinitionId = portletDefinition.getPortletDefinitionId();
        final PortletDefinition portletDescriptor = this.portletDefinitionRegistry.getParentPortletDescriptor(portletDefinitionId);
        final Preferences descriptorPreferences = portletDescriptor.getPortletPreferences();
        for (final Preference preference : descriptorPreferences.getPortletPreferences()) {
            final IPortletPreference preferenceWrapper = new PortletPreferenceImpl(preference);
            basePortletPreferences.put(preferenceWrapper.getName(), preferenceWrapper);
        }

        //Add definition prefs to base Map
        final List<IPortletPreference> definitionPreferences = portletDefinition.getPortletPreferences();
        for (final IPortletPreference preference : definitionPreferences) {
View Full Code Here

       
        //Only do the copy if the List objects are not the same instance
        if (persistentPreferences != existingPreferences) {
            persistentPreferences.clear();
            for (final IPortletPreference preference : existingPreferences) {
                persistentPreferences.add(new PortletPreferenceImpl(preference));
            }
        }
       
        //Copy over WindowStates
        final Map<Long, WindowState> windowStates = portletEntity.getWindowStates();
View Full Code Here

TOP

Related Classes of org.jasig.portal.portlet.dao.jpa.PortletPreferenceImpl

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.