Class RuleTemplateXmlParser

java.lang.Object
org.kuali.rice.kew.xml.RuleTemplateXmlParser

public class RuleTemplateXmlParser extends Object
Parses RuleTemplateBos from XML.
Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
  • Constructor Details

    • RuleTemplateXmlParser

      public RuleTemplateXmlParser()
  • Method Details

    • parseRuleTemplates

      public List<RuleTemplateBo> parseRuleTemplates(InputStream input) throws IOException, XmlException
      Throws:
      IOException
      XmlException
    • parseRuleTemplates

      public List<RuleTemplateBo> parseRuleTemplates(org.jdom2.Element element) throws XmlException
      Throws:
      XmlException
    • updateRuleTemplateDefaultOptions

      protected void updateRuleTemplateDefaultOptions(org.jdom2.Element ruleTemplateElement, RuleTemplateBo updatedRuleTemplate) throws XmlException
      Updates the rule template default options. Updates any existing options, removes any omitted ones.
      Parameters:
      ruleTemplateElement - the rule template XML element
      updatedRuleTemplate - the RuleTemplate being updated
      Throws:
      XmlException
    • updateRuleTemplateOptions

      protected void updateRuleTemplateOptions(org.jdom2.Element defaultsElement, RuleTemplateBo updatedRuleTemplate, boolean isDelegation) throws XmlException
      Updates the rule template defaults options with those in the defaults element
      Parameters:
      defaultsElement - the ruleDefaults element
      updatedRuleTemplate - the Rule Template being updated
      Throws:
      XmlException
    • updateRuleDefaults

      protected boolean updateRuleDefaults(org.jdom2.Element defaultsElement, RuleTemplateBo updatedRuleTemplate) throws XmlException
      Updates the default/template rule options with those in the defaults element
      Parameters:
      defaultsElement - the ruleDefaults element
      updatedRuleTemplate - the Rule Template being updated
      Returns:
      whether this is a delegation rule template
      Throws:
      XmlException
    • updateOrDeleteRuleTemplateOption

      protected void updateOrDeleteRuleTemplateOption(RuleTemplateBo updatedRuleTemplate, String key, Object value)
      Updates or deletes a specified rule template option on the rule template
      Parameters:
      updatedRuleTemplate - the RuleTemplate being updated
      key - the option key
      value - the option value
    • updateDelegationTemplate

      protected void updateDelegationTemplate(org.jdom2.Element ruleTemplateElement, RuleTemplateBo updatedRuleTemplate, List<RuleTemplateBo> parsedRuleTemplates) throws XmlException
      Updates the rule template delegation template with the one specified in the XML (if any)
      Parameters:
      ruleTemplateElement - the XML ruleTemplate element
      updatedRuleTemplate - the rule template to update
      parsedRuleTemplates - the rule templates parsed in this parsing run
      Throws:
      XmlException - if a delegation template was specified but could not be found
    • updateRuleTemplateAttributes

      protected void updateRuleTemplateAttributes(org.jdom2.Element ruleTemplateElement, RuleTemplateBo updatedRuleTemplate) throws XmlException
      Updates the attributes set on the RuleTemplate
      Parameters:
      ruleTemplateElement - the XML ruleTemplate element
      updatedRuleTemplate - the RuleTemplate being updated
      Throws:
      XmlException - if there was a problem parsing the rule template attributes
    • formatDate

      public Timestamp formatDate(String dateLabel, String dateString) throws XmlException
      Throws:
      XmlException