Changeset 4874


Ignore:
Timestamp:
Apr 2, 2009, 12:40:35 PM (13 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1286: Add support of id-base attribute to extension xml files

Location:
trunk/src/core/net/sf/basedb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/net/sf/basedb/core/xsd/extensions.xsd

    r4516 r4874  
    6464        </xsd:element>
    6565      </xsd:sequence>
     66      <xsd:attribute name="id-base" type="xsd:ID" use="optional" />
    6667    </xsd:complexType>
    6768  </xsd:element>
  • trunk/src/core/net/sf/basedb/util/extensions/xml/XmlLoader.java

    r4515 r4874  
    486486    Element root = dom.getRootElement();
    487487    Namespace ns = root.getNamespace();
     488    // ID base will be prepended to extension point id:s if defined
     489    String idBase = Values.getStringOrNull(root.getAttributeValue("id-base"));
     490   
    488491    List<Element> epTags = root.getChildren("extension-point", ns);
    489492    for (Element epTag : epTags)
     
    495498      // Set ID (required)
    496499      String id = Values.getStringOrNull(epTag.getAttributeValue("id"));
     500      if (idBase != null) id = idBase + id;
    497501      extensionPoint.setId(id);
    498502     
     
    565569    Element root = dom.getRootElement();
    566570    Namespace ns = root.getNamespace();
     571    // ID base will be prepended to extension point id:s if defined
     572    String idBase = Values.getStringOrNull(root.getAttributeValue("id-base"));
     573
    567574    List<Element> epTags = root.getChildren("extension", ns);
    568575    for (Element epTag : epTags)
     
    574581      // Set ID (required)
    575582      String id = Values.getStringOrNull(epTag.getAttributeValue("id"));
     583      if (idBase != null) id = idBase + id;
    576584      ext.setId(id);
    577585     
Note: See TracChangeset for help on using the changeset viewer.