taylor      2004/05/03 17:01:29

  Modified:    src/java/org/apache/jetspeed/services/persistence
                        JetspeedPortalPersistenceService.java
  Log:
  Added feature to disable saving min/max state on role and group resources

  

  http://nagoya.apache.org/jira/browse/JS1-467

  

  This feature is setup in the JetpeedResources.properties and is by default turned off

  The default setting is true, meaning that the min/max state is shared

  

  services.PortalPersistenceService.autostore.shared = true

  

  PR:

  Obtained from:

  Submitted by: 

  Reviewed by:  

  CVS: ----------------------------------------------------------------------

  CVS: PR:

  CVS:   If this change addresses a PR in the problem report tracking

  CVS:   database, then enter the PR number(s) here.

  CVS: Obtained from:

  CVS:   If this change has been taken from another system, such as NCSA,

  CVS:   then name the system in this line, otherwise delete it.

  CVS: Submitted by:

  CVS:   If this code has been contributed to Apache by someone else; i.e.,

  CVS:   they sent us a patch or a new module, then include their name/email

  CVS:   address here. If this is your work then delete this line.

  CVS: Reviewed by:

  CVS:   If we are doing pre-commit code reviews and someone else has

  CVS:   reviewed your changes, include their name(s) here.

  CVS:   If you have not had it reviewed then delete this line.

  
  Revision  Changes    Path
  1.6       +24 -4     
jakarta-jetspeed/src/java/org/apache/jetspeed/services/persistence/JetspeedPortalPersistenceService.java
  
  Index: JetspeedPortalPersistenceService.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/persistence/JetspeedPortalPersistenceService.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JetspeedPortalPersistenceService.java     23 Feb 2004 03:33:52 -0000      1.5
  +++ JetspeedPortalPersistenceService.java     4 May 2004 00:01:29 -0000       1.6
  @@ -38,6 +38,8 @@
   // Turbine classes
   import org.apache.turbine.services.InitializationException;
   import org.apache.turbine.services.TurbineBaseService;
  +import org.apache.turbine.services.TurbineServices;
  +import org.apache.turbine.services.resources.ResourceService;
   import org.apache.turbine.util.RunData;
   
   /**
  @@ -57,6 +59,12 @@
       private static final JetspeedLogger logger = 
JetspeedLogFactoryService.getLogger(JetspeedPortalPersistenceService.class.getName()); 
   
       
       /**
  +     * Automatically Store shared PSML resources when an attribute changes
  +     * User resources will always be stored.
  +     */
  +    private boolean autoStore = true; 
  +    
  +    /**
        * Use this to verify the RunData object in use is going to be the Jetspeed
        * RunData object.  This way we know right off, whether or not things are going
        * to work.
  @@ -69,9 +77,14 @@
               logger.error(
                   "[PortalPersistenceService] The current RunData implenetation does 
not implement the JetspeedRunData interface.");
               setInit(false);
  -            throw new InitializationException("The current RunData implenetation 
does not implement the JetspeedRunData interface.");
  +            throw new InitializationException("The current RunData implenetation 
does not implement the JetspeedRunData interface.");               
           }
  -
  +        
  +        ResourceService config = ((TurbineServices)TurbineServices.getInstance())
  +                                            
.getResources(PortalPersistenceService.SERVICE_NAME);
  +        
  +        this.autoStore = config.getBoolean("autostore.shared", true);
  +        
           super.init(data);
       }    
       
  @@ -113,13 +126,20 @@
       {
           Profile profile = pPortlet.getProfile();
           profile.setDocument(pPortlet.getDocument());
  +        if (false == this.autoStore)
  +        {
  +            if (null == profile.getUser())
  +            {
  +                return; // don't store if its not a user profile
  +            }
  +        }
           
           if(!PsmlManager.store(profile))
           {
               throw new PortalPersistenceException("Unable to write portlet 
information.");
           }
       }
  -
  +    
       /**
        * @see PortalPersistenceService#getInstances(Portlet, Profile)
        */
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to