public static Component getComponentById( org.opendope.components.Components components, String id) { for (Component c : components.getComponent() ) { if (c.getId().equals(id)) return c; } throw new InputIntegrityException("No component with id " + id ); }
log.warn(iie.getMessage());
throw new Docx4JException(iie.getMessage(), iie);
/** * For performance reasons, avoid using this if you have a lot of xpaths * @param xpaths * @param id * @return */ public static Xpath getXPathById(org.opendope.xpaths.Xpaths xpaths, String id) { for (Xpath x : xpaths.getXpath() ) { if (x.getId().equals(id)) return x; } throw new InputIntegrityException("Couldn't find xpath " + id ); }
log.warn(iie.getMessage());
/** * For performance reasons, avoid using this method if you have a lot of Conditions * * @param conditions * @param id * @return */ public static Condition getConditionById( org.opendope.conditions.Conditions conditions, String id) { for (Condition c : conditions.getCondition() ) { if (c.getId().equals(id)) return c; } throw new InputIntegrityException("No Condition with id " + id ); }
throw new Docx4JException(iie.getMessage(), iie);
public static Xpath getXPathByQuestionId(org.opendope.xpaths.Xpaths xpaths, String id) { for (Xpath x : xpaths.getXpath() ) { if (x.getQuestionID()!=null && x.getQuestionID().equals(id)) return x; } throw new InputIntegrityException("No XPath with question id " + id ); }
public static Question getQuestionById( org.opendope.questions.Questionnaire questionnaire, String id) { for (Question qu : questionnaire.getQuestions().getQuestion() ) { if (qu.getId().equals(id)) return qu; } throw new InputIntegrityException("No question with id " + id ); }
throw new InputIntegrityException("Couldn't locate part by storeItemId " + storeItemId); log.error(e.getMessage(), e); throw new InputIntegrityException(e.getMessage());
private void processDescendantCondition(Object sdt, String xpathBase, int index, Tag tag ) { Condition c = null; HashMap<String, String> map = QueryString.parseQueryString( tag.getVal(), true); String conditionId = map.get(BINDING_ROLE_CONDITIONAL); if (conditionId != null) { //c = ConditionsPart.getConditionById(conditions, conditionId); c = conditionsMap.get(conditionId); if (c == null) { log.error("Missing condition " + conditionId); throw new InputIntegrityException("Required condition '" + conditionId + "' is missing"); } // TODO: this code assumes the condition contains // a simple xpath if(log.isDebugEnabled()) { log.debug("Using condition" + XmlUtils.marshaltoString(c, true, true)); } Condition newCondition = c.repeat(xpathBase, index, conditionsMap, xpathsMap); // set sdt to use it map.put(BINDING_ROLE_CONDITIONAL, newCondition.getId() ); tag.setVal(QueryString.create(map)); } }
/** * Workaround for the fact that Xalan doesn't let us pass an AtomicInteger into an extension * function. Instead, it converts it into an int, which means the object in our * bookmarkIdCounter parameter isn't updated. * * So here we wrap the AtomicInteger in a class, * * @author jharrop * */ public static class BookmarkCounter { protected AtomicInteger bookmarkId; BookmarkCounter(AtomicInteger bookmarkId) { this.bookmarkId = bookmarkId; } }
public static Component getComponentById( org.opendope.components.Components components, String id) { for (Component c : components.getComponent() ) { if (c.getId().equals(id)) return c; } throw new InputIntegrityException("No component with id " + id ); }
/** * For performance reasons, avoid using this if you have a lot of xpaths * @param xpaths * @param id * @return */ public static Xpath getXPathById(org.opendope.xpaths.Xpaths xpaths, String id) { for (Xpath x : xpaths.getXpath() ) { if (x.getId().equals(id)) return x; } throw new InputIntegrityException("Couldn't find xpath " + id ); }
/** * For performance reasons, avoid using this method if you have a lot of Conditions * * @param conditions * @param id * @return */ public static Condition getConditionById( org.opendope.conditions.Conditions conditions, String id) { for (Condition c : conditions.getCondition() ) { if (c.getId().equals(id)) return c; } throw new InputIntegrityException("No Condition with id " + id ); }
public static Question getQuestionById( org.opendope.questions.Questionnaire questionnaire, String id) { for (Question qu : questionnaire.getQuestions().getQuestion() ) { if (qu.getId().equals(id)) return qu; } throw new InputIntegrityException("No question with id " + id ); }
public static Xpath getXPathByQuestionId(org.opendope.xpaths.Xpaths xpaths, String id) { for (Xpath x : xpaths.getXpath() ) { if (x.getQuestionID()!=null && x.getQuestionID().equals(id)) return x; } throw new InputIntegrityException("No XPath with question id " + id ); }
throw new InputIntegrityException("Couldn't locate part by storeItemId " + storeItemId); log.error(e.getMessage(), e); throw new InputIntegrityException(e.getMessage());
private void processDescendantCondition(Object sdt, String xpathBase, int index, Tag tag ) { Condition c = null; HashMap<String, String> map = QueryString.parseQueryString( tag.getVal(), true); String conditionId = map.get(BINDING_ROLE_CONDITIONAL); if (conditionId != null) { //c = ConditionsPart.getConditionById(conditions, conditionId); c = conditionsMap.get(conditionId); if (c == null) { log.error("Missing condition " + conditionId); throw new InputIntegrityException("Required condition '" + conditionId + "' is missing"); } // TODO: this code assumes the condition contains // a simple xpath if(log.isDebugEnabled()) { log.debug("Using condition" + XmlUtils.marshaltoString(c, true, true)); } Condition newCondition = c.repeat(xpathBase, index, conditionsMap, xpathsMap); // set sdt to use it map.put(BINDING_ROLE_CONDITIONAL, newCondition.getId() ); tag.setVal(QueryString.create(map)); } }
/** * Workaround for the fact that Xalan doesn't let us pass an AtomicInteger into an extension * function. Instead, it converts it into an int, which means the object in our * bookmarkIdCounter parameter isn't updated. * * So here we wrap the AtomicInteger in a class, * * @author jharrop * */ public static class BookmarkCounter { protected AtomicInteger bookmarkId; BookmarkCounter(AtomicInteger bookmarkId) { this.bookmarkId = bookmarkId; } }