ws-wsrf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i..@apache.org
Subject svn commit: r225202 - in /webservices/wsrf/trunk/src: examples/filesystem/src/java/example/filesystem/backend/ examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/ java/org/apache/ws/resource/tool/ java/org/apache/ws/util/ site/conte...
Date Mon, 25 Jul 2005 22:58:31 GMT
Author: ips
Date: Mon Jul 25 15:58:25 2005
New Revision: 225202

URL: http://svn.apache.org/viewcvs?rev=225202&view=rev
Log:
various fixes to Wsdl2Java, site, templates, and pristine filesystem example

Modified:
    webservices/wsrf/trunk/src/examples/filesystem/src/java/example/filesystem/backend/FileSystem.java
    webservices/wsrf/trunk/src/examples/filesystem/src/java/example/filesystem/backend/UnixFileSystem.java
    webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemCustomOperationsPortType.java
    webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java
    webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemService.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/tool/Wsdl2Java.java
    webservices/wsrf/trunk/src/java/org/apache/ws/util/OperationInfo.java
    webservices/wsrf/trunk/src/java/org/apache/ws/util/WsrfWsdlUtils.java
    webservices/wsrf/trunk/src/site/content/xdocs/index.xml
    webservices/wsrf/trunk/src/site/content/xdocs/site.xml
    webservices/wsrf/trunk/src/template/build.xml
    webservices/wsrf/trunk/src/templates/Home.vm

Modified: webservices/wsrf/trunk/src/examples/filesystem/src/java/example/filesystem/backend/FileSystem.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/examples/filesystem/src/java/example/filesystem/backend/FileSystem.java?rev=225202&r1=225201&r2=225202&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/examples/filesystem/src/java/example/filesystem/backend/FileSystem.java
(original)
+++ webservices/wsrf/trunk/src/examples/filesystem/src/java/example/filesystem/backend/FileSystem.java
Mon Jul 25 15:58:25 2005
@@ -30,4 +30,10 @@
     int getFsckPassNumber();
 
     void setFsckPassNumber(int fsckPassNumber);
+
+    void mount() throws Exception;
+
+    void unmount() throws Exception;
+
+    boolean isMounted();
 }

Modified: webservices/wsrf/trunk/src/examples/filesystem/src/java/example/filesystem/backend/UnixFileSystem.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/examples/filesystem/src/java/example/filesystem/backend/UnixFileSystem.java?rev=225202&r1=225201&r2=225202&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/examples/filesystem/src/java/example/filesystem/backend/UnixFileSystem.java
(original)
+++ webservices/wsrf/trunk/src/examples/filesystem/src/java/example/filesystem/backend/UnixFileSystem.java
Mon Jul 25 15:58:25 2005
@@ -16,14 +16,14 @@
     private String m_type = "vxfs";
     private int m_backupFrequency=0;
     private int m_fsckPassNumber=2;
-    private List m_options;
+    private List m_options = new ArrayList();
     private String m_comment="user files";
     private String m_deviceSpecialFile = "/dev/vg00/lvol7";
+    private boolean m_isMounted = true;
 
     public UnixFileSystem(String devicePath)
     {
         m_deviceSpecialFile = devicePath;
-        m_options = new ArrayList();
         m_options.add("delaylog");
         m_options.add("quota");
     }
@@ -83,5 +83,20 @@
     public void setFsckPassNumber(int fsckPassNumber)
     {
         m_fsckPassNumber = fsckPassNumber;
+    }
+
+    public void mount() throws Exception
+    {
+        m_isMounted = true;
+    }
+
+    public void unmount() throws Exception
+    {
+        m_isMounted = false;
+    }
+
+    public boolean isMounted()
+    {
+        return m_isMounted;
     }
 }

Modified: webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemCustomOperationsPortType.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemCustomOperationsPortType.java?rev=225202&r1=225201&r2=225202&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemCustomOperationsPortType.java
(original)
+++ webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemCustomOperationsPortType.java
Mon Jul 25 15:58:25 2005
@@ -11,8 +11,8 @@
  */
 public interface FilesystemCustomOperationsPortType
 {
-   
-      public org.apache.ws.resource.example.filesystem.UnmountResponseDocument Unmount( org.apache.ws.resource.example.filesystem.UnmountDocument
requestDoc ) throws org.apache.ws.resource.example.filesystem.MountDeviceBusyFaultException
;       
-      public org.apache.ws.resource.example.filesystem.MountResponseDocument Mount( org.apache.ws.resource.example.filesystem.MountDocument
requestDoc ) throws org.apache.ws.resource.example.filesystem.MountDeviceBusyFaultException
;       
-   
+
+      public org.apache.ws.resource.example.filesystem.UnmountResponseDocument unmount( org.apache.ws.resource.example.filesystem.UnmountDocument
requestDoc ) throws org.apache.ws.resource.example.filesystem.MountDeviceBusyFaultException
;
+      public org.apache.ws.resource.example.filesystem.MountResponseDocument mount( org.apache.ws.resource.example.filesystem.MountDocument
requestDoc ) throws org.apache.ws.resource.example.filesystem.MountDeviceBusyFaultException
;
+
 }

Modified: webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java?rev=225202&r1=225201&r2=225202&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java
(original)
+++ webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java
Mon Jul 25 15:58:25 2005
@@ -1,9 +1,8 @@
-
 package org.apache.ws.resource.example.filesystem;
 
 /**
  * **** NOTE: This file will not be overwritten during generation ****
- *
+ * <p/>
  * A Filesystem WS-Resource.
  * <p/>
  * NOTE: This class is generated but IS meant to be modified.
@@ -12,97 +11,113 @@
 
 {
 
-        /**
+    /**
      * A NamespaceVerionHolder which maintains the QNames of Spec Wsdls
      */
     public static final org.apache.ws.resource.properties.v2004_06.impl.NamespaceVersionHolderImpl
SPEC_NAMESPACE_SET = new org.apache.ws.resource.properties.v2004_06.impl.NamespaceVersionHolderImpl();
 
+    private example.filesystem.backend.FileSystem m_filesystem;
+
     /**
      * Initializes this resource's state (properties, etc.).
      */
-   public void init()
-       {
+    public void init()
+    {
 
-           super.init();
+        super.init();
 
-           /**
-   		 * The ResourcePropertySet which contains all the defined ResourceProperties
-   		 */
-   		org.apache.ws.resource.properties.ResourcePropertySet resourcePropertySet = getResourcePropertySet();
-   		org.apache.ws.resource.properties.ResourceProperty resourceProperty = null;
-
-
-   	try{
-
-
-           /*
-            * This is where you should associate the backend instance with
-            * the resource instance for a given id.
-            */
-           example.filesystem.backend.FileSystem m_fileSystem = new example.filesystem.backend.UnixFileSystem(
m_id );
-
-           /*
-            * Initialize each of our properties by calling resourceProperty.add(propElem)
and/or resourceProperty.setCallback(callback)...
-            */
-           resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.DEVICESPECIALFILE
);
-           DeviceSpecialFileDocument deviceDocXBean = DeviceSpecialFileDocument.Factory.newInstance();
-           deviceDocXBean.setDeviceSpecialFile( m_fileSystem.getDeviceSpecialFile() );
-           resourceProperty.add( deviceDocXBean );
-
-           resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.TYPE );
-           TypeDocument typeDocXBean = TypeDocument.Factory.newInstance();
-           typeDocXBean.setType( m_fileSystem.getType() );
-           resourceProperty.add( typeDocXBean );
-
-           BackupFrequencyDocument backupDocXBean = BackupFrequencyDocument.Factory.newInstance();
-           backupDocXBean.setBackupFrequency( m_fileSystem.getBackupFrequency() );
-           resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.BACKUPFREQUENCY
);
-           resourceProperty.add( backupDocXBean );
-           resourceProperty.setCallback( new example.filesystem.callback.BackupFrequencyCallback(
m_fileSystem ) );
-
-           CommentDocument commentDocXBean = CommentDocument.Factory.newInstance();
-           commentDocXBean.setComment( m_fileSystem.getComment() );
-           resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.COMMENT );
-           resourceProperty.add( commentDocXBean );
-           resourceProperty.setCallback( new example.filesystem.callback.CommentCallback(
m_fileSystem ) );
-
-           FsckPassNumberDocument fsckDocXBean = FsckPassNumberDocument.Factory.newInstance();
-           fsckDocXBean.setFsckPassNumber( m_fileSystem.getFsckPassNumber() );
-           resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.FSCKPASSNUMBER
);
-           resourceProperty.add( fsckDocXBean );
-           resourceProperty.setCallback( new example.filesystem.callback.FsckPassNumberCallback(
m_fileSystem ) );
-
-           MountPointDirectoryDocument mountPointDocXBean = MountPointDirectoryDocument.Factory.newInstance();
-           mountPointDocXBean.setMountPointDirectory( m_fileSystem.getMountPoint() );
-           resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.MOUNTPOINTDIRECTORY
);
-           resourceProperty.add( mountPointDocXBean );
-           resourceProperty.setCallback( new example.filesystem.callback.MountPointCallback(
m_fileSystem ) );
-
-           OptionsDocument optionsDocXBean =
-                   OptionsDocument.Factory.newInstance();
-           org.apache.ws.resource.example.filesystem.OptionsDocument.Options options =
-                   optionsDocXBean.addNewOptions();
-           java.util.List backendOptions =
-                   m_fileSystem.getOptions();
-           for ( int i = 0; i < backendOptions.size(); i++ )
-           {
-               options.addOption( (String) backendOptions.get( i ) );
-           }
-
-           resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.OPTIONS );
-           resourceProperty.add( optionsDocXBean );
-           resourceProperty.setCallback( new example.filesystem.callback.OptionsCallback(
m_fileSystem ) );
-
-
-   		}
-   	catch (Exception e)
-   	{
-   	   throw new javax.xml.rpc.JAXRPCException("There was a problem in initializing your
resource properties.  Please check your init() method. Cause: " + e.getLocalizedMessage());
-   	}
-   		// Resource Property {http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd}TerminationTime
is implemented by the framework.
-   		// Resource Property {http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd}CurrentTime
is implemented by the framework.
+        /**
+         * The ResourcePropertySet which contains all the defined ResourceProperties
+         */
+        org.apache.ws.resource.properties.ResourcePropertySet resourcePropertySet = getResourcePropertySet();
+        org.apache.ws.resource.properties.ResourceProperty resourceProperty = null;
+
+        try
+        {
+
+            /*
+             * This is where you should associate the backend instance with
+             * the resource instance for a given id.
+             */
+            m_filesystem = new example.filesystem.backend.UnixFileSystem( m_id );
+
+            /*
+             * Initialize each of our properties by calling resourceProperty.add(propElem)
and/or resourceProperty.setCallback(callback)...
+             */
+            resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.DEVICESPECIALFILE
);
+            DeviceSpecialFileDocument deviceDocXBean = DeviceSpecialFileDocument.Factory.newInstance();
+            deviceDocXBean.setDeviceSpecialFile( m_filesystem.getDeviceSpecialFile() );
+            resourceProperty.add( deviceDocXBean );
+
+            resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.TYPE );
+            TypeDocument typeDocXBean = TypeDocument.Factory.newInstance();
+            typeDocXBean.setType( m_filesystem.getType() );
+            resourceProperty.add( typeDocXBean );
+
+            BackupFrequencyDocument backupDocXBean = BackupFrequencyDocument.Factory.newInstance();
+            backupDocXBean.setBackupFrequency( m_filesystem.getBackupFrequency() );
+            resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.BACKUPFREQUENCY
);
+            resourceProperty.add( backupDocXBean );
+            resourceProperty.setCallback( new example.filesystem.callback.BackupFrequencyCallback(
m_filesystem ) );
+
+            CommentDocument commentDocXBean = CommentDocument.Factory.newInstance();
+            commentDocXBean.setComment( m_filesystem.getComment() );
+            resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.COMMENT
);
+            resourceProperty.add( commentDocXBean );
+            resourceProperty.setCallback( new example.filesystem.callback.CommentCallback(
m_filesystem ) );
+
+            FsckPassNumberDocument fsckDocXBean = FsckPassNumberDocument.Factory.newInstance();
+            fsckDocXBean.setFsckPassNumber( m_filesystem.getFsckPassNumber() );
+            resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.FSCKPASSNUMBER
);
+            resourceProperty.add( fsckDocXBean );
+            resourceProperty.setCallback( new example.filesystem.callback.FsckPassNumberCallback(
m_filesystem ) );
+
+            MountPointDirectoryDocument mountPointDocXBean = MountPointDirectoryDocument.Factory.newInstance();
+            mountPointDocXBean.setMountPointDirectory( m_filesystem.getMountPoint() );
+            resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.MOUNTPOINTDIRECTORY
);
+            resourceProperty.add( mountPointDocXBean );
+            resourceProperty.setCallback( new example.filesystem.callback.MountPointCallback(
m_filesystem ) );
+
+            OptionsDocument optionsDocXBean =
+                    OptionsDocument.Factory.newInstance();
+            org.apache.ws.resource.example.filesystem.OptionsDocument.Options options =
+                    optionsDocXBean.addNewOptions();
+            java.util.List backendOptions =
+                    m_filesystem.getOptions();
+            for ( int i = 0; i < backendOptions.size(); i++ )
+            {
+                options.addOption( (String) backendOptions.get( i ) );
+            }
+
+            resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.OPTIONS
);
+            resourceProperty.add( optionsDocXBean );
+            resourceProperty.setCallback( new example.filesystem.callback.OptionsCallback(
m_filesystem ) );
+
+        }
+        catch ( Exception e )
+        {
+            throw new javax.xml.rpc.JAXRPCException(
+                    "There was a problem in initializing your resource properties.  Please
check your init() method. Cause: " +
+                    e.getLocalizedMessage() );
+        }
+        // Resource Property {http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd}TerminationTime
is implemented by the framework.
+        // Resource Property {http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd}CurrentTime
is implemented by the framework.
 
+    }
 
+    public void mount() throws Exception
+    {
+        m_filesystem.mount();
+    }
 
+    public void unmount() throws Exception
+    {
+        m_filesystem.unmount();
     }
+
+    public boolean isMounted()
+    {
+        return m_filesystem.isMounted();
+    }
+
 }

Modified: webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemService.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemService.java?rev=225202&r1=225201&r2=225202&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemService.java
(original)
+++ webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemService.java
Mon Jul 25 15:58:25 2005
@@ -1,75 +1,80 @@
 package org.apache.ws.resource.example.filesystem;
 
 import org.apache.ws.resource.ResourceContext;
-import org.apache.xmlbeans.XmlObject;
-import org.apache.xmlbeans.XmlException;
-
-import javax.xml.rpc.JAXRPCException;
 
 /**
  * **** NOTE: This file will not be overwritten during generation ****
- *
- * This class should be generated ONCE (and not overwritten) to maintain user-added code.
- * If there is a change to the WSDL, then the generated implemented interfaces
- * (representing the "base" portTypes) will change, thus showing a compile error to the
- * user.
- *
- * NOTE: This class is generated. However, it will not be overwritten by subsequent
- *       calls to the code generator.
- *
+ * <p/>
+ * This class should be generated ONCE (and not overwritten) to maintain user-added code.
If there is a change to the
+ * WSDL, then the generated implemented interfaces (representing the "base" portTypes) will
change, thus showing a
+ * compile error to the user.
+ * <p/>
+ * NOTE: This class is generated. However, it will not be overwritten by subsequent calls
to the code generator.
  */
 public class FilesystemService
-   extends AbstractFilesystemService 
-   implements FilesystemCustomOperationsPortType
+        extends AbstractFilesystemService
+        implements FilesystemCustomOperationsPortType
 {
-   
-      
-   /**
-    * A NamespaceVerionHolder which maintains the QNames of Spec Wsdls
-    */
-   public static final org.apache.ws.resource.properties.v2004_06.impl.NamespaceVersionHolderImpl
SPEC_NAMESPACE_SET = new org.apache.ws.resource.properties.v2004_06.impl.NamespaceVersionHolderImpl();
-    
-   /**
-    * Creates a new {@link FilesystemService } object.
-    *
-    * @param resourceContext DOCUMENT_ME
-    */
-   public FilesystemService( ResourceContext resourceContext )
-   {
-      super(resourceContext);
-      init();
-   }
-   
-      /**
-    * Returns a collection of Spec Namespaces associated with this Service
-    *
-    * @return A NamespaceVersionHolder impl which represents the collection of spec namespaces

-    *         associated with this service.
-    */
-   protected org.apache.ws.resource.properties.NamespaceVersionHolder getNamespaceSet()
-   {
-      return SPEC_NAMESPACE_SET;
-   }
-   
-      
-   public org.apache.ws.resource.example.filesystem.UnmountResponseDocument Unmount( org.apache.ws.resource.example.filesystem.UnmountDocument
requestDoc ) throws org.apache.ws.resource.example.filesystem.MountDeviceBusyFaultException
-   {              
-     	org.apache.ws.resource.example.filesystem.UnmountResponseDocument responseDocument
= org.apache.ws.resource.example.filesystem.UnmountResponseDocument.Factory.newInstance();

-     	org.apache.ws.resource.example.filesystem.UnmountResponseDocument.UnmountResponse 
response = responseDocument.addNewUnmountResponse();
-     	//TODO implement method and populate the response object 
-     	return responseDocument;
-   }
-   
-   
-      
-   public org.apache.ws.resource.example.filesystem.MountResponseDocument Mount( org.apache.ws.resource.example.filesystem.MountDocument
requestDoc ) throws org.apache.ws.resource.example.filesystem.MountDeviceBusyFaultException
-   {              
-     	org.apache.ws.resource.example.filesystem.MountResponseDocument responseDocument =
org.apache.ws.resource.example.filesystem.MountResponseDocument.Factory.newInstance();	
-     	org.apache.ws.resource.example.filesystem.MountResponseDocument.MountResponse  response
= responseDocument.addNewMountResponse();
-     	//TODO implement method and populate the response object 
-     	return responseDocument;
-   }
-   
-   
-      
+
+    /**
+     * A NamespaceVerionHolder which maintains the QNames of Spec Wsdls
+     */
+    public static final org.apache.ws.resource.properties.v2004_06.impl.NamespaceVersionHolderImpl
SPEC_NAMESPACE_SET = new org.apache.ws.resource.properties.v2004_06.impl.NamespaceVersionHolderImpl();
+
+    /**
+     * Creates a new {@link FilesystemService } object.
+     *
+     * @param resourceContext DOCUMENT_ME
+     */
+    public FilesystemService( ResourceContext resourceContext )
+    {
+        super( resourceContext );
+        init();
+    }
+
+    /**
+     * Returns a collection of Spec Namespaces associated with this Service
+     *
+     * @return A NamespaceVersionHolder impl which represents the collection of spec namespaces
associated with this
+     *         service.
+     */
+    protected org.apache.ws.resource.properties.NamespaceVersionHolder getNamespaceSet()
+    {
+        return SPEC_NAMESPACE_SET;
+    }
+
+    public org.apache.ws.resource.example.filesystem.UnmountResponseDocument unmount(
+            org.apache.ws.resource.example.filesystem.UnmountDocument requestDoc )
+            throws org.apache.ws.resource.example.filesystem.MountDeviceBusyFaultException
+    {
+        try
+        {
+            ( (FilesystemResource) getResource() ).unmount();
+        }
+        catch ( Exception e )
+        {
+            throw new MountDeviceBusyFaultException( getNamespaceSet(), e.getLocalizedMessage()
);
+        }
+        org.apache.ws.resource.example.filesystem.UnmountResponseDocument responseDocument
= org.apache.ws.resource.example.filesystem.UnmountResponseDocument.Factory.newInstance();
+        org.apache.ws.resource.example.filesystem.UnmountResponseDocument.UnmountResponse
response = responseDocument.addNewUnmountResponse();         
+        return responseDocument;
+    }
+
+    public org.apache.ws.resource.example.filesystem.MountResponseDocument mount(
+            org.apache.ws.resource.example.filesystem.MountDocument requestDoc )
+            throws org.apache.ws.resource.example.filesystem.MountDeviceBusyFaultException
+    {
+        try
+        {
+            ( (FilesystemResource) getResource() ).mount();
+        }
+        catch ( Exception e )
+        {
+            throw new MountDeviceBusyFaultException( getNamespaceSet(), e.getLocalizedMessage()
);
+        }
+        org.apache.ws.resource.example.filesystem.MountResponseDocument responseDocument
= org.apache.ws.resource.example.filesystem.MountResponseDocument.Factory.newInstance();
+        org.apache.ws.resource.example.filesystem.MountResponseDocument.MountResponse response
= responseDocument.addNewMountResponse();
+        return responseDocument;
+    }
+
 }

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/tool/Wsdl2Java.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/tool/Wsdl2Java.java?rev=225202&r1=225201&r2=225202&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/tool/Wsdl2Java.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/tool/Wsdl2Java.java Mon Jul 25
15:58:25 2005
@@ -1,5 +1,5 @@
 /*=============================================================================*
- *  Copyright 2004 The Apache Software Foundation
+ *  Copyright 2004-2005 The Apache Software Foundation
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -32,6 +32,7 @@
 import org.apache.ws.resource.tool.velocity.ImplementsListBuilder;
 import org.apache.ws.resource.tool.velocity.ServiceProperties;
 import org.apache.ws.util.OperationInfo;
+import org.apache.ws.util.WsrfWsdlUtils;
 import org.apache.ws.util.XmlBeanNameUtils;
 import org.apache.ws.util.i18n.Messages;
 import org.apache.ws.util.velocity.CommonsLogLogSystem;
@@ -212,7 +213,10 @@
     {
         System.out.println("Processing WSDL file \"" + wsdlFile + "\"...");
         Definition def = m_wsdlReader.readWSDL(wsdlFile.getPath());
-        generateXmlBeans(wsdlFile);
+        if ( WsrfWsdlUtils.getSchemaElements( def ).length != 0 )
+        {
+            generateXmlBeans(wsdlFile);
+        }
         Iterator serviceIter = def.getServices().values().iterator();
         while (serviceIter.hasNext())
         {

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/util/OperationInfo.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/util/OperationInfo.java?rev=225202&r1=225201&r2=225202&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/util/OperationInfo.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/util/OperationInfo.java Mon Jul 25 15:58:25
2005
@@ -44,14 +44,14 @@
 
     public OperationInfo(Operation op, String targetNamespace)
     {
-        m_methodName = StringUtils.capitalize( op.getName() );
+        m_methodName = StringUtils.uncapitalize( op.getName() );
         Input input = op.getInput();
         if ( input != null )
         {
             Map inputParts = input.getMessage().getParts();
-            if ( inputParts.size() != 1 )
+            if ( inputParts.size() > 1 )
             {
-                throw new RuntimeException( "WSDL input element should have exactly one part."
);
+                throw new RuntimeException( "WSDL input element must have at most one part."
);
             }
             Part inputPart = (Part) inputParts.values().iterator().next();
             m_requestElemName = inputPart.getElementName();
@@ -67,7 +67,7 @@
             Map outputParts = output.getMessage().getParts();
             if ( outputParts.size() > 1 )
             {
-                throw new RuntimeException( "WSDL output element should have at most one
part." );
+                throw new RuntimeException( "WSDL output element must have at most one part."
);
             }
             if ( outputParts.size() == 1)
             {
@@ -110,7 +110,6 @@
                 }
             }
         }
-
     }
 
     public String getJavaMethodName()
@@ -172,4 +171,5 @@
     {
        return getUnqualifiedRequestClassName().substring(0, getUnqualifiedRequestClassName().lastIndexOf("Document"));
     }
+
 }

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/util/WsrfWsdlUtils.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/util/WsrfWsdlUtils.java?rev=225202&r1=225201&r2=225202&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/util/WsrfWsdlUtils.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/util/WsrfWsdlUtils.java Mon Jul 25 15:58:25
2005
@@ -58,7 +58,10 @@
                                               PortType specPortType )
     {
         List specOps = specPortType.getOperations();
-        if (specOps.size() == 0 ) return false; //todo need to determine if props are present
for portTypes which have no methods.
+        if ( specOps.size() == 0 )
+        {
+            return false; //todo need to determine if props are present for portTypes which
have no methods.
+        }
         boolean foundSome = false;
         for ( int i = 0; i < specOps.size(); i++ )
         {
@@ -128,10 +131,10 @@
         Element rpDocTypeElem;
         if ( type != null )
         {
-            if ( ! type.getNamespaceURI().equals( rpDocXsdElem.getSchemaElement().getAttribute(
"targetNamespace" ) ) )
+            if ( !type.getNamespaceURI().equals( rpDocXsdElem.getSchemaElement().getAttribute(
"targetNamespace" ) ) )
             {
                 throw new InvalidWsrfWsdlException(
-                    "This tool currently does not support referencing a ResourceProperties
complexType that is not in the current schema's targetNamespace." );
+                        "This tool currently does not support referencing a ResourceProperties
complexType that is not in the current schema's targetNamespace." );
             }
             rpDocTypeElem = getComplexTypeByName( rpDocXsdElem.getSchemaElement(), type.getLocalPart()
);
         }
@@ -144,7 +147,9 @@
         }
         if ( rpDocTypeElem == null )
         {
-            throw new InvalidWsrfWsdlException( "Unable to determine type of the ResourceProperties
document element with QName " + rpDocElemName + " - expected either a type atribute or a nested
anonymous complexType element." );
+            throw new InvalidWsrfWsdlException(
+                    "Unable to determine type of the ResourceProperties document element
with QName " + rpDocElemName +
+                    " - expected either a type atribute or a nested anonymous complexType
element." );
         }
         Element sequenceElem = null;
         NodeList sequenceNodes = rpDocTypeElem.getElementsByTagNameNS( XmlConstants.NSURI_SCHEMA_XSD,
"sequence" );
@@ -172,7 +177,8 @@
             QName propName = getQualifiedAttribute( new XsdElement( propElem, rpDocXsdElem.getSchemaElement()
), "ref" );
             if ( propName == null )
             {
-                throw new InvalidWsrfWsdlException( "All element defs within the resource
property document def must have a 'ref' attribute that points at a global element def." );
+                throw new InvalidWsrfWsdlException(
+                        "All element defs within the resource property document def must
have a 'ref' attribute that points at a global element def." );
             }
             propNames.add( propName );
         }
@@ -227,11 +233,14 @@
         }
         catch ( PrefixResolutionException pre )
         {
-            throw new InvalidWsrfWsdlException( "Unable to resolve prefix '" + pre.getPrefix()
+ "' in xsd:element '" + attribName + "' attribute value." );
+            throw new InvalidWsrfWsdlException(
+                    "Unable to resolve prefix '" + pre.getPrefix() + "' in xsd:element '"
+ attribName +
+                    "' attribute value." );
         }
         catch ( InvalidValueException ive )
         {
-            throw new InvalidWsrfWsdlException( "Value for xsd:element 'ref' attribute must
be qualified via a namespace prefix." );
+            throw new InvalidWsrfWsdlException(
+                    "Value for xsd:element 'ref' attribute must be qualified via a namespace
prefix." );
         }
         return propName;
     }
@@ -250,7 +259,7 @@
         String namespace = prefixResolver.getNamespaceForPrefix( prefix );
         if ( namespace == null )
         {
-           throw new PrefixResolutionException( prefix );
+            throw new PrefixResolutionException( prefix );
         }
         QName qName = new QName( namespace, localName, prefix );
         return qName;
@@ -376,21 +385,30 @@
         return tokenizer.nextToken();
     }
 
-    private static Element[] getSchemaElements( Definition def )
+    /**
+     *
+     * @param def a JWSDL definition
+     *
+     * @return array of DOM elements, representing any xsd:schema elements within the specified
definition's types section
+     */ 
+    public static Element[] getSchemaElements( Definition def )
     {
         List schemaElems = new ArrayList();
-        List extElems = def.getTypes().getExtensibilityElements();
-        for ( int i = 0; i < extElems.size(); i++ )
+        if ( def.getTypes() != null )
         {
-            ExtensibilityElement extElem = (ExtensibilityElement) extElems.get( i );
-            if ( extElem instanceof UnknownExtensibilityElement )
+            List extElems = def.getTypes().getExtensibilityElements();
+            for ( int i = 0; i < extElems.size(); i++ )
             {
-                UnknownExtensibilityElement unknownExtElem = (UnknownExtensibilityElement)
extElem;
-                Element elem = unknownExtElem.getElement();
-                if ( elem.getNamespaceURI().equals( XmlConstants.NSURI_SCHEMA_XSD )
-                        && elem.getLocalName().equals( XmlConstants.XSD_SCHEMA.getLocalPart()
) )
+                ExtensibilityElement extElem = (ExtensibilityElement) extElems.get( i );
+                if ( extElem instanceof UnknownExtensibilityElement )
                 {
-                    schemaElems.add( elem );
+                    UnknownExtensibilityElement unknownExtElem = (UnknownExtensibilityElement)
extElem;
+                    Element elem = unknownExtElem.getElement();
+                    if ( elem.getNamespaceURI().equals( XmlConstants.NSURI_SCHEMA_XSD )
+                            && elem.getLocalName().equals( XmlConstants.XSD_SCHEMA.getLocalPart()
) )
+                    {
+                        schemaElems.add( elem );
+                    }
                 }
             }
         }

Modified: webservices/wsrf/trunk/src/site/content/xdocs/index.xml
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/site/content/xdocs/index.xml?rev=225202&r1=225201&r2=225202&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/site/content/xdocs/index.xml (original)
+++ webservices/wsrf/trunk/src/site/content/xdocs/index.xml Mon Jul 25 15:58:25 2005
@@ -17,7 +17,7 @@
 		</section>
 		<section>
 			<title>Features</title>
-			<p>Apache WSRF include the following features:</p>
+			<p>Apache WSRF includes the following features:</p>
 			<ul>
 				<li>A handler and service framework that supports: the WSRF implied resource pattern
for dispatching requests to specific WS-Resources; dispatching to Java service 
 				methods based on either outermost SOAP body element name or value of wsa:Action header
element; and schema validation of request XML</li>
@@ -26,7 +26,7 @@
 				<li>full implementations of all portTypes defined by the WS-ResourceProperties,
 WS-ResourceLifetime, and WS-MetadataExchange specifications</li>
 				<li>and more...</li>
 			</ul>
-			<p>Any feedback is welcomed and can be sent to our <a href="site:contact">mailing
list</a>.
+			<p>Your feedback is welcome and can be sent to the <a href="contact_info.html#wsrf-user">wsrf-user
mailing list</a>.
 			</p>		
 		</section>
 		<section>

Modified: webservices/wsrf/trunk/src/site/content/xdocs/site.xml
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/site/content/xdocs/site.xml?rev=225202&r1=225201&r2=225202&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/site/content/xdocs/site.xml (original)
+++ webservices/wsrf/trunk/src/site/content/xdocs/site.xml Mon Jul 25 15:58:25 2005
@@ -17,7 +17,7 @@
 		<overview label="Overview" href="index.html"/>
 		<vcs label="Version Control" href="version_control.html"/>
 		<issues label="Issue Tracking" href="issue_tracking.html"/>
-		<contact label="Contact Info" href="contact_info.html"/>
+		<contact label="Contact Info" href="contact_info.html">
 		<relnotes label="Release Notes" href="release_notes.html"/>
 		<wsrf label="WSRF Specs" href="wsrf.html"/>
 	</project>
@@ -55,27 +55,22 @@
 		<log label="Logging" href="debug.html"/>
 	</developer>
 	<projects label="Related Projects" tab="home">
+		<pubscribe label="Pubscribe" href="ext:pubscribe"/>
+		<muse label="Muse" href="ext:muse"/>				
 		<axis label="Axis" href="ext:axis"/>
 		<addressing label="Addressing" href="ext:addressing"/>
-		<xmlbeans label="XMLBeans" href="ext:xmlbeans.apache.org"/>
-		<maven label="Maven" href="ext:maven.apache.org"/>
+		<xmlbeans label="XMLBeans" href="ext:xmlbeans.apache.org"/>		
 	</projects>
 	<external-refs>
-		<xml.apache.org href="http://xml.apache.org/">
-			<forrest href="forrest/"/>
-		</xml.apache.org>
-		<pubscribe href="http://ws.apache.org/pubscribe/"/>
-		<muse href="http://ws.apache.org/muse/"/>
 		<xmlbeans.apache.org href="http://xmlbeans.apache.org/"/>
 		<maven.apache.org href="http://maven.apache.org/"/>
-		<ws.apache.org href="http://ws.apache.org/">
-			<mirrors href="mirrors.cgi"/>
+		<ws.apache.org href="http://ws.apache.org/">			
+			<pubscribe href="pubscribe/"/>
+			<muse href="muse/"/>
 			<axis href="axis/"/>
-			<wsfx href="ws-fx/">
-				<addressing href="addressing/"/>
-				<wss4j href="wss4j/"/>
-			</wsfx>
+			<addressing href="addressing/"/>
 			<asl href="LICENSE.txt"/>
+			<mirrors href="mirrors.cgi"/>
 		</ws.apache.org>
 		<cvs.apache.org href="http://cvs.apache.org/">
 			<viewcvs href="viewcvs/">

Modified: webservices/wsrf/trunk/src/template/build.xml
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/template/build.xml?rev=225202&r1=225201&r2=225202&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/template/build.xml (original)
+++ webservices/wsrf/trunk/src/template/build.xml Mon Jul 25 15:58:25 2005
@@ -62,7 +62,7 @@
        </wsdls>
      </wsdl2Java>
           
-     <delete dir="${tmp.dir}" />    
+     <delete dir="${tmp.dir}" failonerror="false" />    
      
    </target>   
       

Modified: webservices/wsrf/trunk/src/templates/Home.vm
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/templates/Home.vm?rev=225202&r1=225201&r2=225202&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/templates/Home.vm (original)
+++ webservices/wsrf/trunk/src/templates/Home.vm Mon Jul 25 15:58:25 2005
@@ -56,53 +56,18 @@
      org.apache.ws.resource.JndiConstants.CONTEXT_NAME_SERVICES + "/" + SERVICE_NAME.getLocalPart()
+ "/" + org.apache.ws.resource.JndiConstants.ATOMIC_NAME_HOME;
     
     /**
+     * Create and add any resource instances.
      *
-     * @param resourceContext
-     *
-     * @return A Resource
-     *
-     * @throws ResourceException        
-     * @throws ResourceContextException 
-     * @throws ResourceUnknownException 
+     * @throws Exception on error
      */
-    public Resource getInstance( ResourceContext resourceContext )
-            throws ResourceException,
-            ResourceContextException,
-            ResourceUnknownException
+    public void init() throws Exception
     {
-        ResourceKey key = resourceContext.getResourceKey();
-        Resource resource = null;
-        try
-        {
-            resource = find( key ); //attempt to find from the underlying cache
-        }
-        catch ( ResourceException re )
-        {
-            //TODO add any checking for key validity if you plan to create instances here
-            
-            /**
-             * Commented below is an example of creating a resource instance, adding its
epr and adding to the cache.             
-             * Note: You can set the EndpointReference on your Resource using the setter
(not in Resource interface)
-             */
-
-	    /*
-            try
-	    {
-	        ${capitalServiceName}Resource myresource = (${capitalServiceName}Resource)createInstance(key);
//this will create the resource IF it is has default constructor. It also calls init() on
the resource.
-		//the next line will create an EPR
-		EndpointReference epr = getEndpointReference(resourceContext.getBaseURL(  ) + "/" + getServiceName().getLocalPart()
, key, SPEC_NAMESPACE_SET.getAddressingNamespace());
-		myresource.setEndpointReference(epr); //make sure to set the EPR on your new instance 
                 		
-		add(key, myresource); //make sure to add your instance to the underlying cache to be found
in future requests using find(..)
-	    }
-	    catch (Exception e)
-	    {
-		throw new ResourceException(e);
-	    }                
-	    */
-            
-        }
-        return resource;
-    }
+        super.init();
+        // You may create and add any known resource instances here.
+        //String instance1_id = "00000001";
+        //${capitalServiceName}Resource instance1 = (${capitalServiceName}Resource) createInstance(
instance1_id );
+        //add( instance1_id, instance1 );
+    }    
     
     public QName getServiceName()
     {
@@ -123,4 +88,5 @@
     {
         return RESOURCE_KEY_NAME;
     }
+    
 }



Mime
View raw message