/// /// * <param name="action"> </param> /// * <param name="groupMap"> /// * @return </param> /// public virtual JDFPRItem getCreatePRItem(JDFAction action, JDFAttributeMap groupMap) { JDFPRItem pi = getPRItem(action, null); if (pi == null) { pi = appendPRItem(); pi.setActionRef(action.getID()); } pi.getCreatePRGroup(groupMap); return(pi); }
/// /// * <param name="action"> /// * @return </param> /// private JDFPRItem getPRItem(JDFAction action, JDFAttributeMap groupMap) { string id = action == null ? null : action.getID(); JDFAttributeMap map = (id == null) ? null : new JDFAttributeMap("ActionRef", id); JDFPRItem pi = (JDFPRItem)getChildByTagName(ElementName.PRITEM, null, 0, map, true, true); if (groupMap != null && pi != null) { JDFPRGroup pg = pi.getPRGroup(groupMap); if (pg == null) { return(null); } } return(pi); }
public virtual void testInsertPageSet() { JDFDoc d = new JDFDoc("PRItem"); JDFPRItem pi = (JDFPRItem)d.getRoot(); pi.insertPageSet(3); Assert.AreEqual("3", pi.getAttribute(AttributeName.PAGESET)); pi.insertPageSet(3); Assert.AreEqual("3", pi.getAttribute(AttributeName.PAGESET)); pi.insertPageSet(5); Assert.AreEqual("3 5", pi.getAttribute(AttributeName.PAGESET)); pi.insertPageSet(2); Assert.AreEqual("2 ~ 3 5", pi.getAttribute(AttributeName.PAGESET)); pi.insertPageSet(4); Assert.AreEqual("2 ~ 5", pi.getAttribute(AttributeName.PAGESET)); }
public virtual JDFPRItem setPR(JDFAction action, int pageSet, JDFAttributeMap prMap, VString groupBy) { JDFAttributeMap groupMap = null; JDFAttributeMap instanceMap = null; if (prMap != null) { groupMap = new JDFAttributeMap(prMap); SupportClass.SetSupport <string> @set = groupBy.getSet(); groupMap.reduceMap(@set); instanceMap = new JDFAttributeMap(prMap); instanceMap.removeKeys(@set); } JDFPRItem pi = getCreatePRItem(action, groupMap); JDFPRGroup pg = pi.getCreatePRGroup(groupMap); JDFPROccurrence pgInstance = pg.getCreatePROccurrence(instanceMap); pgInstance.addOccurrences(1, action.getSeverity()); pi.insertPageSet(pageSet); return(pi); }