01: /*
02: * JFolder, Copyright 2001-2006 Gary Steinmetz
03: *
04: * Distributable under LGPL license.
05: * See terms of license at gnu.org.
06: */
07:
08: package org.jfolder.project.model;
09:
10: //base classes
11:
12: //project specific classes
13: import org.jfolder.common.entity.SystemEntity;
14: import org.jfolder.common.entity.properties.SystemEntityPropertiesHelper;
15: import org.jfolder.common.files.BaseVirtualFileSystemHolder;
16:
17: //other classes
18:
19: public class ProjectSystemHelper {
20:
21: private ProjectSystemHelper() {
22: }
23:
24: public final static void copyTo(ProjectSystem inSource,
25: ProjectSystem inDest) {
26:
27: //
28: //for (int i = (inDest.getPropertyCount() - 1); i >= 0; i--) {
29: // String nextPropName = inDest.getPropertyName(i);
30: // inDest.removeProperty(nextPropName);
31: //}
32: //
33: //for (int i = 0; i < inSource.getPropertyCount(); i++) {
34: // String nextPropName = inSource.getPropertyName(i);
35: // String nextPropValue = inSource.getPropertyValue(i);
36: // inDest.createProperty(nextPropName, nextPropValue);
37: //}
38: //
39: //inDest.setDocument(inSource.getDocument());
40:
41: //
42: inDest.resetToDefault();
43: //
44: inDest.setDescription(inSource.getDescription());
45: //inDest.setLicense(inSource.getLicense());
46: //
47: BaseVirtualFileSystemHolder.copyDirectory(
48: inSource.getWebDocs(), inDest.getWebDocs());
49: BaseVirtualFileSystemHolder.copyDirectory(inSource
50: .getWebDocsProperties(), inDest.getWebDocsProperties());
51: //
52: SystemEntityPropertiesHelper.copyTo(inSource
53: .getUserPropertiesValues(), inDest
54: .getUserPropertiesValues());
55: SystemEntityPropertiesHelper.copyTo(inSource
56: .getUserPropertiesRegExes(), inDest
57: .getUserPropertiesRegExes());
58: SystemEntityPropertiesHelper.copyTo(inSource
59: .getUserPropertiesDescriptions(), inDest
60: .getUserPropertiesDescriptions());
61: SystemEntityPropertiesHelper.copyTo(inSource
62: .getUserPropertiesErrorMessages(), inDest
63: .getUserPropertiesErrorMessages());
64: //
65: SystemEntityPropertiesHelper.copyTo(inSource
66: .getServerPropertiesValues(), inDest
67: .getServerPropertiesValues());
68: SystemEntityPropertiesHelper.copyTo(inSource
69: .getServerPropertiesRegExes(), inDest
70: .getServerPropertiesRegExes());
71: SystemEntityPropertiesHelper.copyTo(inSource
72: .getServerPropertiesDescriptions(), inDest
73: .getServerPropertiesDescriptions());
74: SystemEntityPropertiesHelper.copyTo(inSource
75: .getServerPropertiesErrorMessages(), inDest
76: .getServerPropertiesErrorMessages());
77: }
78: }
|