/// /// <summary> * version fixing routine for JDF /// * /// * uses heuristics to modify this element and its children to be compatible with a given version in general, it will /// * be able to move from low to high versions but potentially fail when attempting to move from higher to lower /// * versions /// * </summary> /// * <param name="version"> : version that the resulting element should correspond to </param> /// * <returns> true if successful </returns> /// public override bool fixVersion(EnumVersion version) { bool bRet = true; if (version != null) { if (version.getValue() >= EnumVersion.Version_1_2.getValue()) { if (hasAttribute(AttributeName.PRIORITY)) { if (getPriority() == EnumPriority.Required) { setSettingsPolicy(EnumSettingsPolicy.MustHonor); } else { setSettingsPolicy(EnumSettingsPolicy.BestEffort); } removeAttribute(AttributeName.PRIORITY); } } else { if (getSettingsPolicy(true) == EnumSettingsPolicy.BestEffort) { setPriority(EnumPriority.Required); } else { setPriority(EnumPriority.Suggested); } } } return(base.fixVersion(version) && bRet); }
/// /// <summary> * Mother of all version fixing routines <br> /// * Uses heuristics to modify this element and its children to be compatible /// * with a given version. In general, it will be able to move from low to /// * high versions, but potentially fail when attempting to move from higher /// * to lower versions. /// * </summary> /// * <param name="version"> /// * version that the resulting element should correspond to </param> /// * <returns> true if successful </returns> /// public override bool fixVersion(EnumVersion version) { if (JDFConstants.UNBOUNDED.Equals(getAttribute(AttributeName.MAXOCCURS, null, null))) { setAttribute(AttributeName.MAXOCCURS, JDFConstants.POSINF); } return(base.fixVersion(version)); }
/// /// <summary> * Mother of all version fixing routines /// * /// * uses heuristics to modify this element and its children to be compatible with a given version in general, it will /// * be able to move from low to high versions but potentially fail when attempting to move from higher to lower /// * versions /// * </summary> /// * <param name="version"> : version that the resulting element should correspond to </param> /// * <returns> true if successful </returns> /// public override bool fixVersion(EnumVersion version) { if (hasAttribute(AttributeName.RREFS)) { removeAttribute(AttributeName.RREFS); } return(base.fixVersion(version)); }
/// /// <summary> * version fixing routine for JMF /// *<p> /// * Uses heuristics to modify this element and its children to be compatible with a given version.<br> /// * In general, it will be able to move from low to high versions, but potentially fail when attempting to move from /// * higher to lower versions /// * </summary> /// * <param name="version"> version that the resulting element should correspond to </param> /// * <returns> true if successful </returns> /// public override bool fixVersion(EnumVersion version) { if (version != null) { setVersion(version); setMaxVersion(version); } return(base.fixVersion(version)); }
/// /// <summary> * get attribute MaxVersion, defaults to version if not set /// * </summary> /// * <param name="bInherit"> if true recurse through ancestors when searching </param> /// * <returns> EnumVersion - attribute value /// * /// * default - getMaxVersion(false) </returns> /// public override EnumVersion getMaxVersion() { string version = getAttribute(AttributeName.MAXVERSION, null, null); if (version == null) { return(getVersion(false)); } return(EnumVersion.getEnum(version)); }
/// /// <summary> * version fixing routine for JDF /// * /// * uses heuristics to modify this element and its children to be compatible /// * with a given version in general, it will be able to move from low to high /// * versions but potentially fail when attempting to move from higher to /// * lower versions /// * </summary> /// * <param name="version"> /// * : version that the resulting element should correspond to </param> /// * <returns> true if successful </returns> /// public override bool fixVersion(EnumVersion version) { if (version.getValue() >= EnumVersion.Version_1_3.getValue()) { appendAnchor(null); } else { removeAttribute(AttributeName.ID); } return(base.fixVersion(version)); }
public override bool fixVersion(EnumVersion version) { if (hasAttribute(AttributeName.USEPDLALTERNATECS)) { if (!hasAttribute(AttributeName.MAPPINGSELECTION)) { setMappingSelection(getUsePDLAlternateCS() ? EnumMappingSelection.UsePDLValues : EnumMappingSelection.UseProcessColorValues); } removeAttribute(AttributeName.USEPDLALTERNATECS); } return(base.fixVersion(version)); }
/// /// <summary> * init this comment by adding agentname, agentversion and id /// * </summary> /// * <returns> boolean </returns> /// public override bool init() { EnumVersion v = getVersion(true); if (v.getValue() >= EnumVersion.Version_1_3.getValue() && LocalName.Equals(ElementName.COMMENT)) { appendAnchor(null); setAgentName(JDFAudit.getStaticAgentName()); setAgentVersion(JDFAudit.getStaticAgentVersion()); } return(base.init()); }
/// /// <summary> * fixes an ApprovalSuccess by moving the appropriate elements in and out of /// * ApprovalDetails elements /// * </summary> /// * <seealso cref= org.cip4.jdflib.resource.JDFResource#fixVersion(org.cip4.jdflib.core.JDFElement.EnumVersion) </seealso> /// public override bool fixVersion(EnumVersion version) { bool bRet = true; if (version != null) { // create ApprovalDetails if (version.getValue() >= EnumVersion.Version_1_3.getValue()) { if (hasChildElement(ElementName.CONTACT, null) || hasChildElement(ElementName.FILESPEC, null)) { JDFApprovalDetails ad = appendApprovalDetails(); ad.setApprovalState(EnumApprovalState.Approved); ad.moveElement(getContact(), null); ad.moveElement(getFileSpec(), null); } } else { // remove ApprovalDetails for (int i = 0; i < 99999; i++) { JDFApprovalDetails ad = getApprovalDetails(i); int iAccept = 0; if (ad == null) { if (iAccept == 0) { setResStatus(EnumResStatus.Rejected, false); } break; // none left } if (ad.getApprovalState() == EnumApprovalState.Rejected) { bRet = false; ad.deleteNode(); continue; // semantics of reject are not available in // 1.2 and below ignore } iAccept++; moveElement(ad.getContact(), null); moveElement(ad.getFileSpec(), null); ad.deleteNode(); } } } return(base.fixVersion(version) && bRet); }
/// /// <summary> * version fixing routine for JDF /// * /// * uses heuristics to modify this element and its children to be compatible with a given version in general, it will /// * be able to move from low to high versions but potentially fail when attempting to move from higher to lower /// * versions /// * </summary> /// * <param name="version"> version that the resulting element should correspond to </param> /// * <returns> true if successful </returns> /// public override bool fixVersion(EnumVersion version) { bool bRet = true; if (version != null) { setVersion(version); setMaxVersion(version); if (version.getValue() < EnumVersion.Version_1_3.getValue()) { inlineRefElements(null, null, true); } } return(base.fixVersion(version) && bRet); }
/// /// <summary> * version fixing routine for JDF /// * /// * uses heuristics to modify this element and its children to be compatible /// * with a given version in general, it will be able to move from low to high /// * versions but potentially fail when attempting to move from higher to /// * lower versions /// * </summary> /// * <param name="version"> /// * : version that the resulting element should correspond to </param> /// * <returns> true if successful </returns> /// public override bool fixVersion(EnumVersion version) { bool bRet = true; if (version != null) { if (version.getValue() >= EnumVersion.Version_1_3.getValue()) { if (hasAttribute(AttributeName.SOURCESHEET)) { string sourceSheet = getSourceSheet(); JDFRefElement layoutRef = (JDFRefElement)getElement_KElement("LayoutRef", null, 0); if (layoutRef != null) { JDFLayout lo = (JDFLayout)layoutRef.getLinkRoot(layoutRef.getrRef()); if (lo != null) { lo.fixVersion(version); } layoutRef.setPartMap(new JDFAttributeMap(AttributeName.SHEETNAME, sourceSheet)); lo = (JDFLayout)layoutRef.getTarget(); layoutRef.setPartMap(lo.getPartMap()); } removeAttribute(AttributeName.SOURCESHEET); } } else { JDFLayout layout = getLayout(); if (layout != null) { string sourcesheet = layout.getSheetName(); setSourceSheet(sourcesheet); JDFRefElement layoutRef = (JDFRefElement)getElement_KElement("LayoutRef", null, 0); // JDF 1.2 layout should be unpartitioned if (layoutRef != null) { // JDF 1.2 layout should be unpartitioned layoutRef.removeChild(ElementName.PART, null, 0); } } } } return(base.fixVersion(version) && bRet); }
/// /// <summary> * heuristics to check which version an element of a Layout is in: 1.3 or /// * 1.2 /// * /// * Note that this routine is static since it must be used on all sheets, /// * surfaces etc. /// * </summary> /// * <param name="sheet"> /// * the Sheet, Surface, Signature or Layout to check </param> /// * <returns> true if this is a new, i.e. partitioned Layout /// * </returns> /// public static bool isNewLayout(JDFResource sheet) { // not one of Layout, Signature, Sheet or Surface if (!(sheet is JDFLayout)) { return(false); } // either Signature, Sheet or Surface --> old if (!sheet.LocalName.Equals(ElementName.LAYOUT)) { return(false); } // it's a layout the only allowed (old) element is a signature , if it // exists --> old if (sheet.getElement_KElement(ElementName.SIGNATURE, null, 0) != null) { return(false); } // it is a layout and it has no subelements and it is partitioned --> // new JDFResource resourceRoot = sheet.getResourceRoot(); if (resourceRoot.hasAttribute(AttributeName.PARTIDKEYS)) { return(true); } // it is a non partitioned layout and it has palacedobjects --> new if (resourceRoot.hasChildElement(ElementName.CONTENTOBJECT, null) || resourceRoot.hasChildElement(ElementName.MARKOBJECT, null)) { return(true); } // now I'm ready to punt - no partition and no subelements --> assume // that version tags are correct EnumVersion v = sheet.getVersion(true); // no version, we are 1.3 --> assume 1.3 if (v == null) { return(true); } return(v.getValue() >= EnumVersion.Version_1_3.getValue()); }
/// /// <summary> * version fixing routine /// * /// * uses heuristics to modify this element and its children to be compatible /// * with a given version in general, it will be able to move from low to high /// * versions but potentially fail when attempting to move from higher to /// * lower versions /// * </summary> /// * <param name="version"> /// * : version that the resulting element should correspond to </param> /// * <returns> true if successful </returns> /// public override bool fixVersion(EnumVersion version) { bool bRet = true; if (isResourceRoot() && version != null) { bool newLayout = isNewLayout(this); if (version.getValue() >= EnumVersion.Version_1_3.getValue() && !newLayout) { bRet = toNewLayout(); } else if (version.getValue() < EnumVersion.Version_1_3.getValue() && newLayout) { bRet = fromNewLayout(); } } return(base.fixVersion(version) && bRet); }
/// /// <summary> * init /// * </summary> /// * <returns> boolean </returns> /// public override bool init() { base.init(); setTimeStamp(null); setVersion(getDefaultJDFVersion()); EnumVersion version = getVersion(true); if (!EnumVersion.Version_1_3.isGreater(version)) { setMaxVersion(version); } setXSIType("JMFRootMessage"); if (theSenderID != null) { setSenderID(theSenderID); } return(true); }
/// /// <summary> * version fixing routine for JDF /// * /// * uses heuristics to modify this element and its children to be compatible with a given version<br> /// * in general, it will be able to move from low to high versions but potentially fail when attempting to move from /// * higher to lower versions /// * </summary> /// * <param name="version"> version that the resulting element should correspond to </param> /// * <returns> true if successful </returns> /// public override bool fixVersion(EnumVersion version) { if (version != null) { if (version.getValue() >= EnumVersion.Version_1_3.getValue() && LocalName.Equals(ElementName.COMMENT)) { appendAnchor(null); } else { removeAttribute(AttributeName.ID); removeAttribute(AttributeName.AGENTNAME); removeAttribute(AttributeName.AGENTVERSION); removeAttribute(AttributeName.AUTHOR); removeAttribute(AttributeName.TIMESTAMP); } } return(base.fixVersion(version)); }
public override bool fixVersion(EnumVersion version) { if (version != null && version.getValue() >= EnumVersion.Version_1_3.getValue()) { if (hasAttribute(AttributeName.TOOLID) && !hasAttribute(AttributeName.PRODUCTID)) { setProductID(getToolID()); } removeAttribute(AttributeName.TOOLID, null); } else if (version != null && version.getValue() < EnumVersion.Version_1_3.getValue()) { if (hasAttribute(AttributeName.PRODUCTID) && !hasAttribute(AttributeName.TOOLID)) { setToolID(getProductID()); } } return(base.fixVersion(version)); }
/// /// <summary> * init /// * </summary> /// * <returns> boolean </returns> /// public override bool init() { EnumVersion auditVersion = getVersion(true); setAttributeNameTimeStamp(AttributeName.TIMESTAMP, null); if (auditVersion == null || auditVersion.getValue() >= EnumVersion.Version_1_2.getValue()) { setAgentName(m_strAgentName); setAgentVersion(m_strAgentVersion); } if (m_strAuthor != null) { setAuthor(m_strAuthor); } if (auditVersion == null || auditVersion.getValue() >= EnumVersion.Version_1_3.getValue()) { appendAnchor(null); } return(base.init()); }
/// /// <summary> * overrides the deprecated method JDFElement.getVersion() /// * </summary> /// * <seealso cref= org.cip4.jdflib.core.JDFElement#getVersion() /// * @return </seealso> /// public new EnumVersion getVersion() { return(EnumVersion.getEnum(getAttribute(AttributeName.VERSION, null, null))); }
public override void setVersion(EnumVersion enumVar) { setAttribute(AttributeName.VERSION, enumVar.getName(), null); }
/// /// <summary> * set MaxVersion to enumVer /// * </summary> /// * <param name="enumVer"> the EnumVersion to set </param> /// public override void setMaxVersion(EnumVersion enumVer) { setAttribute(AttributeName.MAXVERSION, enumVer.getName(), null); }
/// /// <summary> * version fixing routine for JDF /// * /// * uses heuristics to modify this element and its children to be compatible with a given version in general, it will /// * be able to move from low to high versions but potentially fail when attempting to move from higher to lower /// * versions /// * </summary> /// * <param name="version"> : version that the resulting element should correspond to </param> /// * <returns> true if successful </returns> /// public override bool fixVersion(EnumVersion version) { if (version != null) { int @value = version.getValue(); if (@value >= EnumVersion.Version_1_3.getValue()) { appendAnchor(null); } else { removeAttribute(AttributeName.ID); // TODO fix agentname and agentversion } string author = getAuthor(); if (@value <= EnumVersion.Version_1_1.getValue()) { string tmp = getAgentName(); bool b = false; if (tmp.Length != 0) { author += "_|_" + tmp; b = true; } tmp = getAgentVersion(); if (tmp.Length != 0) { if (!b) { author += "_|_ "; } author += "_|_" + tmp; b = true; } removeAttribute(AttributeName.AGENTNAME); removeAttribute(AttributeName.AGENTVERSION); if (b) { setAuthor(author); } } else if (author.Length > 0) // version>=1.2 and has author { VString tokens = new VString(StringUtil.tokenize(author, "_|_", false)); if (tokens.Count == 3) { // it was previously fixed string tmp = tokens.stringAt(0); if (!tmp.Equals(JDFConstants.EMPTYSTRING) && !tmp.Equals(JDFConstants.BLANK)) { setAuthor(tmp); } tmp = tokens.stringAt(1); if (!tmp.Equals(JDFConstants.EMPTYSTRING) && !tmp.Equals(JDFConstants.BLANK)) { setAgentName(tmp); } tmp = tokens.stringAt(2); if (!tmp.Equals(JDFConstants.EMPTYSTRING) && !tmp.Equals(JDFConstants.BLANK)) { setAgentVersion(tmp); } } } } return(base.fixVersion(version)); }
static JDFAutoJMF() { atrInfoTable[0] = new AtrInfoTable(AttributeName.DEVICEID, 0x33333333, AttributeInfo.EnumAttributeType.shortString, null, null); atrInfoTable[1] = new AtrInfoTable(AttributeName.ICSVERSIONS, 0x33333111, AttributeInfo.EnumAttributeType.NMTOKENS, null, null); atrInfoTable[2] = new AtrInfoTable(AttributeName.MAXVERSION, 0x33333111, AttributeInfo.EnumAttributeType.JDFJMFVersion, EnumVersion.getEnum(0), null); atrInfoTable[3] = new AtrInfoTable(AttributeName.RESPONSEURL, 0x33333311, AttributeInfo.EnumAttributeType.URL, null, null); atrInfoTable[4] = new AtrInfoTable(AttributeName.SENDERID, 0x22222222, AttributeInfo.EnumAttributeType.shortString, null, null); atrInfoTable[5] = new AtrInfoTable(AttributeName.TIMESTAMP, 0x22222222, AttributeInfo.EnumAttributeType.dateTime, null, null); atrInfoTable[6] = new AtrInfoTable(AttributeName.VERSION, 0x22222222, AttributeInfo.EnumAttributeType.JDFJMFVersion, null, null); elemInfoTable[0] = new ElemInfoTable(ElementName.COMMAND, 0x33333333); elemInfoTable[1] = new ElemInfoTable(ElementName.ACKNOWLEDGE, 0x33333333); elemInfoTable[2] = new ElemInfoTable(ElementName.RESPONSE, 0x33333333); elemInfoTable[3] = new ElemInfoTable(ElementName.SIGNAL,0x33333333); elemInfoTable[4] = new ElemInfoTable(ElementName.QUERY,0x33333333); elemInfoTable[5] = new ElemInfoTable(ElementName.REGISTRATION,0x33333333); }
// --------------------------------------------------------------------- // Methods for Attribute MaxVersion // --------------------------------------------------------------------- /// /// <summary> * (5) set attribute MaxVersion </summary> /// * <param name="enumVar">: the enumVar to set the attribute to </param> /// public virtual void setMaxVersion(EnumVersion enumVar) { setAttribute(AttributeName.MAXVERSION, enumVar == null ? null : enumVar.getName(), null); }
static JDFAutoAncestor() { atrInfoTable[0] = new AtrInfoTable(AttributeName.ACTIVATION, 0x33333333, AttributeInfo.EnumAttributeType.enumeration, EnumActivation.getEnum(0), null); atrInfoTable[1] = new AtrInfoTable(AttributeName.FILENAME, 0x33333333, AttributeInfo.EnumAttributeType.URL, null, null); atrInfoTable[2] = new AtrInfoTable(AttributeName.ICSVERSIONS, 0x33333311, AttributeInfo.EnumAttributeType.NMTOKENS, null, null); atrInfoTable[3] = new AtrInfoTable(AttributeName.JOBID, 0x33333333, AttributeInfo.EnumAttributeType.shortString, null, null); atrInfoTable[4] = new AtrInfoTable(AttributeName.JOBPARTID, 0x33333333, AttributeInfo.EnumAttributeType.shortString, null, null); atrInfoTable[5] = new AtrInfoTable(AttributeName.MAXVERSION, 0x33333311, AttributeInfo.EnumAttributeType.JDFJMFVersion, EnumVersion.getEnum(0), null); atrInfoTable[6] = new AtrInfoTable(AttributeName.NODEID, 0x22222222, AttributeInfo.EnumAttributeType.NMTOKEN, null, null); atrInfoTable[7] = new AtrInfoTable(AttributeName.PROJECTID, 0x33333333, AttributeInfo.EnumAttributeType.shortString, null, null); atrInfoTable[8] = new AtrInfoTable(AttributeName.RELATEDJOBID, 0x33333311, AttributeInfo.EnumAttributeType.shortString, null, null); atrInfoTable[9] = new AtrInfoTable(AttributeName.RELATEDJOBPARTID, 0x33333311, AttributeInfo.EnumAttributeType.shortString, null, null); atrInfoTable[10] = new AtrInfoTable(AttributeName.SPAWNID, 0x33333331, AttributeInfo.EnumAttributeType.shortString, null, null); atrInfoTable[11] = new AtrInfoTable(AttributeName.STATUS, 0x33333333, AttributeInfo.EnumAttributeType.enumeration, EnumNodeStatus.getEnum(0), null); atrInfoTable[12] = new AtrInfoTable(AttributeName.STATUSDETAILS, 0x33333311, AttributeInfo.EnumAttributeType.shortString, null, null); atrInfoTable[13] = new AtrInfoTable(AttributeName.TEMPLATE, 0x33333331, AttributeInfo.EnumAttributeType.boolean_, null, "false"); atrInfoTable[14] = new AtrInfoTable(AttributeName.TEMPLATEID, 0x33333311, AttributeInfo.EnumAttributeType.shortString, null, null); atrInfoTable[15] = new AtrInfoTable(AttributeName.TEMPLATEVERSION, 0x33333311, AttributeInfo.EnumAttributeType.string_, null, null); atrInfoTable[16] = new AtrInfoTable(AttributeName.TYPE, 0x33333333, AttributeInfo.EnumAttributeType.NMTOKEN, null, null); atrInfoTable[17] = new AtrInfoTable(AttributeName.TYPES, 0x33333333, AttributeInfo.EnumAttributeType.NMTOKENS, null, null); atrInfoTable[18] = new AtrInfoTable(AttributeName.VERSION, 0x33333333, AttributeInfo.EnumAttributeType.JDFJMFVersion, null, null); elemInfoTable[0] = new ElemInfoTable(ElementName.CUSTOMERINFO, 0x66666661); elemInfoTable[1] = new ElemInfoTable(ElementName.NODEINFO, 0x66666661); }
/// /// <summary> * (9) get attribute MaxVersion </summary> /// * <returns> the value of the attribute </returns> /// public virtual EnumVersion getMaxVersion() { return(EnumVersion.getEnum(getAttribute(AttributeName.MAXVERSION, null, null))); }