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.applicationgenerator.domainexplorer;
016:
017: import java.util.ArrayList;
018: import java.util.List;
019:
020: import com.metaboss.sdlctools.frameworks.generation.GenerationPlan;
021: import com.metaboss.sdlctools.frameworks.generation.GenerationPlanDefaultImpl;
022:
023: /** Definition of enterprise generation */
024: public class EnterpriseGenerationPlan 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 = "ArchitectedWithMetaBoss.gif";
031: lCopyingDetails.mDestinationFilePath = "/images/ArchitectedWithMetaBoss.gif";
032: sCopyingDetails.add(lCopyingDetails);
033: }
034: {
035: GenerationPlan.CopyingDetails lCopyingDetails = new GenerationPlan.CopyingDetails();
036: lCopyingDetails.mResourceFilePath = "ftiens4.js";
037: lCopyingDetails.mDestinationFilePath = "/ftiens4.js";
038: sCopyingDetails.add(lCopyingDetails);
039: }
040: {
041: GenerationPlan.CopyingDetails lCopyingDetails = new GenerationPlan.CopyingDetails();
042: lCopyingDetails.mResourceFilePath = "ua.js";
043: lCopyingDetails.mDestinationFilePath = "/ua.js";
044: sCopyingDetails.add(lCopyingDetails);
045: }
046: {
047: GenerationPlan.CopyingDetails lCopyingDetails = new GenerationPlan.CopyingDetails();
048: lCopyingDetails.mResourceFilePath = "utils.js";
049: lCopyingDetails.mDestinationFilePath = "/utils.js";
050: sCopyingDetails.add(lCopyingDetails);
051: }
052: {
053: GenerationPlan.CopyingDetails lCopyingDetails = new GenerationPlan.CopyingDetails();
054: lCopyingDetails.mResourceFilePath = "ftv2blank.gif";
055: lCopyingDetails.mDestinationFilePath = "/images/ftv2blank.gif";
056: sCopyingDetails.add(lCopyingDetails);
057: }
058: {
059: GenerationPlan.CopyingDetails lCopyingDetails = new GenerationPlan.CopyingDetails();
060: lCopyingDetails.mResourceFilePath = "ftv2doc.gif";
061: lCopyingDetails.mDestinationFilePath = "/images/ftv2doc.gif";
062: sCopyingDetails.add(lCopyingDetails);
063: }
064: {
065: GenerationPlan.CopyingDetails lCopyingDetails = new GenerationPlan.CopyingDetails();
066: lCopyingDetails.mResourceFilePath = "ftv2folderclosed.gif";
067: lCopyingDetails.mDestinationFilePath = "/images/ftv2folderclosed.gif";
068: sCopyingDetails.add(lCopyingDetails);
069: }
070: {
071: GenerationPlan.CopyingDetails lCopyingDetails = new GenerationPlan.CopyingDetails();
072: lCopyingDetails.mResourceFilePath = "ftv2folderopen.gif";
073: lCopyingDetails.mDestinationFilePath = "/images/ftv2folderopen.gif";
074: sCopyingDetails.add(lCopyingDetails);
075: }
076: {
077: GenerationPlan.CopyingDetails lCopyingDetails = new GenerationPlan.CopyingDetails();
078: lCopyingDetails.mResourceFilePath = "ftv2lastnode.gif";
079: lCopyingDetails.mDestinationFilePath = "/images/ftv2lastnode.gif";
080: sCopyingDetails.add(lCopyingDetails);
081: }
082: {
083: GenerationPlan.CopyingDetails lCopyingDetails = new GenerationPlan.CopyingDetails();
084: lCopyingDetails.mResourceFilePath = "ftv2link.gif";
085: lCopyingDetails.mDestinationFilePath = "/images/ftv2link.gif";
086: sCopyingDetails.add(lCopyingDetails);
087: }
088: {
089: GenerationPlan.CopyingDetails lCopyingDetails = new GenerationPlan.CopyingDetails();
090: lCopyingDetails.mResourceFilePath = "ftv2mlastnode.gif";
091: lCopyingDetails.mDestinationFilePath = "/images/ftv2mlastnode.gif";
092: sCopyingDetails.add(lCopyingDetails);
093: }
094: {
095: GenerationPlan.CopyingDetails lCopyingDetails = new GenerationPlan.CopyingDetails();
096: lCopyingDetails.mResourceFilePath = "ftv2mnode.gif";
097: lCopyingDetails.mDestinationFilePath = "/images/ftv2mnode.gif";
098: sCopyingDetails.add(lCopyingDetails);
099: }
100: {
101: GenerationPlan.CopyingDetails lCopyingDetails = new GenerationPlan.CopyingDetails();
102: lCopyingDetails.mResourceFilePath = "ftv2node.gif";
103: lCopyingDetails.mDestinationFilePath = "/images/ftv2node.gif";
104: sCopyingDetails.add(lCopyingDetails);
105: }
106: {
107: GenerationPlan.CopyingDetails lCopyingDetails = new GenerationPlan.CopyingDetails();
108: lCopyingDetails.mResourceFilePath = "ftv2plastnode.gif";
109: lCopyingDetails.mDestinationFilePath = "/images/ftv2plastnode.gif";
110: sCopyingDetails.add(lCopyingDetails);
111: }
112: {
113: GenerationPlan.CopyingDetails lCopyingDetails = new GenerationPlan.CopyingDetails();
114: lCopyingDetails.mResourceFilePath = "ftv2pnode.gif";
115: lCopyingDetails.mDestinationFilePath = "/images/ftv2pnode.gif";
116: sCopyingDetails.add(lCopyingDetails);
117: }
118: {
119: GenerationPlan.CopyingDetails lCopyingDetails = new GenerationPlan.CopyingDetails();
120: lCopyingDetails.mResourceFilePath = "ftv2vertline.gif";
121: lCopyingDetails.mDestinationFilePath = "/images/ftv2vertline.gif";
122: sCopyingDetails.add(lCopyingDetails);
123: }
124: {
125: GenerationPlan.CopyingDetails lCopyingDetails = new GenerationPlan.CopyingDetails();
126: lCopyingDetails.mResourceFilePath = "metaboss_system.gif";
127: lCopyingDetails.mDestinationFilePath = "/images/metaboss_system.gif";
128: sCopyingDetails.add(lCopyingDetails);
129: }
130: {
131: GenerationPlan.CopyingDetails lCopyingDetails = new GenerationPlan.CopyingDetails();
132: lCopyingDetails.mResourceFilePath = "metaboss_servicemodule.gif";
133: lCopyingDetails.mDestinationFilePath = "/images/metaboss_servicemodule.gif";
134: sCopyingDetails.add(lCopyingDetails);
135: }
136: }
137:
138: /** Returns array of instructions for copying files */
139: public GenerationPlan.CopyingDetails[] getCopyingDetails() {
140: return (GenerationPlan.CopyingDetails[]) sCopyingDetails
141: .toArray(new GenerationPlan.CopyingDetails[sCopyingDetails
142: .size()]);
143: }
144:
145: // Initialise static copying details instruction set
146: private static List sGenerationDetails = new ArrayList();
147: static {
148: // Define all pages to be generated per design library
149: {
150: GenerationPlan.GenerationDetails lGenerationDef = new GenerationPlan.GenerationDetails();
151: lGenerationDef.mReferenceMatchingExpression = "Enterprise";
152: lGenerationDef.mResourceFileExpressions = new String[] {
153: "index.html.jamon", "stylesheet.css.jamon",
154: "overview.frame.html.jamon",
155: "alltree.frame.html.jamon",
156: "alltreenodes.js.jamon",
157: "allelements.frame.html.jamon",
158: "allcategories.frame.html.jamon",
159: "allelements.noframe.html.jamon",
160: "overview.summary.html.jamon",
161: "help.doc.html.jamon" };
162: lGenerationDef.mDestinationFileExpressions = new String[] {
163: "/index.html", "/stylesheet.css",
164: "/overview-frame.html", "/alltree-frame.html",
165: "/alltreenodes.js", "/allelements-frame.html",
166: "/allcategories-frame.html",
167: "/allelements-noframe.html",
168: "/overview-summary.html", "/help-doc.html" };
169: sGenerationDetails.add(lGenerationDef);
170: }
171: // Define all pages to be generated per design library
172: {
173: GenerationPlan.GenerationDetails lGenerationDef = new GenerationPlan.GenerationDetails();
174: lGenerationDef.mReferenceMatchingExpression = "Enterprise/designLibrary";
175: lGenerationDef.mResourceFileExpressions = new String[] {
176: "designlibraryelements.frame.html.jamon",
177: "designlibrarycategories.frame.html.jamon" };
178: lGenerationDef.mDestinationFileExpressions = new String[] {
179: "/designlibraryelements-frame.html",
180: "/designlibrarycategories-frame.html" };
181: sGenerationDetails.add(lGenerationDef);
182: }
183: // Define all pages to be generated per system
184: {
185: GenerationPlan.GenerationDetails lGenerationDef = new GenerationPlan.GenerationDetails();
186: lGenerationDef.mReferenceMatchingExpression = "Enterprise/systems\\[(\\w)+\\]";
187: lGenerationDef.mResourceFileExpressions = new String[] {
188: "systemelements.frame.html.jamon",
189: "systemcategories.frame.html.jamon",
190: "system.html.jamon", };
191: lGenerationDef.mDestinationFileExpressions = new String[] {
192: "/system_${System.getName().toLowerCase()}/systemelements-frame.html",
193: "/system_${System.getName().toLowerCase()}/systemcategories-frame.html",
194: "/system_${System.getName().toLowerCase()}/System_${System.getName()}.html", };
195: sGenerationDetails.add(lGenerationDef);
196: }
197: // Define all pages to be generated per servicemodule
198: {
199: GenerationPlan.GenerationDetails lGenerationDef = new GenerationPlan.GenerationDetails();
200: lGenerationDef.mReferenceMatchingExpression = "Enterprise/systems\\[(\\w)+\\]/servicemodules\\[(\\w)+\\]";
201: lGenerationDef.mResourceFileExpressions = new String[] { "servicemodule.html.jamon", };
202: lGenerationDef.mDestinationFileExpressions = new String[] { "/system_${Servicemodule.getSystem().getName().toLowerCase()}/servicemodule_${Servicemodule.getName().toLowerCase()}/Servicemodule_${Servicemodule.getName()}.html", };
203: sGenerationDetails.add(lGenerationDef);
204: }
205: // Define all pages to be generated per service
206: {
207: GenerationPlan.GenerationDetails lGenerationDef = new GenerationPlan.GenerationDetails();
208: lGenerationDef.mReferenceMatchingExpression = "Enterprise/systems\\[(\\w)+\\]/servicemodules\\[(\\w)+\\]/services\\[(\\w)+\\]";
209: lGenerationDef.mResourceFileExpressions = new String[] { "service.html.jamon", };
210: lGenerationDef.mDestinationFileExpressions = new String[] { "/system_${Service.getServicemodule().getSystem().getName().toLowerCase()}/servicemodule_${Service.getServicemodule().getName().toLowerCase()}/Service_${Service.getName()}.html", };
211: sGenerationDetails.add(lGenerationDef);
212: }
213: // Define all pages to be generated per structure
214: {
215: GenerationPlan.GenerationDetails lGenerationDef = new GenerationPlan.GenerationDetails();
216: lGenerationDef.mReferenceMatchingExpression = "Enterprise/systems\\[(\\w)+\\]/servicemodules\\[(\\w)+\\]/structures\\[(\\w)+\\]";
217: lGenerationDef.mResourceFileExpressions = new String[] { "structure.html.jamon", };
218: lGenerationDef.mDestinationFileExpressions = new String[] { "/system_${Structure.getServicemodule().getSystem().getName().toLowerCase()}/servicemodule_${Structure.getServicemodule().getName().toLowerCase()}/Structure_${Structure.getName()}.html", };
219: sGenerationDetails.add(lGenerationDef);
220: }
221: // Define all pages to be generated per message
222: {
223: GenerationPlan.GenerationDetails lGenerationDef = new GenerationPlan.GenerationDetails();
224: lGenerationDef.mReferenceMatchingExpression = "Enterprise/systems\\[(\\w)+\\]/servicemodules\\[(\\w)+\\]/messages\\[(\\w)+\\]";
225: lGenerationDef.mResourceFileExpressions = new String[] { "message.html.jamon", };
226: lGenerationDef.mDestinationFileExpressions = new String[] { "/system_${Message.getServicemodule().getSystem().getName().toLowerCase()}/servicemodule_${Message.getServicemodule().getName().toLowerCase()}/Message_${Message.getName()}.html", };
227: sGenerationDetails.add(lGenerationDef);
228: }
229: // Define all pages to be generated per design library namespace
230: {
231: GenerationPlan.GenerationDetails lGenerationDef = new GenerationPlan.GenerationDetails();
232: lGenerationDef.mReferenceMatchingExpression = "Enterprise/designLibrary/dataDictionary(/subNamespaces\\[(\\w)+\\])+";
233: lGenerationDef.mResourceFileExpressions = new String[] { "namespace.html.jamon", };
234: lGenerationDef.mDestinationFileExpressions = new String[] { "/designlibrary/datadictionary#foreach( $ns in $Namespace.getPathWithoutDictionary() )/$ns.getName().toLowerCase()#end/Namespace_${Namespace.getName()}.html", };
235: sGenerationDetails.add(lGenerationDef);
236: }
237: // Define all pages to be generated per system namespace
238: {
239: GenerationPlan.GenerationDetails lGenerationDef = new GenerationPlan.GenerationDetails();
240: lGenerationDef.mReferenceMatchingExpression = "Enterprise/systems\\[(\\w)+\\]/dataDictionary(/subNamespaces\\[(\\w)+\\])+";
241: lGenerationDef.mResourceFileExpressions = new String[] { "namespace.html.jamon", };
242: lGenerationDef.mDestinationFileExpressions = new String[] { "/system_${Namespace.getOwnerDataDictionary().getSystem().getName().toLowerCase()}/datadictionary#foreach( $ns in $Namespace.getPathWithoutDictionary() )/$ns.getName().toLowerCase()#end/Namespace_${Namespace.getName()}.html", };
243: sGenerationDetails.add(lGenerationDef);
244: }
245: // Define all pages to be generated per typetemplate coming from system data dictionary
246: {
247: GenerationPlan.GenerationDetails lGenerationDef = new GenerationPlan.GenerationDetails();
248: lGenerationDef.mReferenceMatchingExpression = "Enterprise/systems\\[(\\w)+\\]/dataDictionary((/subNamespaces\\[(\\w)+\\])*)/typeTemplates\\[(\\w)+\\]";
249: lGenerationDef.mResourceFileExpressions = new String[] { "typetemplate.html.jamon" };
250: lGenerationDef.mDestinationFileExpressions = new String[] { "/system_${TypeTemplate.getOwnerDataDictionary().getSystem().getName().toLowerCase()}/datadictionary#foreach( $ns in $TypeTemplate.getNamespace().getPathWithoutDictionary() )/$ns.getName().toLowerCase()#end/TypeTemplate_${TypeTemplate.getName()}.html" };
251: sGenerationDetails.add(lGenerationDef);
252: }
253: // Define all pages to be generated per typetemplate coming from enterprise data dictionary
254: {
255: GenerationPlan.GenerationDetails lGenerationDef = new GenerationPlan.GenerationDetails();
256: lGenerationDef.mReferenceMatchingExpression = "Enterprise/designLibrary/dataDictionary((/subNamespaces\\[(\\w)+\\])*)/typeTemplates\\[(\\w)+\\]";
257: lGenerationDef.mResourceFileExpressions = new String[] { "typetemplate.html.jamon" };
258: lGenerationDef.mDestinationFileExpressions = new String[] { "/designlibrary/datadictionary/#foreach( $ns in $TypeTemplate.getNamespace().getPathWithoutDictionary() )/$ns.getName().toLowerCase()#end/TypeTemplate_${TypeTemplate.getName()}.html" };
259: sGenerationDetails.add(lGenerationDef);
260: }
261: // Define all pages to be generated per datatype coming from system data dictionary
262: {
263: GenerationPlan.GenerationDetails lGenerationDef = new GenerationPlan.GenerationDetails();
264: lGenerationDef.mReferenceMatchingExpression = "Enterprise/systems\\[(\\w)+\\]/dataDictionary((/subNamespaces\\[(\\w)+\\])*)/dataTypes\\[(\\w)+\\]";
265: lGenerationDef.mResourceFileExpressions = new String[] { "datatype.html.jamon" };
266: lGenerationDef.mDestinationFileExpressions = new String[] { "/system_${DataType.getOwnerDataDictionary().getSystem().getName().toLowerCase()}/datadictionary#foreach( $ns in $DataType.getNamespace().getPathWithoutDictionary() )/$ns.getName().toLowerCase()#end/DataType_${DataType.getName()}.html" };
267: sGenerationDetails.add(lGenerationDef);
268: }
269: // Define all pages to be generated per datatype coming from enterprise data dictionary
270: {
271: GenerationPlan.GenerationDetails lGenerationDef = new GenerationPlan.GenerationDetails();
272: lGenerationDef.mReferenceMatchingExpression = "Enterprise/designLibrary/dataDictionary((/subNamespaces\\[(\\w)+\\])*)/dataTypes\\[(\\w)+\\]";
273: lGenerationDef.mResourceFileExpressions = new String[] { "datatype.html.jamon" };
274: lGenerationDef.mDestinationFileExpressions = new String[] { "/designlibrary/datadictionary/#foreach( $ns in $DataType.getNamespace().getPathWithoutDictionary() )/$ns.getName().toLowerCase()#end/DataType_${DataType.getName()}.html" };
275: sGenerationDetails.add(lGenerationDef);
276: }
277: // Define all pages to be generated per domain
278: {
279: GenerationPlan.GenerationDetails lGenerationDef = new GenerationPlan.GenerationDetails();
280: lGenerationDef.mReferenceMatchingExpression = "Enterprise/systems\\[(\\w)+\\]/domains\\[(\\w)+\\]";
281: lGenerationDef.mResourceFileExpressions = new String[] { "domain.html.jamon", };
282: lGenerationDef.mDestinationFileExpressions = new String[] { "/system_${Domain.getSystem().getName().toLowerCase()}/domain_${Domain.getName().toLowerCase()}/Domain_${Domain.getName()}.html", };
283: sGenerationDetails.add(lGenerationDef);
284: }
285: // Define all pages to be generated per entity
286: {
287: GenerationPlan.GenerationDetails lGenerationDef = new GenerationPlan.GenerationDetails();
288: lGenerationDef.mReferenceMatchingExpression = "Enterprise/systems\\[(\\w)+\\]/domains\\[(\\w)+\\]/entities\\[(\\w)+\\]";
289: lGenerationDef.mResourceFileExpressions = new String[] { "entity.html.jamon", };
290: lGenerationDef.mDestinationFileExpressions = new String[] { "/system_${Entity.getDomain().getSystem().getName().toLowerCase()}/domain_${Entity.getDomain().getName().toLowerCase()}/Entity_${Entity.getName()}.html", };
291: sGenerationDetails.add(lGenerationDef);
292: }
293: // Define all pages to be generated per association
294: {
295: GenerationPlan.GenerationDetails lGenerationDef = new GenerationPlan.GenerationDetails();
296: lGenerationDef.mReferenceMatchingExpression = "Enterprise/systems\\[(\\w)+\\]/domains\\[(\\w)+\\]/associations\\[(\\w)+\\]";
297: lGenerationDef.mResourceFileExpressions = new String[] { "association.html.jamon", };
298: lGenerationDef.mDestinationFileExpressions = new String[] { "/system_${Association.getDomain().getSystem().getName().toLowerCase()}/domain_${Association.getDomain().getName().toLowerCase()}/Association_${Association.getName()}.html", };
299: sGenerationDetails.add(lGenerationDef);
300: }
301: // Define all pages to be generated per report
302: {
303: GenerationPlan.GenerationDetails lGenerationDef = new GenerationPlan.GenerationDetails();
304: lGenerationDef.mReferenceMatchingExpression = "Enterprise/systems\\[(\\w)+\\]/domains\\[(\\w)+\\]/reports\\[(\\w)+\\]";
305: lGenerationDef.mResourceFileExpressions = new String[] { "report.html.jamon", };
306: lGenerationDef.mDestinationFileExpressions = new String[] { "/system_${Report.getDomain().getSystem().getName().toLowerCase()}/domain_${Report.getDomain().getName().toLowerCase()}/Report_${Report.getName()}.html", };
307: sGenerationDetails.add(lGenerationDef);
308: }
309: }
310:
311: /** Returns array of instructions for generating files */
312: public GenerationDetails[] getGenerationDetails() {
313: return (GenerationPlan.GenerationDetails[]) sGenerationDetails
314: .toArray(new GenerationPlan.GenerationDetails[sGenerationDetails
315: .size()]);
316: }
317: }
|