0001: /*
0002: * JFolder, Copyright 2001-2006 Gary Steinmetz
0003: *
0004: * Distributable under LGPL license.
0005: * See terms of license at gnu.org.
0006: */
0007:
0008: package org.jfolder.project.model.v1;
0009:
0010: //base classes
0011: import java.io.ByteArrayInputStream;
0012: import java.io.InputStream;
0013: import java.util.ArrayList;
0014: import java.util.HashMap;
0015: import java.util.HashSet;
0016: import java.util.Iterator;
0017:
0018: //project specific classes
0019: import org.jfolder.common.UnexpectedSystemException;
0020: import org.jfolder.common.entity.InitializeSystemEntityTagContext;
0021: import org.jfolder.common.entity.SystemEntity;
0022: import org.jfolder.common.entity.SystemEntityUpdates;
0023: import org.jfolder.common.entity.SystemEntityUpdatesContext;
0024: import org.jfolder.common.entity.properties.SubSpaceSystemEntityProperties;
0025: import org.jfolder.common.entity.properties.SystemEntityProperties;
0026: import org.jfolder.common.entity.properties.v1.SystemEntityPropertiesTag;
0027: import org.jfolder.common.files.SimpleVirtualFileSystemProperties;
0028: import org.jfolder.common.files.VirtualFileSystemDirectory;
0029: import org.jfolder.common.files.VirtualFileSystemFile;
0030: import org.jfolder.common.files.VirtualFileSystemHolder;
0031: import org.jfolder.common.files.VirtualFileSystemRoot;
0032: import org.jfolder.common.files.WebPageTagMacro;
0033: import org.jfolder.common.files.WebPageTagMacroGroup;
0034: import org.jfolder.common.files.WebPageTagMacroHelper;
0035: import org.jfolder.common.files.WebPageTagMacroSet;
0036: import org.jfolder.common.tagging.AppraiseConceptTagContext;
0037: import org.jfolder.common.tagging.ConceptTag;
0038: import org.jfolder.common.tagging.ConceptTagCharacteristic;
0039: import org.jfolder.common.tagging.ConceptTagCharacteristicHolder;
0040: import org.jfolder.common.tagging.ConceptTagConstraint;
0041: import org.jfolder.common.tagging.ConceptTagConstraintHolder;
0042: import org.jfolder.common.tagging.ConceptTagPreferences;
0043: import org.jfolder.common.tagging.DynamicConceptTagConstraintContext;
0044: import org.jfolder.common.tagging.InitializeConceptTagContext;
0045: import org.jfolder.common.tagging.RootConceptTagHolder;
0046: import org.jfolder.common.tagging.StaticConceptTagConstraintContext;
0047: import org.jfolder.common.tagging.StudioConceptTagInstanceInfoContext;
0048: import org.jfolder.common.tagging.StudioConceptTagTypeInfoContext;
0049: import org.jfolder.common.utils.misc.CommonSeparators;
0050: import org.jfolder.common.utils.misc.MiscHelper;
0051: import org.jfolder.dms.model.DocumentFileSystemDirectory;
0052: import org.jfolder.dms.model.DocumentFileSystemDirectoryUpdates;
0053: import org.jfolder.dms.model.DocumentFileSystemRoot;
0054: import org.jfolder.dms.model.v1.DocumentFileSystemRootTag;
0055: import org.jfolder.project.model.ProjectSystem;
0056: import org.jfolder.project.model.ProjectSystemUpdates;
0057: import org.jfolder.security.audit.SecurityAudit;
0058: import org.jfolder.security.audit.SecurityAuditHelper;
0059: import org.jfolder.security.audit.v1.SecurityAuditTag;
0060: import org.jfolder.security.model.UserIdentity;
0061: import org.jfolder.security.model.v1.UserIdentityTag;
0062: import org.jfolder.workflow.model.template.WorkflowTemplate;
0063:
0064: //other classes
0065:
0066: public class ProjectSystemTag implements ProjectSystem {
0067:
0068: //
0069: private final static String DESCRIPTION_DIR = "DESCRIPTION";
0070: private final static String WORKFLOW_TEMPLATE_DIR = "WORKFLOW_TEMPLATE";
0071: private final static String WEB_DOCS_DIR = "WEB_DOCS";
0072: private final static String WEB_DOCS_PROPERTIES_DIR = "WEB_DOCS_PROPERTIES";
0073: //private final static String WEB_TEMPLATES_DIR = "WEB_TEMPLATES";
0074: //private final static String WEB_MACROS_DIR = "WEB_MACROS";
0075: //private final static String WEB_SERVLETS_DIR = "WEB_SERVLETS";
0076: //
0077: private final static String DESCRIPTION_TXT = "description.txt";
0078: private final static String WORKFLOW_XML = "workflow.xml";
0079:
0080: //
0081: //private final static String WEB_DOC_IS_FILE = "WEB_DOC_IS_FILE";
0082: private final static String WEB_DOC_IS_TEXT = "WEB_DOC_IS_TEXT";
0083: private final static String WEB_DOC_IS_BINARY = "WEB_DOC_IS_BINARY";
0084: private final static String WEB_DOC_IS_PAGE = "WEB_DOC_IS_PAGE";
0085: private final static String WEB_DOC_IS_TEMPLATE = "WEB_DOC_IS_TEMPLATE";
0086: private final static String WEB_DOC_IS_MACRO = "WEB_DOC_IS_MACRO";
0087: //
0088: private final static String WEB_DOC_TYPES[] = { WEB_DOC_IS_TEXT,
0089: WEB_DOC_IS_PAGE, WEB_DOC_IS_TEMPLATE, WEB_DOC_IS_MACRO,
0090: WEB_DOC_IS_BINARY };
0091: //
0092: //
0093: private final static String WEB_DOC_MACRO_GROUP = "WEB_DOC_GROUP_MACRO";
0094:
0095: //
0096: private ConceptTagCharacteristic propertyCtchar = null;
0097: private ConceptTagCharacteristic webDocCtchar = null;
0098: private ConceptTagCharacteristic versionCtchar = null;
0099: private ConceptTagCharacteristic nameCtchar = null;
0100: private ConceptTagCharacteristic deployVisibleCtchar = null;
0101: private ConceptTagCharacteristic auditCtchar = null;
0102: private ConceptTagCharacteristic userCtchar = null;
0103: private ConceptTagCharacteristic deployedCtchar = null;
0104: private ConceptTagCharacteristic activeCtchar = null;
0105:
0106: //
0107: //version details
0108: private final static String VERSION_CTCON = "version";
0109: private final static String VERSION_TITLE = "Version";
0110: private final static String VERSION_SHORT_DESCRIPTION = "Version";
0111:
0112: //user details
0113: private final static String USER_CTCON = "user";
0114: private final static String USER_TITLE = "User";
0115: private final static String USER_SHORT_DESCRIPTION = "User";
0116:
0117: //name details
0118: private final static String NAME_CTCON = "name";
0119: private final static String NAME_TITLE = "Name";
0120: private final static String NAME_SHORT_DESCRIPTION = "Name";
0121:
0122: //deploy-visible details
0123: private final static String DEPLOY_VISIBLE_CTCON = "deploy-visible";
0124: private final static String DEPLOY_VISIBLE_TITLE = "Deploy Visible";
0125: private final static String DEPLOY_VISIBLE_SHORT_DESCRIPTION = "Deploy Visible";
0126:
0127: //property details
0128: private final static String PROPERTY_CTCON = "property";
0129: private final static String PROPERTY_TITLE = "Property";
0130: private final static String PROPERTY_SHORT_DESCRIPTION = "Property";
0131:
0132: //web-doc details
0133: private final static String WEB_DOC_CTCON = "web-doc";
0134: private final static String WEB_DOC_TITLE = "Web Documents";
0135: private final static String WEB_DOC_SHORT_DESCRIPTION = "Web Documents";
0136:
0137: //audit details
0138: private final static String AUDIT_CTCON = "audit";
0139: private final static String AUDIT_TITLE = "Audit";
0140: private final static String AUDIT_SHORT_DESCRIPTION = "Audit";
0141:
0142: //deployed details
0143: private final static String DEPLOYED_CTCON = "deployed";
0144: private final static String DEPLOYED_TITLE = "Deployed";
0145: private final static String DEPLOYED_SHORT_DESCRIPTION = "Deployed";
0146:
0147: //active details
0148: private final static String ACTIVE_CTCON = "active";
0149: private final static String ACTIVE_TITLE = "Active";
0150: private final static String ACTIVE_SHORT_DESCRIPTION = "Active";
0151:
0152: //
0153: public ProjectSystemTag() {
0154: }
0155:
0156: //
0157: public final static ProjectSystemTag newInstance(
0158: ConceptTagCharacteristic inCtchar, int inIndex,
0159: UserIdentity inUi, String inName, boolean inDeployVisible,
0160: int inVersion, boolean inDeployed, boolean inActive) {
0161:
0162: ProjectSystemTag outValue = new ProjectSystemTag();
0163:
0164: //
0165: ConceptTagCharacteristicHolder ctcharh = inCtchar.addValue(
0166: inIndex, outValue, true);
0167:
0168: InitializeSystemEntityTagContext isetc = new InitializeSystemEntityTagContext(
0169: ctcharh);
0170:
0171: outValue.initialize(isetc);
0172:
0173: //
0174: outValue.nameCtchar.addValue(0, inName);
0175: outValue.deployVisibleCtchar.addValue(0, inDeployVisible + "");
0176: outValue.versionCtchar.addValue(0, inVersion + "");
0177: outValue.deployedCtchar.addValue(0, inDeployed + "");
0178: //
0179: if (inUi != null) {
0180: UserIdentityTag.newInstance(outValue.userCtchar, 0, inUi
0181: .getName(), inUi.getSecurityType(), inUi.isValid(),
0182: inUi.isAnonymous());
0183: } else {
0184: UserIdentityTag.newInstance(outValue.userCtchar, 0, "", "",
0185: true, false);
0186: }
0187: //
0188: outValue.activeCtchar.addValue(0, inActive + "");
0189: //
0190: //DocumentSystemRootTag.newInstance(
0191: // outValue.webDocCtchar, 0, inSection, inSubSection, inVersion);
0192: //
0193:
0194: return outValue;
0195: }
0196:
0197: //
0198: public void initialize(InitializeConceptTagContext inIctc) {
0199:
0200: //
0201: ConceptTagConstraintHolder rootCtconh = ConceptTagConstraintHolder
0202: .newInstance(inIctc);
0203:
0204: //constrain "version"
0205: ConceptTagConstraint versionCtcon = ConceptTagConstraint
0206: .newInstance(VERSION_CTCON, rootCtconh);
0207: //callTypeCtcon.setMinimumLength(1);
0208: //callTypeCtcon.setMaximumLength(1);
0209: //
0210: StaticConceptTagConstraintContext versionSctcc = StaticConceptTagConstraintContext
0211: .newInstance(versionCtcon);
0212:
0213: //constrain "user"
0214: ConceptTagConstraint userCtcon = ConceptTagConstraint
0215: .newInstance(USER_CTCON, rootCtconh);
0216: //callTypeCtcon.setMinimumLength(1);
0217: //callTypeCtcon.setMaximumLength(1);
0218: //
0219: DynamicConceptTagConstraintContext userSctcc = DynamicConceptTagConstraintContext
0220: .newInstance(userCtcon);
0221:
0222: //constrain "name"
0223: ConceptTagConstraint nameCtcon = ConceptTagConstraint
0224: .newInstance(NAME_CTCON, rootCtconh);
0225: //callTypeCtcon.setMinimumLength(1);
0226: //callTypeCtcon.setMaximumLength(1);
0227: //
0228: StaticConceptTagConstraintContext nameSctcc = StaticConceptTagConstraintContext
0229: .newInstance(nameCtcon);
0230:
0231: //constrain "deploy-visible"
0232: ConceptTagConstraint deployVisibleCtcon = ConceptTagConstraint
0233: .newInstance(DEPLOY_VISIBLE_CTCON, rootCtconh);
0234: //callTypeCtcon.setMinimumLength(1);
0235: //callTypeCtcon.setMaximumLength(1);
0236: //
0237: StaticConceptTagConstraintContext deployVisibleSctcc = StaticConceptTagConstraintContext
0238: .newInstance(deployVisibleCtcon);
0239:
0240: //constrain "property"
0241: ConceptTagConstraint propertyCtcon = ConceptTagConstraint
0242: .newInstance(PROPERTY_CTCON, rootCtconh);
0243: //callTypeCtcon.setMinimumLength(1);
0244: //callTypeCtcon.setMaximumLength(1);
0245: //
0246: DynamicConceptTagConstraintContext propertySctcc = DynamicConceptTagConstraintContext
0247: .newInstance(propertyCtcon);
0248:
0249: //constrain "web-doc"
0250: ConceptTagConstraint webDocCtcon = ConceptTagConstraint
0251: .newInstance(WEB_DOC_CTCON, rootCtconh);
0252: //
0253: DynamicConceptTagConstraintContext webDocSctcc = DynamicConceptTagConstraintContext
0254: .newInstance(webDocCtcon);
0255:
0256: //constrain "audit"
0257: ConceptTagConstraint auditCtcon = ConceptTagConstraint
0258: .newInstance(AUDIT_CTCON, rootCtconh);
0259: //
0260: DynamicConceptTagConstraintContext auditSctcc = DynamicConceptTagConstraintContext
0261: .newInstance(auditCtcon);
0262:
0263: //constrain "deployed"
0264: ConceptTagConstraint deployedCtcon = ConceptTagConstraint
0265: .newInstance(DEPLOYED_CTCON, rootCtconh);
0266: //callTypeCtcon.setMinimumLength(1);
0267: //callTypeCtcon.setMaximumLength(1);
0268: //
0269: StaticConceptTagConstraintContext deployedSctcc = StaticConceptTagConstraintContext
0270: .newInstance(deployedCtcon);
0271:
0272: //constrain "active"
0273: ConceptTagConstraint activeCtcon = ConceptTagConstraint
0274: .newInstance(ACTIVE_CTCON, rootCtconh);
0275: //callTypeCtcon.setMinimumLength(1);
0276: //callTypeCtcon.setMaximumLength(1);
0277: //
0278: StaticConceptTagConstraintContext activeSctcc = StaticConceptTagConstraintContext
0279: .newInstance(activeCtcon);
0280:
0281: //
0282: inIctc.initialize();
0283:
0284: //
0285: this .propertyCtchar = propertyCtcon.getCharacteristic();
0286: this .webDocCtchar = webDocCtcon.getCharacteristic();
0287: this .versionCtchar = versionCtcon.getCharacteristic();
0288: this .nameCtchar = nameCtcon.getCharacteristic();
0289: this .deployVisibleCtchar = deployVisibleCtcon
0290: .getCharacteristic();
0291: this .auditCtchar = auditCtcon.getCharacteristic();
0292: this .userCtchar = userCtcon.getCharacteristic();
0293: this .deployedCtchar = deployedCtcon.getCharacteristic();
0294: this .activeCtchar = activeCtcon.getCharacteristic();
0295:
0296: //
0297: }
0298:
0299: //
0300: public void appraise(AppraiseConceptTagContext inCtic) {
0301: if (inCtic instanceof StudioConceptTagInstanceInfoContext) {
0302: StudioConceptTagInstanceInfoContext sctiic = (StudioConceptTagInstanceInfoContext) inCtic;
0303: sctiic.setInstanceTitle("Project System");
0304: sctiic.setInstanceDescription("Project System");
0305: } else if (inCtic instanceof StudioConceptTagTypeInfoContext) {
0306: StudioConceptTagTypeInfoContext scttic = (StudioConceptTagTypeInfoContext) inCtic;
0307: scttic.setTypeTitle("Project System");
0308: scttic.setTypeDescription("Project System");
0309: }
0310: }
0311:
0312: public void resetToDefault() {
0313:
0314: //
0315: VirtualFileSystemRoot vsr = (VirtualFileSystemRoot) this .webDocCtchar
0316: .getValueAsConceptTag(0, null);
0317: //
0318: ArrayList subMainDirNames = getMainSubDirs();
0319: for (int i = 0; i < subMainDirNames.size(); i++) {
0320: String nextSubDirName = (String) subMainDirNames.get(i);
0321: if (vsr.isDirectoryPresent(nextSubDirName)) {
0322: MiscHelper.println("//ProjSysTag del dir = "
0323: + nextSubDirName);
0324: MiscHelper.println(vsr.toString());
0325: vsr.removeDirectory(nextSubDirName);
0326: MiscHelper
0327: .println("------------------------------------");
0328: MiscHelper
0329: .println("------------------------------------");
0330: MiscHelper
0331: .println("------------------------------------");
0332: MiscHelper
0333: .println("------------------------------------");
0334: MiscHelper
0335: .println("------------------------------------");
0336: MiscHelper.println(vsr.toString());
0337: MiscHelper.println("//ProjSysTag done del = "
0338: + nextSubDirName);
0339: }
0340: }
0341: //
0342: for (int i = 0; i < subMainDirNames.size(); i++) {
0343: String nextSubDirName = (String) subMainDirNames.get(i);
0344: MiscHelper.println("//ProjSysTag create dir = "
0345: + nextSubDirName);
0346: MiscHelper.println(vsr.toString());
0347: vsr.createDirectory(nextSubDirName);
0348: MiscHelper.println("------------------------------------");
0349: MiscHelper.println("------------------------------------");
0350: MiscHelper.println("------------------------------------");
0351: MiscHelper.println("------------------------------------");
0352: MiscHelper.println("------------------------------------");
0353: MiscHelper.println(vsr.toString());
0354: MiscHelper.println("//ProjSysTag done create = "
0355: + nextSubDirName);
0356: }
0357: //
0358: //
0359: MiscHelper.println("ConScrServ delProj = " + vsr);
0360: //
0361: //
0362: SystemEntityProperties sep = (SystemEntityProperties) this .propertyCtchar
0363: .getValueAsConceptTag(0, null);
0364: for (int i = 0; i < sep.getPropertyCount(); i++) {
0365: String nextPropertyName = sep.getPropertyName(i);
0366: sep.removeProperty(nextPropertyName);
0367: }
0368: sep.setDocument(SystemEntityProperties.DEFAULT_DOCUMENT);
0369: //
0370: VirtualFileSystemDirectory descriptionVsd = vsr
0371: .getDirectory(DESCRIPTION_DIR);
0372: byte description[] = MiscHelper
0373: .fromStringToBytes("(No Description Available)");
0374: descriptionVsd.createFile(DESCRIPTION_TXT, description);
0375: }
0376:
0377: public SystemEntityUpdates getSystemEntityUpdates(
0378: SystemEntityUpdatesContext inSeuc) {
0379: //
0380: throw UnexpectedSystemException.unknownState();
0381: }
0382:
0383: public ProjectSystemUpdates getSystemEntityUpdates(
0384: SystemEntityUpdatesContext inSeuc, SecurityAudit inSa) {
0385:
0386: ProjectSystemUpdatesTag outValue = null;
0387:
0388: outValue = ProjectSystemUpdatesTag.newInstance(inSeuc
0389: .getParentCharacteristic(), inSeuc
0390: .getParentCharacteristicIndex(), getUserIdentity(),
0391: getName(), isDeployVisible(), getVersion() + 1,
0392: isDeployed(), isActive());
0393:
0394: //
0395: SecurityAuditTag.newInstance(outValue.getAuditCtchar(), 0, inSa
0396: .getAuditUserIdentity(), inSa.getAuditSequenceNumber(),
0397: inSa.getAuditMachineOfOrigin(),
0398: inSa.getAuditDateTime(), inSa.getAuditSeverityLevel(),
0399: SecurityAuditHelper.convertAuditTypeToString(inSa
0400: .getAuditCategoryType()), SecurityAuditHelper
0401: .convertAuditTypeToString(inSa
0402: .getAuditSourceType()), inSa
0403: .getAuditServerVersion(), inSa
0404: .getAuditCustomCode(), SecurityAuditHelper
0405: .convertAuditTypeToString(inSa
0406: .getAuditCustomCategoryType()),
0407: SecurityAuditHelper.convertAuditTypeToString(inSa
0408: .getAuditCustomSourceType()), inSa
0409: .getAuditCustomMessage(), false);
0410:
0411: //
0412: SystemEntityUpdatesContext webDocSeuc = SystemEntityUpdatesContext
0413: .newInstance(outValue, inSeuc, outValue
0414: .getWebDocUpdatesCtchar(), 0);
0415: getDocumentSystemRoot().getSystemEntityUpdates(webDocSeuc);
0416:
0417: //
0418: SystemEntityUpdatesContext propertySeuc = SystemEntityUpdatesContext
0419: .newInstance(outValue, inSeuc, outValue
0420: .getPropertyUpdatesCtchar(), 0);
0421: getProperties().getSystemEntityUpdates(propertySeuc);
0422:
0423: if (inSeuc.isAlign()) {
0424: this .versionCtchar.replaceValueAndRemoveLocalFiles(0,
0425: ((getVersion() + 1) + ""));
0426: }
0427:
0428: return outValue;
0429: }
0430:
0431: private ArrayList getMainSubDirs() {
0432:
0433: ArrayList outValue = new ArrayList();
0434:
0435: outValue.add(DESCRIPTION_DIR);
0436: //outValue.add(WORKFLOW_TEMPLATE_DIR);
0437: outValue.add(WEB_DOCS_DIR);
0438: outValue.add(WEB_DOCS_PROPERTIES_DIR);
0439: //outValue.add(WEB_TEMPLATES_DIR);
0440: //outValue.add(WEB_MACROS_DIR);
0441: //outValue.add(WEB_SERVLETS_DIR);
0442:
0443: return outValue;
0444: }
0445:
0446: public UserIdentity getUserIdentity() {
0447:
0448: UserIdentity outValue = null;
0449:
0450: if (this .userCtchar.getValueLength() > 0) {
0451: outValue = (UserIdentity) this .userCtchar
0452: .getValueAsConceptTag(0, null);
0453: }
0454:
0455: return outValue;
0456: }
0457:
0458: public String getName() {
0459: return this .nameCtchar.getValueAsString(0, null);
0460: }
0461:
0462: public boolean isDeployVisible() {
0463:
0464: boolean outValue = false;
0465:
0466: String value = this .deployVisibleCtchar.getValueAsString(0,
0467: null);
0468: outValue = (new Boolean(value)).booleanValue();
0469:
0470: return outValue;
0471: }
0472:
0473: public void setDeployVisible(boolean inDeployVisible) {
0474: if (this .deployVisibleCtchar.getValueLength() > 0) {
0475: this .deployVisibleCtchar.replaceValueAndRemoveLocalFiles(0,
0476: inDeployVisible + "");
0477: } else {
0478: this .deployVisibleCtchar.addValue(0, inDeployVisible + "");
0479: }
0480: }
0481:
0482: public int getVersion() {
0483:
0484: int outValue = 0;
0485:
0486: String value = this .versionCtchar.getValueAsString(0, null);
0487: outValue = Integer.parseInt(value);
0488:
0489: return outValue;
0490: }
0491:
0492: public boolean isDeployed() {
0493:
0494: boolean outValue = false;
0495:
0496: String value = this .deployedCtchar.getValueAsString(0, null);
0497: outValue = (new Boolean(value)).booleanValue();
0498:
0499: return outValue;
0500: }
0501:
0502: public boolean isActive() {
0503:
0504: boolean outValue = false;
0505:
0506: String value = this .activeCtchar.getValueAsString(0, null);
0507: outValue = (new Boolean(value)).booleanValue();
0508:
0509: return outValue;
0510: }
0511:
0512: public void setActive(boolean inActive) {
0513: if (this .activeCtchar.getValueLength() > 0) {
0514: this .activeCtchar.replaceValueAndRemoveLocalFiles(0,
0515: inActive + "");
0516: } else {
0517: this .activeCtchar.addValue(0, inActive + "");
0518: }
0519: }
0520:
0521: public DocumentFileSystemRoot getDocumentSystemRoot() {
0522:
0523: DocumentFileSystemRoot outValue = null;
0524:
0525: Object o = this .webDocCtchar.getValueAsConceptTag(0, null);
0526: outValue = (DocumentFileSystemRoot) o;
0527:
0528: return outValue;
0529: }
0530:
0531: public SystemEntityProperties getProperties() {
0532:
0533: SystemEntityProperties outValue = null;
0534:
0535: Object o = this .propertyCtchar.getValueAsConceptTag(0, null);
0536: outValue = (SystemEntityProperties) o;
0537:
0538: return outValue;
0539: }
0540:
0541: //
0542: public ConceptTagCharacteristic getWebDocCtchar() {
0543: return this .webDocCtchar;
0544: }
0545:
0546: public ConceptTagCharacteristic getPropertyCtchar() {
0547: return this .propertyCtchar;
0548: }
0549:
0550: public ConceptTagCharacteristic getUserCtchar() {
0551: return this .userCtchar;
0552: }
0553:
0554: public ConceptTagCharacteristic getAuditCtchar() {
0555: return this .auditCtchar;
0556: }
0557:
0558: //descriptive functions
0559: //public String getName() {
0560: // throw UnexpectedSystemException.notImplemented();
0561: //}
0562: public void setName(String inName) {
0563: if (this .nameCtchar.getValueLength() > 0) {
0564: this .nameCtchar.replaceValueAndRemoveLocalFiles(0, inName);
0565: } else {
0566: this .nameCtchar.addValue(0, inName);
0567: }
0568: //throw UnexpectedSystemException.notImplemented();
0569: }
0570:
0571: public SecurityAudit getSecurityAudit() {
0572: throw UnexpectedSystemException.notImplemented();
0573: }
0574:
0575: public void setSecurityAudit(SecurityAudit inSa) {
0576: throw UnexpectedSystemException.notImplemented();
0577: }
0578:
0579: public String getDescription() {
0580:
0581: String outValue = null;
0582:
0583: //SystemEntityProperties sep =
0584: //(SystemEntityProperties)this.propertyCtchar.getValueAsConceptTag(0);
0585: //
0586: //outValue = sep.getDocument();
0587: //
0588: VirtualFileSystemRoot vsr = (VirtualFileSystemRoot) this .webDocCtchar
0589: .getValueAsConceptTag(0, null);
0590: //
0591: VirtualFileSystemDirectory descriptionVsd = vsr
0592: .getDirectory(DESCRIPTION_DIR);
0593: //
0594: VirtualFileSystemFile descriptionVsf = descriptionVsd
0595: .getFile(DESCRIPTION_TXT);
0596: //
0597: outValue = MiscHelper.fromBytesToString(descriptionVsf
0598: .getContent());
0599:
0600: return outValue;
0601: }
0602:
0603: public void setDescription(String inDescription) {
0604: //
0605: VirtualFileSystemRoot vsr = (VirtualFileSystemRoot) this .webDocCtchar
0606: .getValueAsConceptTag(0, null);
0607: //
0608: VirtualFileSystemDirectory descriptionVsd = vsr
0609: .getDirectory(DESCRIPTION_DIR);
0610: //
0611: descriptionVsd.removeFile(DESCRIPTION_TXT);
0612: descriptionVsd.createFile(DESCRIPTION_TXT, MiscHelper
0613: .fromStringToBytes(inDescription));
0614: //VirtualSystemFile descriptionVsf =
0615: // descriptionVsd.getFile(DESCRIPTION_TXT);
0616: //
0617: }
0618:
0619: //public VirtualSystemHolder getDocuments() {
0620: // throw UnexpectedSystemException.notImplemented();
0621: //}
0622: //public void setDocuments(VirtualSystemRoot inFsr) {
0623: // throw UnexpectedSystemException.notImplemented();
0624: //}
0625: public String getLicense() {
0626: throw UnexpectedSystemException.notImplemented();
0627: }
0628:
0629: public void setLicense(String inLicense) {
0630: throw UnexpectedSystemException.notImplemented();
0631: }
0632:
0633: //public void setDeveloperMode(boolean inDeveloper) {
0634: // throw UnexpectedSystemException.notImplemented();
0635: //}
0636: //public void setDeploymentMode(boolean inDeployment) {
0637: // throw UnexpectedSystemException.notImplemented();
0638: //}
0639: //public boolean isDeveloperMode() {
0640: // throw UnexpectedSystemException.notImplemented();
0641: //}
0642: //public boolean isDeploymentMode() {
0643: // throw UnexpectedSystemException.notImplemented();
0644: //}
0645: //public void setProperties(SystemEntityProperties inProps) {
0646: // throw UnexpectedSystemException.notImplemented();
0647: //}
0648: //public SystemEntityProperties getProperties() {
0649: // throw UnexpectedSystemException.notImplemented();
0650: //}
0651: //version?
0652:
0653: //calendar functions
0654:
0655: //workflow functions
0656: //public WorkflowTemplate getWorkflowTemplate() {
0657: // throw UnexpectedSystemException.notImplemented();
0658: //}
0659: //public void setWorkflowTemplate(RootConceptTagHolder inRcth) {
0660: // throw UnexpectedSystemException.notImplemented();
0661: //}
0662:
0663: //web pages - dual system, including macros and templates
0664: public void printVfsrStatus(String inMessage) {
0665: //
0666: MiscHelper.println("ProjSysTag printVsfrStatus");
0667: MiscHelper.println(" -- " + inMessage);
0668: MiscHelper.println(" -- " + inMessage);
0669: MiscHelper.println(" -- " + inMessage);
0670: //SystemEntityUpdatesContext webDocSeuc =
0671: // SystemEntityUpdatesContext.newInstance(
0672: // null, false, inCtchar, 0);
0673: DocumentFileSystemRoot localVfsr = getDocumentSystemRoot();
0674: //SystemEntityUpdates localSeu =
0675: // localVfsr.getSystemEntityUpdates(webDocSeuc);
0676: MiscHelper.println(localVfsr.toString());
0677:
0678: }
0679:
0680: //web pages - dual system, including macros and templates
0681: public VirtualFileSystemHolder getWebDocs() {
0682: return getDocumentSystemRoot().getOrCreateLocalDirectory(
0683: WEB_DOCS_DIR);
0684: }
0685:
0686: //public void setWebFiles(VirtualSystemRoot inFsr) {
0687: // throw UnexpectedSystemException.notImplemented();
0688: //}
0689: public VirtualFileSystemHolder getWebDocsProperties() {
0690: return getDocumentSystemRoot().getOrCreateLocalDirectory(
0691: WEB_DOCS_PROPERTIES_DIR);
0692: }
0693:
0694: //public VirtualFileSystemHolder getWebMacros() {
0695: // return getDocumentSystemRoot().getOrCreateLocalDirectory(
0696: // WEB_MACROS_DIR);
0697: //}
0698: //public VirtualFileSystemHolder getWebTemplates() {
0699: // return getDocumentSystemRoot().getOrCreateLocalDirectory(
0700: // WEB_TEMPLATES_DIR);
0701: //}
0702: //public VirtualFileSystemHolder getWebServlets() {
0703: // return getDocumentSystemRoot().getOrCreateLocalDirectory(
0704: // WEB_SERVLETS_DIR);
0705: //}
0706: //public void setWebPages(VirtualSystemRoot inFsr) {
0707: // throw UnexpectedSystemException.notImplemented();
0708: //}
0709:
0710: //
0711: //////////
0712: //
0713: //helper functions
0714: public boolean isWebDocText(
0715: SimpleVirtualFileSystemProperties inProperties) {
0716: //
0717: return isPropertyTrue(inProperties, WEB_DOC_IS_TEXT);
0718: }
0719:
0720: public boolean isWebDocFile(
0721: SimpleVirtualFileSystemProperties inProperties) {
0722: //
0723: return (!isPropertyTrue(inProperties, WEB_DOC_IS_PAGE)
0724: && !isPropertyTrue(inProperties, WEB_DOC_IS_TEMPLATE)
0725: && !isPropertyTrue(inProperties, WEB_DOC_IS_MACRO) && !isPropertyTrue(
0726: inProperties, WEB_DOC_IS_BINARY));
0727: }
0728:
0729: public boolean isWebDocBinary(
0730: SimpleVirtualFileSystemProperties inProperties) {
0731: //
0732: return isPropertyTrue(inProperties, WEB_DOC_IS_BINARY);
0733: }
0734:
0735: public boolean isWebDocPage(
0736: SimpleVirtualFileSystemProperties inProperties) {
0737: //
0738: return isPropertyTrue(inProperties, WEB_DOC_IS_PAGE);
0739: }
0740:
0741: public boolean isWebDocMacro(
0742: SimpleVirtualFileSystemProperties inProperties) {
0743: //
0744: return isPropertyTrue(inProperties, WEB_DOC_IS_MACRO);
0745: }
0746:
0747: public boolean isWebDocTemplate(
0748: SimpleVirtualFileSystemProperties inProperties) {
0749: //
0750: return isPropertyTrue(inProperties, WEB_DOC_IS_TEMPLATE);
0751: }
0752:
0753: private final static boolean isPropertyTrue(
0754: SimpleVirtualFileSystemProperties inProperties,
0755: String inName) {
0756: //
0757: boolean outValue = false;
0758:
0759: if (inProperties.isPropertyPresent(inName)) {
0760: Boolean b = new Boolean(inProperties
0761: .getPropertyValue(inName));
0762: outValue = b.booleanValue();
0763: }
0764:
0765: return outValue;
0766: }
0767:
0768: //
0769: public SimpleVirtualFileSystemProperties getWebDocProperty(
0770: boolean inPage, boolean inBinary, boolean inText,
0771: boolean inMacro, boolean inTemplate,
0772: WebPageTagMacroGroup inMacroGroup) {
0773: //
0774: SimpleVirtualFileSystemProperties outValue = SimpleVirtualFileSystemProperties
0775: .newInstance();
0776:
0777: //
0778: outValue.createProperty(WEB_DOC_IS_PAGE, (new Boolean(inPage))
0779: + "");
0780: outValue.createProperty(WEB_DOC_IS_BINARY, (new Boolean(
0781: inBinary))
0782: + "");
0783: outValue.createProperty(WEB_DOC_IS_TEXT, (new Boolean(inText))
0784: + "");
0785: outValue.createProperty(WEB_DOC_IS_MACRO,
0786: (new Boolean(inMacro)) + "");
0787: outValue.createProperty(WEB_DOC_IS_TEMPLATE, (new Boolean(
0788: inTemplate))
0789: + "");
0790: //
0791: if (inMacroGroup != null) {
0792: //
0793: //StringBuffer sb = new StringBuffer();
0794: //
0795: //int icount = inMacroGroup.getValidAndInvalidSignatureLength();
0796: //for (int i = 0; i < icount; i++) {
0797: // if (inMacroGroup.isSignatureValid(i)) {
0798: // //
0799: // WebPageTagMacro nextMacro = inMacroGroup.getMacro(i);
0800: // //
0801: // sb.append(CommonSeparators.HANDLE_SEPARATOR);
0802: // getValueAsToken(sb, nextMacro.getResultType());
0803: // getValueAsToken(sb, nextMacro.getName());
0804: // for (int j = 0; j < nextMacro.getParameterCount(); j++) {
0805: // getValueAsToken(sb, nextMacro.getParameterName(j));
0806: // getValueAsToken(sb, nextMacro.getParameterType(j));
0807: // }
0808: // sb.append(CommonSeparators.HANDLE_SEPARATOR);
0809: // //
0810: // //
0811: // //
0812: // }
0813: //}
0814: outValue.createProperty(WEB_DOC_MACRO_GROUP,
0815: WebPageTagMacroHelper
0816: .representMacroGroupAsString(inMacroGroup));
0817: //
0818: }
0819:
0820: return outValue;
0821: }
0822:
0823: private final static void getValueAsToken(StringBuffer inSb,
0824: String inValue) {
0825: //
0826: inSb.append(CommonSeparators.BRANCH_SEPARATOR);
0827: inSb.append(inValue);
0828: inSb.append(CommonSeparators.BRANCH_SEPARATOR);
0829: }
0830:
0831: //properties
0832: //public String getPropertyDocument() {
0833: // throw UnexpectedSystemException.notImplemented();
0834: //}
0835: //public void setPropertyDocument(String inDocument) {
0836: //}
0837: //public String[] getPropertyNames() {
0838: // throw UnexpectedSystemException.notImplemented();
0839: //}
0840: //public String getPropertyValue(String inName) {
0841: // throw UnexpectedSystemException.notImplemented();
0842: //}
0843: //public void createProperty(String inName, String inValue) {
0844: // throw UnexpectedSystemException.notImplemented();
0845: //}
0846: //public void updateProperty(String inName, String inValue) {
0847: // throw UnexpectedSystemException.notImplemented();
0848: //}
0849: //public boolean isPropertyPresent(String inName) {
0850: // throw UnexpectedSystemException.notImplemented();
0851: //}
0852: //public void removeProperty(String inName) {
0853: // throw UnexpectedSystemException.notImplemented();
0854: //}
0855: private final static String PROP_USER = "1";
0856: private final static String PROP_SERVER = "2";
0857: //
0858: private final static String PROP_VALUES = "1";
0859: private final static String PROP_REG_EXES = "2";
0860: private final static String PROP_DESCRS = "3";
0861: private final static String PROP_ERR_MESS = "4";
0862:
0863: //
0864: public SystemEntityProperties getUserPropertiesValues() {
0865: return getSubSpaceProperties(PROP_USER, PROP_VALUES);
0866: }
0867:
0868: public SystemEntityProperties getUserPropertiesRegExes() {
0869: return getSubSpaceProperties(PROP_USER, PROP_REG_EXES);
0870: }
0871:
0872: public SystemEntityProperties getUserPropertiesDescriptions() {
0873: return getSubSpaceProperties(PROP_USER, PROP_DESCRS);
0874: }
0875:
0876: public SystemEntityProperties getUserPropertiesErrorMessages() {
0877: return getSubSpaceProperties(PROP_USER, PROP_ERR_MESS);
0878: }
0879:
0880: //
0881: public SystemEntityProperties getServerPropertiesValues() {
0882: return getSubSpaceProperties(PROP_SERVER, PROP_VALUES);
0883: }
0884:
0885: public SystemEntityProperties getServerPropertiesRegExes() {
0886: return getSubSpaceProperties(PROP_SERVER, PROP_REG_EXES);
0887: }
0888:
0889: public SystemEntityProperties getServerPropertiesDescriptions() {
0890: return getSubSpaceProperties(PROP_SERVER, PROP_DESCRS);
0891: }
0892:
0893: public SystemEntityProperties getServerPropertiesErrorMessages() {
0894: return getSubSpaceProperties(PROP_SERVER, PROP_ERR_MESS);
0895: }
0896:
0897: //
0898: private SystemEntityProperties getSubSpaceProperties(
0899: String inSection, String inType) {
0900:
0901: SystemEntityProperties outValue = null;
0902:
0903: SystemEntityProperties subSpace1 = SubSpaceSystemEntityProperties
0904: .newInstance(getProperties(), inSection);
0905:
0906: outValue = SubSpaceSystemEntityProperties.newInstance(
0907: subSpace1, inType);
0908:
0909: return outValue;
0910: }
0911:
0912: //
0913: //
0914: //
0915: //
0916: //
0917: public WebPageTagMacroSet getWebPageTagMacroSet() {
0918:
0919: WebPageTagMacroSet outValue = null;
0920:
0921: outValue = WebPageTagMacroHelper.getMacroSet(
0922: getWebDocsProperties(), WEB_DOC_MACRO_GROUP);
0923:
0924: return outValue;
0925: }
0926:
0927: //
0928: public ArrayList getWebPageTagTemplateNames() {
0929:
0930: ArrayList outValue = new ArrayList();
0931:
0932: VirtualFileSystemHolder vfsh = getWebDocsProperties();
0933: //getTemplates(vfsh, outValue);
0934: //
0935: getFileTypeByFlag(VirtualFileSystemHolder.DIRECTORY_SEPARATOR,
0936: vfsh, outValue, WEB_DOC_IS_TEMPLATE);
0937:
0938: return outValue;
0939: }
0940:
0941: //
0942: public ArrayList getWebPageTagDisplayNames() {
0943:
0944: ArrayList outValue = new ArrayList();
0945:
0946: VirtualFileSystemHolder vfsh = getWebDocsProperties();
0947: //getTemplates(vfsh, outValue);
0948: //
0949: getFileTypeByFlag(VirtualFileSystemHolder.DIRECTORY_SEPARATOR,
0950: vfsh, outValue, WEB_DOC_IS_PAGE);
0951: //
0952: getFileTypeByFlag(VirtualFileSystemHolder.DIRECTORY_SEPARATOR,
0953: vfsh, outValue, WEB_DOC_IS_BINARY);
0954: //
0955: getFileTypeByFlag(VirtualFileSystemHolder.DIRECTORY_SEPARATOR,
0956: vfsh, outValue, null);
0957:
0958: return outValue;
0959: }
0960:
0961: //
0962: //private final static void getTemplates(
0963: // VirtualFileSystemHolder inVfsh, ArrayList inValue) {
0964: // //
0965: // //
0966: // getFileTypeByFlag(
0967: // VirtualFileSystemHolder.DIRECTORY_SEPARATOR, inVfsh, inValue,
0968: // WEB_DOC_IS_TEMPLATE);
0969: //}
0970: //
0971: private final static void getFileTypeByFlag(String inWebDir,
0972: VirtualFileSystemHolder inVfsh, ArrayList inValue,
0973: String inFileType) {
0974: //
0975:
0976: //
0977: ArrayList localDirs = inVfsh.getLocalDirectories();
0978: for (int i = 0; i < localDirs.size(); i++) {
0979: VirtualFileSystemDirectory nextVfsd = ((VirtualFileSystemDirectory) localDirs
0980: .get(i));
0981: String subWebDir = inWebDir + nextVfsd.getName()
0982: + VirtualFileSystemHolder.DIRECTORY_SEPARATOR;
0983: getFileTypeByFlag(subWebDir, nextVfsd, inValue, inFileType);
0984: }
0985:
0986: //
0987: ArrayList localFiles = inVfsh.getLocalFiles();
0988: for (int i = 0; i < localFiles.size(); i++) {
0989: VirtualFileSystemFile nextVfsf = ((VirtualFileSystemFile) localFiles
0990: .get(i));
0991: String subWebFile = inWebDir + nextVfsf.getName();
0992: //
0993: SimpleVirtualFileSystemProperties nextVfsp = SimpleVirtualFileSystemProperties
0994: .newInstance(nextVfsf.getContent());
0995: //
0996: if (inFileType != null) {
0997: if (isPropertyTrue(nextVfsp, inFileType)) {
0998: inValue.add(subWebFile);
0999: }
1000: } else {
1001: boolean typeNotFound = true;
1002: //
1003: for (int j = 0; j < WEB_DOC_TYPES.length; j++) {
1004: typeNotFound &= !(isPropertyTrue(nextVfsp,
1005: WEB_DOC_TYPES[j]));
1006: }
1007:
1008: //
1009: if (typeNotFound) {
1010: inValue.add(subWebFile);
1011: }
1012: }
1013: }
1014: }
1015: //private SystemEntityProperties getProperties(int inIndex) {
1016: //
1017: // SystemEntityProperties outValue = null;
1018: //
1019: // Object o = this.propertyCtchar.getValueAsConceptTag(inIndex);
1020: // outValue = (SystemEntityProperties)o;
1021: //
1022: // return outValue;
1023: //}
1024: //
1025:
1026: //command line
1027:
1028: //data types
1029:
1030: //common functions
1031:
1032: /*
1033: //section details
1034: private final static String SECTION_CTCON = "section";
1035: private final static String SECTION_TITLE = "Section";
1036: private final static String SECTION_SHORT_DESCRIPTION = "Section";
1037:
1038: //sub-section details
1039: private final static String SUB_SECTION_CTCON = "sub-section";
1040: private final static String SUB_SECTION_TITLE = "Sub Section";
1041: private final static String SUB_SECTION_SHORT_DESCRIPTION = "Sub Section";
1042:
1043: //version details
1044: private final static String VERSION_CTCON = "version";
1045: private final static String VERSION_TITLE = "Version";
1046: private final static String VERSION_SHORT_DESCRIPTION = "Version";
1047:
1048: //document-group details
1049: private final static String DOCUMENT_GROUP_CTCON = "document-group";
1050: private final static String DOCUMENT_GROUP_TITLE = "Document Group";
1051: private final static String DOCUMENT_GROUP_SHORT_DESCRIPTION =
1052: "Document Group";
1053:
1054: //
1055: private ConceptTagCharacteristic sectionCtchar = null;
1056: private ConceptTagCharacteristic subSectionCtchar = null;
1057: private ConceptTagCharacteristic versionCtchar = null;
1058: private ConceptTagCharacteristic documentGroupCtchar = null;
1059:
1060: public DocumentSetTag() {
1061: }
1062:
1063: public final static DocumentSetTag newInstance(
1064: ConceptTagCharacteristic inCtchar, int inIndex,
1065: String inSection, String inSubSection, int inVersion) {
1066:
1067: DocumentSetTag outValue = new DocumentSetTag();
1068:
1069: ConceptTagCharacteristicHolder ctcharh =
1070: inCtchar.addValue(inIndex, outValue, true);
1071:
1072: InitializeSystemEntityTagContext isetc =
1073: new InitializeSystemEntityTagContext(ctcharh);
1074:
1075: outValue.initialize(isetc);
1076:
1077: outValue.sectionCtchar.addValue(0, inSection);
1078: outValue.subSectionCtchar.addValue(0, inSubSection);
1079: outValue.versionCtchar.addValue(0, inVersion + "");
1080:
1081: return outValue;
1082: }
1083:
1084: //
1085: public void initialize(InitializeConceptTagContext inIctc) {
1086:
1087: //
1088: ConceptTagConstraintHolder rootCtconh =
1089: ConceptTagConstraintHolder.newInstance(inIctc);
1090:
1091: //constrain "section"
1092: ConceptTagConstraint sectionCtcon =
1093: ConceptTagConstraint.newInstance(SECTION_CTCON, rootCtconh);
1094: sectionCtcon.setTitle(SECTION_TITLE);
1095: sectionCtcon.setShortDescription(SECTION_SHORT_DESCRIPTION);
1096: //
1097: StaticConceptTagConstraintContext sectionSctcc =
1098: StaticConceptTagConstraintContext.newInstance(sectionCtcon);
1099:
1100: //constrain "sub-section"
1101: ConceptTagConstraint subSectionCtcon =
1102: ConceptTagConstraint.newInstance(SUB_SECTION_CTCON, rootCtconh);
1103: subSectionCtcon.setTitle(SUB_SECTION_TITLE);
1104: subSectionCtcon.setShortDescription(SUB_SECTION_SHORT_DESCRIPTION);
1105: //
1106: StaticConceptTagConstraintContext subSectionSctcc =
1107: StaticConceptTagConstraintContext.newInstance(subSectionCtcon);
1108:
1109: //constrain "version"
1110: ConceptTagConstraint versionCtcon =
1111: ConceptTagConstraint.newInstance(VERSION_CTCON, rootCtconh);
1112: versionCtcon.setTitle(VERSION_TITLE);
1113: versionCtcon.setShortDescription(VERSION_SHORT_DESCRIPTION);
1114: //
1115: StaticConceptTagConstraintContext versionSctcc =
1116: StaticConceptTagConstraintContext.newInstance(versionCtcon);
1117:
1118: //constrain "document-group"
1119: ConceptTagConstraint documentGroupCtcon =
1120: ConceptTagConstraint.newInstance(DOCUMENT_GROUP_CTCON, rootCtconh);
1121: documentGroupCtcon.setTitle(DOCUMENT_GROUP_TITLE);
1122: documentGroupCtcon.setShortDescription(
1123: DOCUMENT_GROUP_SHORT_DESCRIPTION);
1124: //
1125: StaticConceptTagConstraintContext documentGroupDctcc =
1126: StaticConceptTagConstraintContext.newInstance(documentGroupCtcon);
1127:
1128: //
1129: inIctc.initialize();
1130:
1131: //initialize characteristics
1132: this.sectionCtchar = sectionCtcon.getCharacteristic();
1133: this.subSectionCtchar = subSectionCtcon.getCharacteristic();
1134: this.versionCtchar = versionCtcon.getCharacteristic();
1135: this.documentGroupCtchar = documentGroupCtcon.getCharacteristic();
1136: }
1137:
1138: public void appraise(AppraiseConceptTagContext inCtic) {
1139: if (inCtic instanceof StudioConceptTagInstanceInfoContext) {
1140: StudioConceptTagInstanceInfoContext sctiic =
1141: (StudioConceptTagInstanceInfoContext)inCtic;
1142: sctiic.setInstanceTitle("Document Set");
1143: sctiic.setInstanceDescription("Document Set");
1144: }
1145: else if (inCtic instanceof StudioConceptTagTypeInfoContext) {
1146: StudioConceptTagTypeInfoContext scttic =
1147: (StudioConceptTagTypeInfoContext)inCtic;
1148: scttic.setTypeTitle("Document Set");
1149: scttic.setTypeDescription("Document Set");
1150: }
1151: }
1152:
1153: public int getVersion() {
1154:
1155: int outValue = 0;
1156:
1157: if (this.versionCtchar.getValueLength() > 0) {
1158: outValue = Integer.parseInt(this.versionCtchar.getValueAsString(0));
1159: }
1160: else {
1161: throw UnexpectedSystemException.unknownState();
1162: }
1163:
1164: return outValue;
1165: }
1166:
1167: public SystemEntityUpdates getSystemEntityUpdates(
1168: SystemEntityUpdatesContext inSeuc) {
1169:
1170: throw UnexpectedSystemException.notImplemented();
1171:
1172: //DocumentSetUpdatesTag outValue = new DocumentSetUpdatesTag(
1173: // this.section, this.subSection, this.version + 1);
1174:
1175: //
1176: //if (inSeuc.isAlign()) {
1177: // this.version = this.version + 1;
1178: //}
1179: }
1180:
1181: public DocumentGroup addDocumentGroup(String inPath) {
1182:
1183: DocumentGroup outValue = null;
1184:
1185:
1186:
1187: return outValue;
1188: }
1189:
1190: public void removeDocumentGroup(String inPath) {
1191: throw UnexpectedSystemException.notImplemented();
1192: }
1193:
1194: public int getDocumentGroupCount() {
1195: return this.documentGroupCtchar.getValueLength();
1196: }
1197:
1198: public DocumentGroup getDocumentGroup(String inPath) {
1199:
1200: DocumentGroup outValue = null;
1201:
1202: DocumentGroup dg = getDocumentGroupWithoutException(inPath);
1203:
1204: if (dg != null) {
1205: outValue = dg;
1206: }
1207: else {
1208: throw new UnexpectedSystemException("Document group with path '"
1209: + inPath + "' could not be found");
1210: }
1211:
1212: return outValue;
1213: }
1214: private DocumentGroup getDocumentGroupWithoutException(String inPath) {
1215:
1216: DocumentGroup outValue = null;
1217:
1218: for (int i = 0; i < getDocumentGroupCount(); i++) {
1219: DocumentGroup nextDg = getDocumentGroup(i);
1220: if (nextDg.getPath().equals(inPath)) {
1221: outValue = nextDg;
1222: }
1223: }
1224:
1225: return outValue;
1226: }
1227:
1228: public DocumentGroup getDocumentGroup(int inIndex) {
1229:
1230: DocumentGroup outValue = null;
1231:
1232: ConceptTag ct = this.documentGroupCtchar.getValueAsConceptTag(inIndex);
1233: outValue = (DocumentGroup)ct;
1234:
1235: return outValue;
1236: }
1237: */
1238: }
|