001: /*
002: * JFolder, Copyright 2001-2006 Gary Steinmetz
003: *
004: * Distributable under LGPL license.
005: * See terms of license at gnu.org.
006: */
007:
008: package org.jfolder.project.model.v1;
009:
010: //base classes
011: import java.io.ByteArrayInputStream;
012: import java.io.InputStream;
013: import java.util.ArrayList;
014: import java.util.HashMap;
015: import java.util.HashSet;
016: import java.util.Iterator;
017:
018: //project specific classes
019: import org.jfolder.common.UnexpectedSystemException;
020: import org.jfolder.common.entity.InitializeSystemEntityTagContext;
021: import org.jfolder.common.entity.SystemEntity;
022: import org.jfolder.common.entity.SystemEntityUpdates;
023: import org.jfolder.common.entity.SystemEntityUpdatesContext;
024: import org.jfolder.common.entity.properties.SystemEntityProperties;
025: import org.jfolder.common.entity.properties.SystemEntityPropertiesUpdates;
026: import org.jfolder.common.entity.properties.v1.SystemEntityPropertiesTag;
027: import org.jfolder.common.files.VirtualFileSystemHolder;
028: import org.jfolder.common.files.VirtualFileSystemRoot;
029: import org.jfolder.common.tagging.AppraiseConceptTagContext;
030: import org.jfolder.common.tagging.ConceptTag;
031: import org.jfolder.common.tagging.ConceptTagCharacteristic;
032: import org.jfolder.common.tagging.ConceptTagCharacteristicHolder;
033: import org.jfolder.common.tagging.ConceptTagConstraint;
034: import org.jfolder.common.tagging.ConceptTagConstraintHolder;
035: import org.jfolder.common.tagging.ConceptTagPreferences;
036: import org.jfolder.common.tagging.DynamicConceptTagConstraintContext;
037: import org.jfolder.common.tagging.InitializeConceptTagContext;
038: import org.jfolder.common.tagging.RootConceptTagHolder;
039: import org.jfolder.common.tagging.StaticConceptTagConstraintContext;
040: import org.jfolder.common.tagging.StudioConceptTagInstanceInfoContext;
041: import org.jfolder.common.tagging.StudioConceptTagTypeInfoContext;
042: import org.jfolder.dms.model.DocumentFileSystemDirectory;
043: import org.jfolder.dms.model.DocumentFileSystemDirectoryUpdates;
044: import org.jfolder.dms.model.DocumentFileSystemRoot;
045: import org.jfolder.dms.model.DocumentFileSystemRootUpdates;
046: import org.jfolder.dms.model.v1.DocumentFileSystemRootTag;
047: import org.jfolder.project.model.ProjectSystem;
048: import org.jfolder.project.model.ProjectSystemUpdates;
049: import org.jfolder.security.audit.SecurityAudit;
050: import org.jfolder.security.model.UserIdentity;
051: import org.jfolder.security.model.v1.UserIdentityTag;
052: import org.jfolder.workflow.model.template.WorkflowTemplate;
053:
054: //other classes
055:
056: public class ProjectSystemUpdatesTag implements ProjectSystemUpdates {
057:
058: //
059: private ConceptTagCharacteristic propertyUpdatesCtchar = null;
060: private ConceptTagCharacteristic webDocUpdatesCtchar = null;
061: //
062: private ConceptTagCharacteristic versionCtchar = null;
063: private ConceptTagCharacteristic nameCtchar = null;
064: private ConceptTagCharacteristic deployVisibleCtchar = null;
065: private ConceptTagCharacteristic auditCtchar = null;
066: private ConceptTagCharacteristic userCtchar = null;
067: private ConceptTagCharacteristic deployedCtchar = null;
068: private ConceptTagCharacteristic activeCtchar = null;
069:
070: //
071: //version details
072: private final static String VERSION_CTCON = "version";
073: private final static String VERSION_TITLE = "Version";
074: private final static String VERSION_SHORT_DESCRIPTION = "Version";
075:
076: //user details
077: private final static String USER_CTCON = "user";
078: private final static String USER_TITLE = "User";
079: private final static String USER_SHORT_DESCRIPTION = "User";
080:
081: //name details
082: private final static String NAME_CTCON = "name";
083: private final static String NAME_TITLE = "Name";
084: private final static String NAME_SHORT_DESCRIPTION = "Name";
085:
086: //deploy-visible details
087: private final static String DEPLOY_VISIBLE_CTCON = "deploy-visible";
088: private final static String DEPLOY_VISIBLE_TITLE = "Deploy Visible";
089: private final static String DEPLOY_VISIBLE_SHORT_DESCRIPTION = "Deploy Visible";
090:
091: //property-updates details
092: private final static String PROPERTY_UPDATES_CTCON = "property-updates";
093: private final static String PROPERTY_UPDATES_TITLE = "Property Updates";
094: private final static String PROPERTY_UPDATES_SHORT_DESCRIPTION = "Property Updates";
095:
096: //web-doc-updates details
097: private final static String WEB_DOC_UPDATES_CTCON = "web-doc-updates";
098: private final static String WEB_DOC_UPDATES_TITLE = "Web Documents Updates";
099: private final static String WEB_DOC_UPDATES_SHORT_DESCRIPTION = "Web Documents Updates";
100:
101: //audit details
102: private final static String AUDIT_CTCON = "audit";
103: private final static String AUDIT_TITLE = "Audit";
104: private final static String AUDIT_SHORT_DESCRIPTION = "Audit";
105:
106: //deployed details
107: private final static String DEPLOYED_CTCON = "deployed";
108: private final static String DEPLOYED_TITLE = "Deployed";
109: private final static String DEPLOYED_SHORT_DESCRIPTION = "Deployed";
110:
111: //active details
112: private final static String ACTIVE_CTCON = "active";
113: private final static String ACTIVE_TITLE = "Active";
114: private final static String ACTIVE_SHORT_DESCRIPTION = "Active";
115:
116: //
117: public ProjectSystemUpdatesTag() {
118: }
119:
120: //
121: public final static ProjectSystemUpdatesTag newInstance(
122: ConceptTagCharacteristic inCtchar, int inIndex,
123: UserIdentity inUi, String inName, boolean inDeployVisible,
124: int inVersion, boolean inDeployed, boolean inActive) {
125:
126: ProjectSystemUpdatesTag outValue = new ProjectSystemUpdatesTag();
127:
128: //
129: ConceptTagCharacteristicHolder ctcharh = inCtchar.addValue(
130: inIndex, outValue, true);
131:
132: InitializeSystemEntityTagContext isetc = new InitializeSystemEntityTagContext(
133: ctcharh);
134:
135: outValue.initialize(isetc);
136:
137: //
138: outValue.nameCtchar.addValue(0, inName);
139: outValue.deployVisibleCtchar.addValue(0, inDeployVisible + "");
140: outValue.versionCtchar.addValue(0, inVersion + "");
141: outValue.deployedCtchar.addValue(0, inDeployed + "");
142: outValue.activeCtchar.addValue(0, inActive + "");
143: //
144: UserIdentityTag.newInstance(outValue.userCtchar, 0, inUi
145: .getName(), inUi.getSecurityType(), inUi.isValid(),
146: inUi.isAnonymous());
147:
148: return outValue;
149: }
150:
151: //
152: public void initialize(InitializeConceptTagContext inIctc) {
153:
154: //
155: ConceptTagConstraintHolder rootCtconh = ConceptTagConstraintHolder
156: .newInstance(inIctc);
157:
158: //constrain "version"
159: ConceptTagConstraint versionCtcon = ConceptTagConstraint
160: .newInstance(VERSION_CTCON, rootCtconh);
161: //callTypeCtcon.setMinimumLength(1);
162: //callTypeCtcon.setMaximumLength(1);
163: //
164: StaticConceptTagConstraintContext versionSctcc = StaticConceptTagConstraintContext
165: .newInstance(versionCtcon);
166:
167: //constrain "user"
168: ConceptTagConstraint userCtcon = ConceptTagConstraint
169: .newInstance(USER_CTCON, rootCtconh);
170: //callTypeCtcon.setMinimumLength(1);
171: //callTypeCtcon.setMaximumLength(1);
172: //
173: DynamicConceptTagConstraintContext userSctcc = DynamicConceptTagConstraintContext
174: .newInstance(userCtcon);
175:
176: //constrain "name"
177: ConceptTagConstraint nameCtcon = ConceptTagConstraint
178: .newInstance(NAME_CTCON, rootCtconh);
179: //callTypeCtcon.setMinimumLength(1);
180: //callTypeCtcon.setMaximumLength(1);
181: //
182: StaticConceptTagConstraintContext nameSctcc = StaticConceptTagConstraintContext
183: .newInstance(nameCtcon);
184:
185: //constrain "deploy-visible"
186: ConceptTagConstraint deployVisibleCtcon = ConceptTagConstraint
187: .newInstance(DEPLOY_VISIBLE_CTCON, rootCtconh);
188: //callTypeCtcon.setMinimumLength(1);
189: //callTypeCtcon.setMaximumLength(1);
190: //
191: StaticConceptTagConstraintContext deployVisibleSctcc = StaticConceptTagConstraintContext
192: .newInstance(deployVisibleCtcon);
193:
194: //constrain "property-updates"
195: ConceptTagConstraint propertyUpdatesCtcon = ConceptTagConstraint
196: .newInstance(PROPERTY_UPDATES_CTCON, rootCtconh);
197: //callTypeCtcon.setMinimumLength(1);
198: //callTypeCtcon.setMaximumLength(1);
199: //
200: DynamicConceptTagConstraintContext propertyUpdatesSctcc = DynamicConceptTagConstraintContext
201: .newInstance(propertyUpdatesCtcon);
202:
203: //constrain "web-doc-updates"
204: ConceptTagConstraint webDocUpdatesCtcon = ConceptTagConstraint
205: .newInstance(WEB_DOC_UPDATES_CTCON, rootCtconh);
206: //
207: DynamicConceptTagConstraintContext webDocSctcc = DynamicConceptTagConstraintContext
208: .newInstance(webDocUpdatesCtcon);
209:
210: //constrain "audit"
211: ConceptTagConstraint auditCtcon = ConceptTagConstraint
212: .newInstance(AUDIT_CTCON, rootCtconh);
213: //
214: DynamicConceptTagConstraintContext auditSctcc = DynamicConceptTagConstraintContext
215: .newInstance(auditCtcon);
216:
217: //constrain "deployed"
218: ConceptTagConstraint deployedCtcon = ConceptTagConstraint
219: .newInstance(DEPLOYED_CTCON, rootCtconh);
220: //callTypeCtcon.setMinimumLength(1);
221: //callTypeCtcon.setMaximumLength(1);
222: //
223: StaticConceptTagConstraintContext deployedSctcc = StaticConceptTagConstraintContext
224: .newInstance(deployedCtcon);
225:
226: //constrain "active"
227: ConceptTagConstraint activeCtcon = ConceptTagConstraint
228: .newInstance(ACTIVE_CTCON, rootCtconh);
229: //callTypeCtcon.setMinimumLength(1);
230: //callTypeCtcon.setMaximumLength(1);
231: //
232: StaticConceptTagConstraintContext activeSctcc = StaticConceptTagConstraintContext
233: .newInstance(activeCtcon);
234:
235: //
236: inIctc.initialize();
237:
238: //
239: this .propertyUpdatesCtchar = propertyUpdatesCtcon
240: .getCharacteristic();
241: this .webDocUpdatesCtchar = webDocUpdatesCtcon
242: .getCharacteristic();
243: this .versionCtchar = versionCtcon.getCharacteristic();
244: this .nameCtchar = nameCtcon.getCharacteristic();
245: this .deployVisibleCtchar = deployVisibleCtcon
246: .getCharacteristic();
247: this .auditCtchar = auditCtcon.getCharacteristic();
248: this .userCtchar = userCtcon.getCharacteristic();
249: this .deployedCtchar = deployedCtcon.getCharacteristic();
250: this .activeCtchar = activeCtcon.getCharacteristic();
251:
252: //
253: }
254:
255: //
256: public void appraise(AppraiseConceptTagContext inCtic) {
257: if (inCtic instanceof StudioConceptTagInstanceInfoContext) {
258: StudioConceptTagInstanceInfoContext sctiic = (StudioConceptTagInstanceInfoContext) inCtic;
259: sctiic.setInstanceTitle("Project System Updates");
260: sctiic.setInstanceDescription("Project System Updates");
261: } else if (inCtic instanceof StudioConceptTagTypeInfoContext) {
262: StudioConceptTagTypeInfoContext scttic = (StudioConceptTagTypeInfoContext) inCtic;
263: scttic.setTypeTitle("Project System Updates");
264: scttic.setTypeDescription("Project System Updates");
265: }
266: }
267:
268: //
269: public ConceptTagCharacteristic getWebDocUpdatesCtchar() {
270: return this .webDocUpdatesCtchar;
271: }
272:
273: public ConceptTagCharacteristic getPropertyUpdatesCtchar() {
274: return this .propertyUpdatesCtchar;
275: }
276:
277: public ConceptTagCharacteristic getUserCtchar() {
278: return this .userCtchar;
279: }
280:
281: public ConceptTagCharacteristic getAuditCtchar() {
282: return this .auditCtchar;
283: }
284:
285: public UserIdentity getUserIdentity() {
286:
287: UserIdentity outValue = null;
288:
289: if (this .userCtchar.getValueLength() > 0) {
290: outValue = (UserIdentity) this .userCtchar
291: .getValueAsConceptTag(0, null);
292: }
293:
294: return outValue;
295: }
296:
297: public String getName() {
298: return this .nameCtchar.getValueAsString(0, null);
299: }
300:
301: public boolean isDeployVisible() {
302:
303: boolean outValue = false;
304:
305: String value = this .deployVisibleCtchar.getValueAsString(0,
306: null);
307: outValue = (new Boolean(value)).booleanValue();
308:
309: return outValue;
310: }
311:
312: public int getVersion() {
313:
314: int outValue = 0;
315:
316: String value = this .versionCtchar.getValueAsString(0, null);
317: outValue = Integer.parseInt(value);
318:
319: return outValue;
320: }
321:
322: public boolean isDeployed() {
323:
324: boolean outValue = false;
325:
326: String value = this .deployedCtchar.getValueAsString(0, null);
327: outValue = (new Boolean(value)).booleanValue();
328:
329: return outValue;
330: }
331:
332: public boolean isActive() {
333:
334: boolean outValue = false;
335:
336: String value = this .activeCtchar.getValueAsString(0, null);
337: outValue = (new Boolean(value)).booleanValue();
338:
339: return outValue;
340: }
341:
342: public SecurityAudit getSecurityAudit() {
343:
344: SecurityAudit outValue = null;
345:
346: Object o = this .auditCtchar.getValueAsConceptTag(0, null);
347: outValue = (SecurityAudit) o;
348:
349: return outValue;
350: }
351:
352: public SystemEntityPropertiesUpdates getPropertyUpdates() {
353:
354: SystemEntityPropertiesUpdates outValue = null;
355:
356: Object o = this .propertyUpdatesCtchar.getValueAsConceptTag(0,
357: null);
358: outValue = (SystemEntityPropertiesUpdates) o;
359:
360: return outValue;
361: }
362:
363: public DocumentFileSystemRootUpdates getWebDocUpdates() {
364:
365: DocumentFileSystemRootUpdates outValue = null;
366:
367: Object o = this .webDocUpdatesCtchar.getValueAsConceptTag(0,
368: null);
369: outValue = (DocumentFileSystemRootUpdates) o;
370:
371: return outValue;
372: }
373:
374: //descriptive functions
375: //public String getName() {
376: // throw UnexpectedSystemException.notImplemented();
377: //}
378: public void setName(String inName) {
379: throw UnexpectedSystemException.notImplemented();
380: }
381:
382: //public SecurityAudit getSecurityAudit() {
383: // throw UnexpectedSystemException.notImplemented();
384: //}
385: public void setSecurityAudit(SecurityAudit inSa) {
386: throw UnexpectedSystemException.notImplemented();
387: }
388:
389: public String getDescription() {
390: throw UnexpectedSystemException.notImplemented();
391: }
392:
393: public void setDescription(String inDescription) {
394: throw UnexpectedSystemException.notImplemented();
395: }
396:
397: public VirtualFileSystemHolder getDocuments() {
398: throw UnexpectedSystemException.notImplemented();
399: }
400:
401: public void setDocuments(VirtualFileSystemRoot inFsr) {
402: throw UnexpectedSystemException.notImplemented();
403: }
404:
405: public String getLicense() {
406: throw UnexpectedSystemException.notImplemented();
407: }
408:
409: public void setLicense(String inLicense) {
410: throw UnexpectedSystemException.notImplemented();
411: }
412:
413: public void setDeveloperMode(boolean inDeveloper) {
414: throw UnexpectedSystemException.notImplemented();
415: }
416:
417: public void setDeploymentMode(boolean inDeployment) {
418: throw UnexpectedSystemException.notImplemented();
419: }
420:
421: public boolean isDeveloperMode() {
422: throw UnexpectedSystemException.notImplemented();
423: }
424:
425: public boolean isDeploymentMode() {
426: throw UnexpectedSystemException.notImplemented();
427: }
428:
429: //public void setProperties(SystemEntityProperties inProps) {
430: // throw UnexpectedSystemException.notImplemented();
431: //}
432: //public SystemEntityProperties getProperties() {
433: // throw UnexpectedSystemException.notImplemented();
434: //}
435: //version?
436:
437: //calendar functions
438:
439: //workflow functions
440: public WorkflowTemplate getWorkflowTemplate() {
441: throw UnexpectedSystemException.notImplemented();
442: }
443: //public void setWorkflowTemplate(RootConceptTagHolder inRcth) {
444: // throw UnexpectedSystemException.notImplemented();
445: //}
446:
447: //web pages - dual system, including macros and templates
448: //public VirtualFileSystemHolder getWebFiles() {
449: // throw UnexpectedSystemException.notImplemented();
450: //}
451: //public void setWebFiles(VirtualSystemRoot inFsr) {
452: // throw UnexpectedSystemException.notImplemented();
453: //}
454: //public VirtualFileSystemHolder getWebPages() {
455: // throw UnexpectedSystemException.notImplemented();
456: //}
457: //public VirtualFileSystemHolder getWebMacros() {
458: // throw UnexpectedSystemException.notImplemented();
459: //}
460: //public VirtualFileSystemHolder getWebTemplates() {
461: // throw UnexpectedSystemException.notImplemented();
462: //}
463: //public void setWebPages(VirtualSystemRoot inFsr) {
464: // throw UnexpectedSystemException.notImplemented();
465: //}
466:
467: //
468:
469: //properties
470: //public String getPropertyDocument() {
471: // throw UnexpectedSystemException.notImplemented();
472: //}
473: //public void setPropertyDocument(String inDocument) {
474: //}
475: //public String[] getPropertyNames() {
476: // throw UnexpectedSystemException.notImplemented();
477: //}
478: //public String getPropertyValue(String inName) {
479: // throw UnexpectedSystemException.notImplemented();
480: //}
481: //public void createProperty(String inName, String inValue) {
482: // throw UnexpectedSystemException.notImplemented();
483: //}
484: //public void updateProperty(String inName, String inValue) {
485: // throw UnexpectedSystemException.notImplemented();
486: //}
487: //public boolean isPropertyPresent(String inName) {
488: // throw UnexpectedSystemException.notImplemented();
489: //}
490: //public void removeProperty(String inName) {
491: // throw UnexpectedSystemException.notImplemented();
492: //}
493: //
494: //public SystemEntityProperties getPropertiesValues() {
495: // return getProperties(0);
496: //}
497: //public SystemEntityProperties getPropertiesRegExes() {
498: // return getProperties(1);
499: //}
500: //public SystemEntityProperties getPropertiesDescriptions() {
501: // return getProperties(2);
502: //}
503: //public SystemEntityProperties getPropertiesErrorMessages() {
504: // return getProperties(3);
505: //}
506: //private SystemEntityProperties getProperties(int inIndex) {
507: //
508: // SystemEntityProperties outValue = null;
509: //
510: // Object o = this.propertyCtchar.getValueAsConceptTag(inIndex);
511: // outValue = (SystemEntityProperties)o;
512: //
513: // return outValue;
514: //}
515: //
516:
517: //command line
518:
519: //data types
520:
521: //common functions
522:
523: }
|