Source Code Cross Referenced for JavaProductPersister.java in  » Installer » VAInstall » com » memoire » vainstall » builder » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Installer » VAInstall » com.memoire.vainstall.builder.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $RCSfile: JavaProductPersister.java,v $
003:         * @modification $Date: 2001/09/28 19:41:42 $
004:         * @version      $Id: JavaProductPersister.java,v 1.1 2001/09/28 19:41:42 hfalk Exp $
005:         *
006:         */
007:
008:        package com.memoire.vainstall.builder.util;
009:
010:        import com.memoire.vainstall.VAGlobals;
011:        import com.memoire.vainstall.builder.*;
012:
013:        import java.io.File;
014:        import java.util.*;
015:
016:        import javax.xml.parsers.*;
017:        import org.xml.sax.*;
018:        import org.xml.sax.helpers.*;
019:        import org.w3c.dom.*;
020:
021:        import javax.xml.transform.*;
022:        import javax.xml.transform.dom.*;
023:        import javax.xml.transform.stream.*;
024:
025:        /**
026:         * This is 
027:         *
028:         * @see 
029:         *
030:         * @author Henrik Falk
031:         * @version $Id: JavaProductPersister.java,v 1.1 2001/09/28 19:41:42 hfalk Exp $
032:         */
033:        public class JavaProductPersister implements  ProductPersisterInterface {
034:
035:            VAIProductModel model = null;
036:
037:            public JavaProductPersister() {
038:                super ();
039:            }
040:
041:            public void initialize(VAIProductModel model) {
042:                this .model = model;
043:            }
044:
045:            public void load() throws VAIBuilderException {
046:
047:                // check if we are initialized
048:                if (model == null) {
049:                    throw new VAIBuilderException(VAGlobals.getResource(
050:                            "com.memoire.vainstall.builder.Language",
051:                            "JavaProductPersister_Load"), VAGlobals
052:                            .getResource(
053:                                    "com.memoire.vainstall.builder.Language",
054:                                    "JavaProductPersister_NotInit"), VAGlobals
055:                            .getResource(
056:                                    "com.memoire.vainstall.builder.Language",
057:                                    "JavaProductPersister_ProgramError")
058:                            + VAGlobals.getResource(
059:                                    "com.memoire.vainstall.builder.Language",
060:                                    "JavaProductPersister_PleaseReport"));
061:                }
062:
063:                // Check if vaibuilder.xml exists
064:                String project_file = model.getProductDirectory()
065:                        + File.separator + "vainstall.xml";
066:                if (new File(project_file).exists() == false) {
067:                    throw new VAIBuilderException(VAGlobals.getResource(
068:                            "com.memoire.vainstall.builder.Language",
069:                            "JavaProductPersister_Load"), VAGlobals
070:                            .getResource(
071:                                    "com.memoire.vainstall.builder.Language",
072:                                    "JavaProductPersister_NotFound"), VAGlobals
073:                            .getResource(
074:                                    "com.memoire.vainstall.builder.Language",
075:                                    "JavaProductPersister_MaybeError")
076:                            + VAGlobals.getResource(
077:                                    "com.memoire.vainstall.builder.Language",
078:                                    "JavaProductPersister_PleaseReport"));
079:                }
080:
081:                Document doc = null;
082:                try {
083:                    doc = XmlUtil.parse(project_file, null);
084:                } catch (XmlParseException exc) {
085:                    throw new VAIBuilderException(VAGlobals.getResource(
086:                            "com.memoire.vainstall.builder.Language",
087:                            "JavaProductPersister_Load"), VAGlobals
088:                            .getResource(
089:                                    "com.memoire.vainstall.builder.Language",
090:                                    "JavaProductPersister_NotParse"), VAGlobals
091:                            .getResource(
092:                                    "com.memoire.vainstall.builder.Language",
093:                                    "JavaProductPersister_MaybeError")
094:                            + VAGlobals.getResource(
095:                                    "com.memoire.vainstall.builder.Language",
096:                                    "JavaProductPersister_PleaseReport"));
097:                }
098:
099:                importData(doc);
100:            }
101:
102:            public void save() throws VAIBuilderException {
103:
104:                // check if we are initialized
105:                if (model == null) {
106:                    return;
107:                }
108:
109:                Document doc = null;
110:                try {
111:                    DocumentBuilder builder = DocumentBuilderFactory
112:                            .newInstance().newDocumentBuilder();
113:                    doc = builder.newDocument();
114:
115:                } catch (ParserConfigurationException exc) {
116:                    return;
117:                }
118:
119:                exportData(doc);
120:
121:                Transformer transformer = null;
122:                try {
123:                    transformer = TransformerFactory.newInstance()
124:                            .newTransformer();
125:                    transformer.setOutputProperty("indent", "yes");
126:                } catch (TransformerConfigurationException exc) {
127:                    exc.printStackTrace();
128:                    return;
129:                }
130:
131:                String project_file = model.getProductDirectory()
132:                        + File.separator + "vainstall.xml";
133:                try {
134:                    transformer.transform(new DOMSource(doc), new StreamResult(
135:                            new File(project_file)));
136:                } catch (TransformerException exc) {
137:                    exc.printStackTrace();
138:                }
139:            }
140:
141:            private void importData(Document doc) throws VAIBuilderException {
142:
143:                NodeList nodelist;
144:
145:                Element rootElement = doc.getDocumentElement();
146:
147:                // get properties
148:                nodelist = rootElement.getElementsByTagName("property");
149:                for (int i = 0; i < nodelist.getLength(); i++) {
150:                    Node propertyNode = (Node) nodelist.item(i);
151:
152:                    NamedNodeMap map = propertyNode.getAttributes();
153:
154:                    String name = XmlUtil.getAttribute(map, "name");
155:
156:                    if (name.equals("vainstall.product.name") == true) {
157:                        model
158:                                .setProductName(XmlUtil.getAttribute(map,
159:                                        "value"));
160:                    }
161:
162:                    if (name.equals("vainstall.product.version") == true) {
163:                        model.setProductVersion(XmlUtil.getAttribute(map,
164:                                "value"));
165:                    }
166:
167:                    if (name.equals("vainstall.product.type") == true) {
168:                        model
169:                                .setProductType(XmlUtil.getAttribute(map,
170:                                        "value"));
171:                    }
172:
173:                    if (name.equals("vainstall.archiver.package.name") == true) {
174:                        model
175:                                .setPackageName(XmlUtil.getAttribute(map,
176:                                        "value"));
177:                    }
178:
179:                    if (name.equals("vainstall.archiver.license.name") == true) {
180:                        model
181:                                .setLicenseName(XmlUtil.getAttribute(map,
182:                                        "value"));
183:                    }
184:
185:                    if (name.equals("vainstall.archiver.license.encoding") == true) {
186:                        model.setLicenseEncoding(XmlUtil.getAttribute(map,
187:                                "value"));
188:                    }
189:
190:                    if (name.equals("vainstall.archiver.readme.name") == true) {
191:                        model.setReadmeName(XmlUtil.getAttribute(map, "value"));
192:                    }
193:
194:                    if (name.equals("vainstall.archiver.readme.encoding") == true) {
195:                        model.setReadmeEncoding(XmlUtil.getAttribute(map,
196:                                "value"));
197:                    }
198:
199:                    if (name.equals("vainstall.installer.ui.bluescreen") == true) {
200:                        model.putProperty(name, XmlUtil.getAttribute(map,
201:                                "value"));
202:                    }
203:
204:                    if (name.equals("vainstall.installer.ui.bluescreen.colour") == true) {
205:                        model.putProperty(name, XmlUtil.getAttribute(map,
206:                                "value"));
207:                    }
208:
209:                    if (name.equals("vainstall.installer.ui.mode") == true) {
210:                        model.putProperty(name, XmlUtil.getAttribute(map,
211:                                "value"));
212:                    }
213:
214:                    if (name.equals("vainstall.installer.ui.banner") == true) {
215:                        model.putProperty(name, XmlUtil.getAttribute(map,
216:                                "value"));
217:                    }
218:
219:                    if (name.equals("vainstall.user.dir") == true) {
220:                        model.putProperty(name, XmlUtil.getAttribute(map,
221:                                "value"));
222:                    }
223:
224:                    if (name.equals("vainstall.installer.link.section.name") == true) {
225:                        model.putProperty(name, XmlUtil.getAttribute(map,
226:                                "value"));
227:                    }
228:
229:                    if (name.equals("vainstall.installer.link.section.icon") == true) {
230:                        model.putProperty(name, XmlUtil.getAttribute(map,
231:                                "value"));
232:                    }
233:
234:                    if (name.equals("vainstall.installer.link.entry.name") == true) {
235:                        model.putProperty(name, XmlUtil.getAttribute(map,
236:                                "value"));
237:                    }
238:
239:                    if (name.equals("vainstall.installer.link.entry.icon") == true) {
240:                        model.putProperty(name, XmlUtil.getAttribute(map,
241:                                "value"));
242:                    }
243:
244:                    if (name.equals("vainstall.installer.default.directory") == true) {
245:                        model.putProperty(name, XmlUtil.getAttribute(map,
246:                                "value"));
247:                    }
248:
249:                }
250:
251:                // get steps
252:                nodelist = rootElement.getElementsByTagName("steps");
253:                for (int i = 0; i < nodelist.getLength(); i++) {
254:                    Node stepsNode = (Node) nodelist.item(i);
255:
256:                    NamedNodeMap map = stepsNode.getAttributes();
257:
258:                    String type = XmlUtil.getAttribute(map, "type");
259:
260:                    if (type.equals("uninstall") == false) {
261:                        // get steps
262:                        NodeList steplist = ((Element) stepsNode)
263:                                .getElementsByTagName("step");
264:                        for (int j = 0; j < steplist.getLength(); j++) {
265:                            Node stepNode = (Node) steplist.item(j);
266:
267:                            NamedNodeMap stepMap = stepNode.getAttributes();
268:
269:                            String stepType = XmlUtil.getAttribute(stepMap,
270:                                    "type");
271:                            model.getStepsList().add(stepType);
272:
273:                            // evaluate if required steps are added
274:                            // in a stupid right now :-)
275:                            if (stepType.equals("license") == true) {
276:                                model.removeRequirement("Required Steps");
277:                            }
278:                        }
279:                    } else {
280:                        // uninstall steps hardcoded right now
281:                    }
282:                }
283:
284:                // get targets
285:                nodelist = rootElement.getElementsByTagName("targets");
286:                for (int i = 0; i < nodelist.getLength(); i++) {
287:                    Node targetsNode = (Node) nodelist.item(i);
288:
289:                    NodeList targetlist = rootElement
290:                            .getElementsByTagName("target");
291:                    for (int j = 0; i < targetlist.getLength(); i++) {
292:                        Node targetNode = (Node) targetlist.item(i);
293:
294:                        NamedNodeMap targetMap = targetNode.getAttributes();
295:                        String targetType = XmlUtil.getAttribute(targetMap,
296:                                "type");
297:                        if (targetType.equals("jar") == true) {
298:                            String signerAliasType = XmlUtil.getAttribute(
299:                                    targetMap, "signeralias");
300:                            if (signerAliasType != null) {
301:                                model
302:                                        .getPropertyList()
303:                                        .put(
304:                                                "vainstall.archiver.target.jar.signer.alias",
305:                                                signerAliasType);
306:                            }
307:                            String signerPassphraseType = XmlUtil.getAttribute(
308:                                    targetMap, "signerpassphrase");
309:                            if (signerPassphraseType != null) {
310:                                model
311:                                        .getPropertyList()
312:                                        .put(
313:                                                "vainstall.archiver.target.jar.signer.passphrase",
314:                                                signerPassphraseType);
315:                            }
316:                        }
317:                        if (targetType.equals("jnlp") == true) {
318:                            String codebaseType = XmlUtil.getAttribute(
319:                                    targetMap, "codebase");
320:                            if (codebaseType != null) {
321:                                model
322:                                        .getPropertyList()
323:                                        .put(
324:                                                "vainstall.archiver.target.jnlp.codebase",
325:                                                codebaseType);
326:                            }
327:                            String homepageType = XmlUtil.getAttribute(
328:                                    targetMap, "homepage");
329:                            if (homepageType != null) {
330:                                model
331:                                        .getPropertyList()
332:                                        .put(
333:                                                "vainstall.archiver.target.jnlp.homepage",
334:                                                homepageType);
335:                            }
336:                            String vendorType = XmlUtil.getAttribute(targetMap,
337:                                    "vendor");
338:                            if (vendorType != null) {
339:                                model
340:                                        .getPropertyList()
341:                                        .put(
342:                                                "vainstall.archiver.target.jnlp.vendor",
343:                                                vendorType);
344:                            }
345:                        }
346:                        model.addTarget(targetType);
347:                    }
348:                }
349:
350:                // get languages
351:                nodelist = rootElement.getElementsByTagName("language");
352:                for (int i = 0; i < nodelist.getLength(); i++) {
353:                    Node languageNode = (Node) nodelist.item(i);
354:
355:                    if (languageNode.hasChildNodes() == true) {
356:                        Node language = languageNode.getFirstChild();
357:                        if (language.getNodeType() == Node.TEXT_NODE) {
358:                            // should be verified !
359:                            model.addLanguage(language.getNodeValue());
360:                        }
361:                    }
362:                }
363:
364:            }
365:
366:            private void exportData(Document doc) throws VAIBuilderException {
367:
368:                // create root element
369:                Element root = doc.createElement("vainstall");
370:                root.setAttribute("version", "1.0");
371:                doc.appendChild(root);
372:
373:                // create <property> elements
374:
375:                Element projectNameElement = doc.createElement("property");
376:                projectNameElement.setAttribute("name",
377:                        "vainstall.product.name");
378:                projectNameElement
379:                        .setAttribute("value", model.getProductName());
380:                root.appendChild(projectNameElement);
381:
382:                Element projectVersionElement = doc.createElement("property");
383:                projectVersionElement.setAttribute("name",
384:                        "vainstall.product.version");
385:                projectVersionElement.setAttribute("value", model
386:                        .getProductVersion());
387:                root.appendChild(projectVersionElement);
388:
389:                if (model.getProductType() != null) {
390:                    Element projectTypeElement = doc.createElement("property");
391:                    projectTypeElement.setAttribute("name",
392:                            "vainstall.product.type");
393:                    projectTypeElement.setAttribute("value", model
394:                            .getProductType());
395:                    root.appendChild(projectTypeElement);
396:                }
397:
398:                if (model.getPackageName() != null) {
399:                    Element packageNameElement = doc.createElement("property");
400:                    packageNameElement.setAttribute("name",
401:                            "vainstall.archiver.package.name");
402:                    packageNameElement.setAttribute("value", model
403:                            .getPackageName());
404:                    root.appendChild(packageNameElement);
405:                }
406:
407:                if (model.getLicenseName() != null) {
408:                    Element licenseNameElement = doc.createElement("property");
409:                    licenseNameElement.setAttribute("name",
410:                            "vainstall.archiver.license.name");
411:                    licenseNameElement.setAttribute("value", model
412:                            .getLicenseName());
413:                    root.appendChild(licenseNameElement);
414:                }
415:
416:                if (model.getLicenseEncoding() != null) {
417:                    Element licenseEncodingElement = doc
418:                            .createElement("property");
419:                    licenseEncodingElement.setAttribute("name",
420:                            "vainstall.archiver.license.encoding");
421:                    licenseEncodingElement.setAttribute("value", model
422:                            .getLicenseEncoding());
423:                    root.appendChild(licenseEncodingElement);
424:                }
425:
426:                if (model.getReadmeName() != null) {
427:                    Element readmeNameElement = doc.createElement("property");
428:                    readmeNameElement.setAttribute("name",
429:                            "vainstall.archiver.readme.name");
430:                    readmeNameElement.setAttribute("value", model
431:                            .getReadmeName());
432:                    root.appendChild(readmeNameElement);
433:                }
434:
435:                if (model.getReadmeEncoding() != null) {
436:                    Element readmeEncodingElement = doc
437:                            .createElement("property");
438:                    readmeEncodingElement.setAttribute("name",
439:                            "vainstall.archiver.readme.encoding");
440:                    readmeEncodingElement.setAttribute("value", model
441:                            .getReadmeEncoding());
442:                    root.appendChild(readmeEncodingElement);
443:                }
444:
445:                // create other <property> elements
446:                if (model.getProperty("vainstall.installer.ui.bluescreen") != null) {
447:                    Element blueScreenElement = doc.createElement("property");
448:                    blueScreenElement.setAttribute("name",
449:                            "vainstall.installer.ui.bluescreen");
450:                    blueScreenElement.setAttribute("value", model
451:                            .getProperty("vainstall.installer.ui.bluescreen"));
452:                    root.appendChild(blueScreenElement);
453:                }
454:
455:                if (model
456:                        .getProperty("vainstall.installer.ui.bluescreen.colour") != null) {
457:                    Element blueScreenColorElement = doc
458:                            .createElement("property");
459:                    blueScreenColorElement.setAttribute("name",
460:                            "vainstall.installer.ui.bluescreen.colour");
461:                    blueScreenColorElement
462:                            .setAttribute(
463:                                    "value",
464:                                    model
465:                                            .getProperty("vainstall.installer.ui.bluescreen.colour"));
466:                    root.appendChild(blueScreenColorElement);
467:                }
468:
469:                if (model.getProperty("vainstall.installer.ui.mode") != null) {
470:                    Element uiModeElement = doc.createElement("property");
471:                    uiModeElement.setAttribute("name",
472:                            "vainstall.installer.ui.mode");
473:                    uiModeElement.setAttribute("value", model
474:                            .getProperty("vainstall.installer.ui.mode"));
475:                    root.appendChild(uiModeElement);
476:                }
477:
478:                if (model.getProperty("vainstall.installer.ui.banner") != null) {
479:                    Element uiBannerElement = doc.createElement("property");
480:                    uiBannerElement.setAttribute("name",
481:                            "vainstall.installer.ui.banner");
482:                    uiBannerElement.setAttribute("value", model
483:                            .getProperty("vainstall.installer.ui.banner"));
484:                    root.appendChild(uiBannerElement);
485:                }
486:
487:                if (model.getProperty("vainstall.installer.link.section.name") != null) {
488:                    Element sectionNameElement = doc.createElement("property");
489:                    sectionNameElement.setAttribute("name",
490:                            "vainstall.installer.link.section.name");
491:                    sectionNameElement
492:                            .setAttribute(
493:                                    "value",
494:                                    model
495:                                            .getProperty("vainstall.installer.link.section.name"));
496:                    root.appendChild(sectionNameElement);
497:                }
498:
499:                if (model.getProperty("vainstall.installer.link.section.icon") != null) {
500:                    Element sectionIconElement = doc.createElement("property");
501:                    sectionIconElement.setAttribute("name",
502:                            "vainstall.installer.link.section.icon");
503:                    sectionIconElement
504:                            .setAttribute(
505:                                    "value",
506:                                    model
507:                                            .getProperty("vainstall.installer.link.section.icon"));
508:                    root.appendChild(sectionIconElement);
509:                }
510:
511:                if (model.getProperty("vainstall.installer.link.entry.name") != null) {
512:                    Element entryNameElement = doc.createElement("property");
513:                    entryNameElement.setAttribute("name",
514:                            "vainstall.installer.link.entry.name");
515:                    entryNameElement
516:                            .setAttribute(
517:                                    "value",
518:                                    model
519:                                            .getProperty("vainstall.installer.link.entry.name"));
520:                    root.appendChild(entryNameElement);
521:                }
522:
523:                if (model.getProperty("vainstall.installer.link.entry.icon") != null) {
524:                    Element entryIconElement = doc.createElement("property");
525:                    entryIconElement.setAttribute("name",
526:                            "vainstall.installer.link.entry.icon");
527:                    entryIconElement
528:                            .setAttribute(
529:                                    "value",
530:                                    model
531:                                            .getProperty("vainstall.installer.link.entry.icon"));
532:                    root.appendChild(entryIconElement);
533:                }
534:
535:                if (model.getProperty("vainstall.installer.default.directory") != null) {
536:                    Element defaultDirectoryElement = doc
537:                            .createElement("property");
538:                    defaultDirectoryElement.setAttribute("name",
539:                            "vainstall.installer.default.directory");
540:                    defaultDirectoryElement
541:                            .setAttribute(
542:                                    "value",
543:                                    model
544:                                            .getProperty("vainstall.installer.default.directory"));
545:                    root.appendChild(defaultDirectoryElement);
546:                }
547:
548:                // create special <property> elements
549:                if (model.getProperty("vainstall.user.dir") != null) {
550:                    Element uiBannerElement = doc.createElement("property");
551:                    uiBannerElement.setAttribute("name", "vainstall.user.dir");
552:                    uiBannerElement.setAttribute("value", model
553:                            .getProperty("vainstall.user.dir"));
554:                    root.appendChild(uiBannerElement);
555:                }
556:
557:                // create steps block
558:                if (model.getProductType() != null) {
559:                    Element stepsElement = doc.createElement("steps");
560:                    stepsElement.setAttribute("type", model.getProductType());
561:                    root.appendChild(stepsElement);
562:
563:                    // create <step> elements
564:                    ListIterator iterator = model.getStepsList().listIterator();
565:                    while (iterator.hasNext() == true) {
566:                        String type = (String) iterator.next();
567:
568:                        Element stepElement = doc.createElement("step");
569:                        stepElement.setAttribute("type", type);
570:                        stepsElement.appendChild(stepElement);
571:                    }
572:                }
573:
574:                // create <targets> elements
575:                Element targetsElement = doc.createElement("targets");
576:                root.appendChild(targetsElement);
577:
578:                // create <target> elements
579:                ListIterator targetIterator = model.getTargetList()
580:                        .listIterator();
581:                while (targetIterator.hasNext() == true) {
582:                    String type = (String) targetIterator.next();
583:
584:                    Element targetElement = doc.createElement("target");
585:                    targetElement.setAttribute("type", type);
586:                    if (type.equals("jar") == true) {
587:                        if (model.getPropertyList().get(
588:                                "vainstall.archiver.target.jar.signer.alias") != null
589:                                && model
590:                                        .getPropertyList()
591:                                        .get(
592:                                                "vainstall.archiver.target.jar.signer.passphrase") != null) {
593:                            targetElement
594:                                    .setAttribute(
595:                                            "signeralias",
596:                                            (String) model
597:                                                    .getProperty("vainstall.archiver.target.jar.signer.alias"));
598:                            targetElement
599:                                    .setAttribute(
600:                                            "signerpassphrase",
601:                                            (String) model
602:                                                    .getProperty("vainstall.archiver.target.jar.signer.passphrase"));
603:                        }
604:                    }
605:                    if (type.equals("jnlp") == true) {
606:                        if (model.getPropertyList().get(
607:                                "vainstall.archiver.target.jnlp.codebase") != null
608:                                && model
609:                                        .getPropertyList()
610:                                        .get(
611:                                                "vainstall.archiver.target.jnlp.homepage") != null
612:                                && model
613:                                        .getPropertyList()
614:                                        .get(
615:                                                "vainstall.archiver.target.jnlp.vendor") != null) {
616:                            targetElement
617:                                    .setAttribute(
618:                                            "codebase",
619:                                            (String) model
620:                                                    .getProperty("vainstall.archiver.target.jnlp.codebase"));
621:                            targetElement
622:                                    .setAttribute(
623:                                            "homepage",
624:                                            (String) model
625:                                                    .getProperty("vainstall.archiver.target.jnlp.homepage"));
626:                            targetElement
627:                                    .setAttribute(
628:                                            "vendor",
629:                                            (String) model
630:                                                    .getProperty("vainstall.archiver.target.jnlp.vendor"));
631:                        }
632:                    }
633:                    targetsElement.appendChild(targetElement);
634:                }
635:
636:                // create <language> elements
637:                ListIterator iterator = model.getLanguageList().listIterator();
638:                while (iterator.hasNext() == true) {
639:                    String language = (String) iterator.next();
640:
641:                    Element languageElement = doc.createElement("language");
642:                    Node languageNode = doc.createTextNode(language);
643:                    languageElement.appendChild(languageNode);
644:                    root.appendChild(languageElement);
645:                }
646:
647:            }
648:
649:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.