taylor      2004/08/05 11:27:07

  Modified:    portal/src/java/org/apache/jetspeed/tools/pamanager
                        FileSystemPAM.java
  Log:
  set checksum on registered apps
  write out jetspeed-portlet.xml
  
  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.41      +26 -18    
jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/tools/pamanager/FileSystemPAM.java
  
  Index: FileSystemPAM.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/tools/pamanager/FileSystemPAM.java,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- FileSystemPAM.java        4 Aug 2004 04:01:00 -0000       1.40
  +++ FileSystemPAM.java        5 Aug 2004 18:27:07 -0000       1.41
  @@ -40,8 +40,11 @@
   import org.apache.jetspeed.om.common.servlet.MutableWebApplication;
   import 
org.apache.jetspeed.tools.pamanager.servletcontainer.ApplicationServerManager;
   import org.apache.jetspeed.util.ArgUtil;
  +import org.apache.jetspeed.util.ChecksumHelper;
   import org.apache.jetspeed.util.DirectoryHelper;
   import org.apache.jetspeed.util.FileSystemHelper;
  +import org.apache.jetspeed.util.descriptor.ExtendedPortletMetadata;
  +import org.apache.jetspeed.util.descriptor.MetaDataException;
   import org.apache.jetspeed.util.descriptor.PortletApplicationDescriptor;
   import org.apache.jetspeed.util.descriptor.PortletApplicationWar;
   import org.apache.jetspeed.util.descriptor.WebApplicationDescriptor;
  @@ -724,12 +727,10 @@
           PortletApplicationException, 
           IOException
       {
  -        Reader portletXmlReader = null;        
  +        Reader portletXmlReader = null;  
           MutablePortletApplication portletApp = null;
           InputStream is = null;
           
  -        
  -        
           try
           {
               is = context.getResourceAsStream("WEB-INF/portlet.xml");
  @@ -738,37 +739,44 @@
                   throw new PortletApplicationException("Failed to find Portlet XML");
               }
               portletXmlReader = new InputStreamReader(is);       
  -            
  +              
               PortletApplicationDescriptor paDescriptor = new 
PortletApplicationDescriptor(portletXmlReader, paName);
               portletApp = paDescriptor.createPortletApplication();
  -            // validate(portletApplication);
  -            /*
  -            Reader extMetaDataXml = null;
  +            portletApp.setChecksum(ChecksumHelper.getChecksum(is));
  +
  +            Reader extendedXmlReader = null;
  +            InputStream eis = null;           
               try
               {
  -                extMetaDataXml = getReader(EXTENDED_PORTLET_XML_PATH);
  -                if (extMetaDataXml != null)
  +                eis = context.getResourceAsStream("WEB-INF/jetspeed-portlet.xml");
  +                extendedXmlReader = new InputStreamReader(eis);       
  +
  +                if (extendedXmlReader != null)
                   {
  -                    ExtendedPortletMetadata extMetaData = new 
ExtendedPortletMetadata(extMetaDataXml, portletApp);
  +                    ExtendedPortletMetadata extMetaData = new 
ExtendedPortletMetadata(extendedXmlReader, portletApp);
                       extMetaData.load();
                   }
               }
  -            catch (IOException e)
  -            {
  -                log.info("Did not load exteneded metadata as it most likely does 
not exist.  " + e.toString());
  -            }
               catch (MetaDataException e)
               {
                   log.warn("Failed to load existing metadata.  " + e.toString(), e);
               }
  +            catch (Exception e)
  +            {
  +                log.info("Did not load exteneded metadata as it most likely does 
not exist.  " + e.toString());
  +            }
               finally
               {
  -                if (null != extMetaDataXml)
  +                if (eis != null)
  +                {
  +                    eis.close();
  +                }
  +                 
  +                if (null != extendedXmlReader)
                   {
  -                    extMetaDataXml.close();
  +                    extendedXmlReader.close();
                   }
               }
  -*/
               return portletApp;
           }
           finally
  
  
  

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

Reply via email to