001: // THIS SOFTWARE IS PROVIDED BY SOFTARIS PTY.LTD. AND OTHER METABOSS
002: // CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
003: // BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
004: // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOFTARIS PTY.LTD.
005: // OR OTHER METABOSS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
006: // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
007: // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
008: // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
009: // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
010: // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
011: // EVEN IF SOFTARIS PTY.LTD. OR OTHER METABOSS CONTRIBUTORS ARE ADVISED OF THE
012: // POSSIBILITY OF SUCH DAMAGE.
013: //
014: // Copyright 2000-2005 © Softaris Pty.Ltd. All Rights Reserved.
015: package com.metaboss.sdlctools.services.codegeneration.servicemoduleadaptergenerator.soap.tomcatjwsdp;
016:
017: import java.util.ArrayList;
018: import java.util.List;
019:
020: import com.metaboss.sdlctools.frameworks.generation.internal.GenerationPlan;
021: import com.metaboss.sdlctools.frameworks.generation.internal.GenerationPlanDefaultImpl;
022:
023: /** Definition of SOAP Adapter generation */
024: public class GenerationPlanImpl extends GenerationPlanDefaultImpl {
025: // Initialise static copying details instruction set
026: private static List sCopyingDetails = new ArrayList();
027: static {
028: // {
029: // GenerationPlan.CopyingDetails lCopyingDetails = new GenerationPlan.CopyingDetails();
030: // lCopyingDetails.mResourceFilePath = "MetaBoss_Logo.gif";
031: // lCopyingDetails.mDestinationFilePath = "/MetaBoss_Logo.gif";
032: // sCopyingDetails.add(lCopyingDetails);
033: // }
034: // {
035: // GenerationPlan.CopyingDetails lCopyingDetails = new GenerationPlan.CopyingDetails();
036: // lCopyingDetails.mResourceFilePath = "LevelDown.gif";
037: // lCopyingDetails.mDestinationFilePath = "/LevelDown.gif";
038: // sCopyingDetails.add(lCopyingDetails);
039: // }
040: }
041:
042: /** Returns array of instructions for copying files */
043: public GenerationPlan.CopyingDetails[] getCopyingDetails() {
044: return (GenerationPlan.CopyingDetails[]) sCopyingDetails
045: .toArray(new GenerationPlan.CopyingDetails[sCopyingDetails
046: .size()]);
047: }
048:
049: // Initialise static copying details instruction set
050: private static List sGenerationDetails = new ArrayList();
051: static {
052: // Define all files to be generated per servicemodule
053: {
054: GenerationPlan.GenerationDetails lGenerationDef = new GenerationPlan.GenerationDetails();
055: lGenerationDef.mReferenceMatchingExpression = "Enterprise/systems\\[(\\w)+\\]/servicemodules\\[(\\w)+\\]";
056: lGenerationDef.mResourceFileExpressions = new String[] {
057: "webservicestypes.xsd.jamon",
058: "jaxrpc.ri.xml.jamon", "web.xml.jamon", };
059: lGenerationDef.mDestinationFileExpressions = new String[] {
060: // Path to the file
061: "#set( $ServicemoduleStylesheet = $StylesheetAccessor.getServicemoduleStylesheet(${Servicemodule}))"
062: + "/${ServicemoduleStylesheet.getAdapterRootPackageDir()}/soap/tomcatjwsdp/WebServicesTypes.xsd",
063:
064: // Path to the file
065: "#set( $ServicemoduleStylesheet = $StylesheetAccessor.getServicemoduleStylesheet(${Servicemodule}))"
066: + "/${ServicemoduleStylesheet.getAdapterRootPackageDir()}/soap/tomcatjwsdp/jaxrpc-ri.xml",
067:
068: // Path to the file
069: "#set( $ServicemoduleStylesheet = $StylesheetAccessor.getServicemoduleStylesheet(${Servicemodule}))"
070: + "/${ServicemoduleStylesheet.getAdapterRootPackageDir()}/soap/tomcatjwsdp/web.xml", };
071: sGenerationDetails.add(lGenerationDef);
072: }
073: // Define all files to be generated per service
074: {
075: GenerationPlan.GenerationDetails lGenerationDef = new GenerationPlan.GenerationDetails();
076: lGenerationDef.mReferenceMatchingExpression = "Enterprise/systems\\[(\\w)+\\]/servicemodules\\[(\\w)+\\]/services\\[(\\w)+\\]";
077: lGenerationDef.mResourceFileExpressions = new String[] {
078: "service.wsdl.jamon", "wscompileconfig.xml.jamon",
079: "serviceimpl.java.jamon", };
080: lGenerationDef.mDestinationFileExpressions = new String[] {
081: "#set( $ServiceStylesheet = $StylesheetAccessor.getServiceStylesheet(${Service}))"
082: + "/${ServiceStylesheet.getAdapterRootPackageDir()}/soap/tomcatjwsdp/${ServiceStylesheet.getNormalisedName()}.wsdl",
083:
084: "#set( $ServiceStylesheet = $StylesheetAccessor.getServiceStylesheet(${Service}))"
085: + "/${ServiceStylesheet.getAdapterRootPackageDir()}/soap/tomcatjwsdp/${ServiceStylesheet.getNormalisedName()}_wscompileconfig.xml",
086:
087: "#set( $ServiceStylesheet = $StylesheetAccessor.getServiceStylesheet(${Service}))"
088: + "/${ServiceStylesheet.getAdapterRootPackageDir()}/soap/tomcatjwsdp/${ServiceStylesheet.getNormalisedName().toLowerCase()}/WebServicePortImpl.java", };
089: sGenerationDetails.add(lGenerationDef);
090: }
091: // Define all files to be generated per operation
092: {
093: GenerationPlan.GenerationDetails lGenerationDef = new GenerationPlan.GenerationDetails();
094: lGenerationDef.mReferenceMatchingExpression = "Enterprise/systems\\[(\\w)+\\]/servicemodules\\[(\\w)+\\]/services\\[(\\w)+\\]/operations\\[(\\w)+\\]";
095: lGenerationDef.mResourceFileExpressions = new String[] {
096: "operationinputtranslator.java.jamon",
097: "operationresulttranslator.java.jamon", };
098: lGenerationDef.mDestinationFileExpressions = new String[] {
099: // Path to the input translator
100: "#set( $OperationStylesheet = $StylesheetAccessor.getOperationStylesheet(${Operation}))"
101: + "#set( $ServiceStylesheet = $StylesheetAccessor.getServiceStylesheet(${Operation.getService()}))"
102: + "/${ServiceStylesheet.getAdapterRootPackageDir()}/soap/tomcatjwsdp/${ServiceStylesheet.getNormalisedName().toLowerCase()}/${OperationStylesheet.getInputProxyTranslatorInnerClassName()}.java",
103:
104: // Path to the result translator
105: "#set( $OperationStylesheet = $StylesheetAccessor.getOperationStylesheet(${Operation}))"
106: + "#set( $ServiceStylesheet = $StylesheetAccessor.getServiceStylesheet(${Operation.getService()}))"
107: + "/${ServiceStylesheet.getAdapterRootPackageDir()}/soap/tomcatjwsdp/${ServiceStylesheet.getNormalisedName().toLowerCase()}/${OperationStylesheet.getResultProxyTranslatorInnerClassName()}.java", };
108: sGenerationDetails.add(lGenerationDef);
109: }
110: // Define all files to be generated per structure
111: {
112: GenerationPlan.GenerationDetails lGenerationDef = new GenerationPlan.GenerationDetails();
113: lGenerationDef.mReferenceMatchingExpression = "Enterprise/systems\\[(\\w)+\\]/servicemodules\\[(\\w)+\\]/structures\\[(\\w)+\\]";
114: lGenerationDef.mResourceFileExpressions = new String[] { "structuretranslator.java.jamon", };
115: lGenerationDef.mDestinationFileExpressions = new String[] {
116: // Path to the translator
117: "#set( $StructureStylesheet = $StylesheetAccessor.getStructureStylesheet(${Structure}))"
118: + "#set( $ServicemoduleStylesheet = $StylesheetAccessor.getServicemoduleStylesheet(${Structure.getServicemodule()}))"
119: + "/${ServicemoduleStylesheet.getAdapterRootPackageDir()}/soap/tomcatjwsdp/${StructureStylesheet.getProxyTranslatorClassName()}.java", };
120: sGenerationDetails.add(lGenerationDef);
121: }
122: // Define all files to be generated per message
123: {
124: GenerationPlan.GenerationDetails lGenerationDef = new GenerationPlan.GenerationDetails();
125: lGenerationDef.mReferenceMatchingExpression = "Enterprise/systems\\[(\\w)+\\]/servicemodules\\[(\\w)+\\]/messages\\[(\\w)+\\]";
126: lGenerationDef.mResourceFileExpressions = new String[] { "messagetranslator.java.jamon", };
127: lGenerationDef.mDestinationFileExpressions = new String[] {
128: // Path to the translator
129: "#set( $MessageStylesheet = $StylesheetAccessor.getMessageStylesheet(${Message}))"
130: + "#set( $ServicemoduleStylesheet = $StylesheetAccessor.getServicemoduleStylesheet(${Message.getServicemodule()}))"
131: + "/${ServicemoduleStylesheet.getAdapterRootPackageDir()}/soap/tomcatjwsdp/${MessageStylesheet.getProxyTranslatorClassName()}.java", };
132: sGenerationDetails.add(lGenerationDef);
133: }
134: }
135:
136: /** Returns array of instructions for generating files */
137: public GenerationDetails[] getGenerationDetails() {
138: return (GenerationPlan.GenerationDetails[]) sGenerationDetails
139: .toArray(new GenerationPlan.GenerationDetails[sGenerationDetails
140: .size()]);
141: }
142: }
|