Esempio n. 1
0
  @Override
  protected void setRootProperties(Element rootElement, Document doc) {
    String attributeName = "published";
    String attributeValue = "true";
    XmlElementsBuilder.addAttributeToElement(rootElement, doc, attributeName, attributeValue);

    attributeName = "identification";
    attributeValue = "title";
    XmlElementsBuilder.addAttributeToElement(rootElement, doc, attributeName, attributeValue);

    attributeName = "current";
    attributeValue = "true";
    XmlElementsBuilder.addAttributeToElement(rootElement, doc, attributeName, attributeValue);
  }
Esempio n. 2
0
  @Override
  protected void addElementsToRoot(Document doc, Element rootElement) {
    Element tempElement = null;

    Properties prop = PropertiesGetter.getInstance();

    tempElement = XmlElementsBuilder.addElement("title", rootElement, doc);
    XmlElementsBuilder.addAttributeToElement(tempElement, doc, LOCALE_NAME, LOCALE_VALUE_PT_BR);
    XmlElementsBuilder.addTextNodeToElement(
        tempElement, doc, prop.getProperty(PropertiesConfig.getPropertyTitleName()));

    tempElement = XmlElementsBuilder.addElement("description", rootElement, doc);
    XmlElementsBuilder.addAttributeToElement(tempElement, doc, LOCALE_NAME, LOCALE_VALUE_PT_BR);
    XmlElementsBuilder.addTextNodeToElement(
        tempElement, doc, prop.getProperty(PropertiesConfig.getPropertyDescriptionName()));

    tempElement = XmlElementsBuilder.addElement("volume", rootElement, doc);
    XmlElementsBuilder.addTextNodeToElement(
        tempElement, doc, prop.getProperty(PropertiesConfig.getPropertyXmlIssueVolume()));
    tempElement = XmlElementsBuilder.addElement("number", rootElement, doc);
    XmlElementsBuilder.addTextNodeToElement(
        tempElement, doc, prop.getProperty(PropertiesConfig.getPropertyXmlIssueNumber()));
    tempElement = XmlElementsBuilder.addElement("year", rootElement, doc);
    XmlElementsBuilder.addTextNodeToElement(
        tempElement, doc, prop.getProperty(PropertiesConfig.getPropertyXmlIssueYear()));
    XmlElementsBuilder.addElement("open_access", rootElement, doc);

    BuildSection buildSection = new BuildSection();
    for (Section section : sections) {
      buildSection.build(doc, rootElement, section);
    }
  }