morciuch    2002/08/20 11:44:30

  Modified:    src/java/org/apache/jetspeed/modules/actions/portlets
                        PsmlUpdateAction.java
  Log:
  1. Allow to override default Copy To using jr.props
  2. Use psml name as default in Copy To
  3. Remove unused imports per checkstyle
  
  Revision  Changes    Path
  1.7       +6 -30     
jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/PsmlUpdateAction.java
  
  Index: PsmlUpdateAction.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/PsmlUpdateAction.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- PsmlUpdateAction.java     13 Aug 2002 21:46:42 -0000      1.6
  +++ PsmlUpdateAction.java     20 Aug 2002 18:44:30 -0000      1.7
  @@ -68,8 +68,6 @@
   import org.apache.velocity.context.Context;
   
   //Java
  -import java.util.Vector;
  -import java.util.Iterator;
   import java.io.File;
   import java.io.FileWriter;
   import java.io.FileReader;
  @@ -80,7 +78,6 @@
   import org.apache.jetspeed.om.profile.BaseProfile;
   import org.apache.jetspeed.om.profile.BaseProfileLocator;
   import org.apache.jetspeed.om.profile.Profile;
  -import org.apache.jetspeed.om.profile.ProfileException;
   import org.apache.jetspeed.om.profile.ProfileLocator;
   import org.apache.jetspeed.om.profile.PSMLDocument;
   import org.apache.jetspeed.om.profile.Portlets;
  @@ -96,7 +93,6 @@
   
   //castor support
   import org.exolab.castor.xml.MarshalException;
  -import org.exolab.castor.xml.Unmarshaller;
   import org.exolab.castor.xml.Marshaller;
   import org.exolab.castor.xml.ValidationException;
   import org.exolab.castor.mapping.Mapping;
  @@ -234,9 +230,11 @@
               {
                   if (msgid == null)
                   {
  +                    String exportPath = 
JetspeedResources.getString("psml.export.default.path", "/tmp");
                       if(path == null)
                       {
  -                        context.put(COPY_TO, "c:/temp");
  +                        
  +                        context.put(COPY_TO, exportPath);
                           context.put(COPY_FROM, 
"user/anon/media-type/html/page/default.psml");
                       }
                       else
  @@ -269,7 +267,7 @@
   
                           }
   
  -                        context.put(COPY_TO, "c:/temp/"+categoryValue+".psml");
  +                        context.put(COPY_TO, exportPath+"/"+tmpLocator.getName());
                           context.put(COPY_FROM, path);
                       }
                   }
  @@ -518,26 +516,6 @@
               copyFrom = rundata.getParameters().getString("CopyFrom");
               copyTo = rundata.getParameters().getString("CopyTo");
   
  -            //TODO: check if file already exists
  -            /*if (name == null || name.trim().length() == 0)
  -            {
  -                JetspeedLink link = JetspeedLinkFactory.getInstance(rundata);
  -                DynamicURI duri = link.getPaneByName(PSML_UPDATE_PANE)
  -                                      .addPathInfo(SecurityConstants.PARAM_MODE,
  -                                                   
SecurityConstants.PARAM_MODE_INSERT)
  -                                      .addPathInfo(SecurityConstants.PARAM_MSGID,
  -                                                   
SecurityConstants.MID_INVALID_ENTITY_NAME);
  -                JetspeedLinkFactory.putInstance(link);
  -                rundata.setRedirectURI(duri.toString());
  -
  -                //save user entered values
  -                if (copyTo != null)
  -                    rundata.getUser().setTemp(COPY_TO, copyTo);
  -                if (copyFrom != null)
  -                    rundata.getUser().setTemp(COPY_FROM, copyFrom);
  -                return;
  -            } */
  -
               //
               // retrieve the profile to clone
               //
  @@ -581,7 +559,7 @@
           }
           // save values that user just entered so they don't have to re-enter
           if (copyTo != null)
  -            rundata.getUser().setTemp(COPY_TO, copyFrom);
  +            rundata.getUser().setTemp(COPY_TO, copyTo);
           if (copyFrom != null)
               rundata.getUser().setTemp(COPY_FROM, copyFrom);
   
  @@ -687,8 +665,6 @@
   
           return mapping;
       }
  -
  -
   
   }
   
  
  
  

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

Reply via email to