Java Code Examples for org.dom4j.tree.DefaultElement#attributeValue()

The following examples show how to use org.dom4j.tree.DefaultElement#attributeValue() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CPResource.java    From olat with Apache License 2.0 5 votes vote down vote up
/**
 * this constructor is needed when building up the datamodel (parsing XML-manifest)
 * 
 * @param me
 */
public CPResource(final DefaultElement me) {
    super(me.getName());
    files = new Vector<CPFile>();
    dependencies = new Vector<CPDependency>();

    // setAttributes(me.attributes());
    setContent(me.content());

    this.identifier = me.attributeValue(CPCore.IDENTIFIER);
    this.type = me.attributeValue(CPCore.TYPE);
    this.href = me.attributeValue(CPCore.HREF);
    this.xmlbase = me.attributeValue(CPCore.BASE, "");

}
 
Example 2
Source File: CPOrganization.java    From olat with Apache License 2.0 5 votes vote down vote up
/**
 * this constructor is used when the cp is built (parsing XML manifest file)
 * 
 * @param me
 */
CPOrganization(final DefaultElement me) {
    super(me.getName());
    items = new Vector<CPItem>();
    errors = new Vector<String>();
    setAttributes(me.attributes());
    setContent(me.content());

    this.identifier = me.attributeValue(CPCore.IDENTIFIER);
    this.structure = me.attributeValue(CPCore.STRUCTURE, "hierarchical");
    // this.title = me.

}
 
Example 3
Source File: CPItem.java    From olat with Apache License 2.0 5 votes vote down vote up
/**
 * constructor is needed while building the datamodel-tree (parsing XML)
 * 
 * @param me
 */
public CPItem(final DefaultElement me, final DefaultElement parent) {
    super(me.getName());
    items = new Vector<CPItem>();
    errors = new Vector<String>();

    // setAttributes(me.attributes());
    setContent(me.content());
    this.parent = parent;
    this.identifier = me.attributeValue(CPCore.IDENTIFIER);
    this.identifierRef = me.attributeValue(CPCore.IDENTIFIERREF, "");

    final String val = me.attributeValue(CPCore.ISVISIBLE, "true");
    this.visible = (val != null && val.equals("true"));
}
 
Example 4
Source File: CPFile.java    From olat with Apache License 2.0 5 votes vote down vote up
/**
 * Constructor, used when building up the cp (parsing XML-manifest)
 * 
 * @param me
 * @param xmlBase
 *            xmlBase-attribute of the parental resource-element
 * @param packageFolder
 *            TODO
 */
public CPFile(final DefaultElement me, final String xmlBase, final VFSContainer rootDir) {
    super(me.getName());
    setContent(me.content());
    this.href = me.attributeValue(CPCore.HREF);
    if (xmlBase.equals("")) {
        file = (VFSLeaf) rootDir.resolve(href);
    } else {
        file = (VFSLeaf) rootDir.resolve(xmlBase + "/" + href);
    }
}
 
Example 5
Source File: CPManifest.java    From olat with Apache License 2.0 5 votes vote down vote up
/**
 * this constructor is used when building up the cp (parsing XML)
 * 
 * @param me
 */
public CPManifest(final CPCore cp, final DefaultElement me) {
    super(me.getName());
    errors = new Vector<String>();
    this.identifier = me.attributeValue(CPCore.IDENTIFIER);
    this.schemaLocation = me.attributeValue(CPCore.SCHEMALOCATION);
    this.setNamespace(me.getNamespace());
    this.cp = cp;
    // FIXME: namespaces ! xmlns
    setContent(me.content());
}
 
Example 6
Source File: CPDependency.java    From olat with Apache License 2.0 5 votes vote down vote up
/**
 * this constructor is neeeded when building up the cp (parsing XML manifest file)
 * 
 * @param me
 */
public CPDependency(final DefaultElement me) {
    super(me.getName());
    identifierRef = me.attributeValue(CPCore.IDENTIFIERREF);
    if (identifierRef.equals(null)) {
        throw new OLATRuntimeException(CPOrganizations.class, "Invalid IMS-Manifest ( <dependency> element without identifierref )", new Exception());
    }
}
 
Example 7
Source File: CPResource.java    From olat with Apache License 2.0 5 votes vote down vote up
/**
 * this constructor is needed when building up the datamodel (parsing XML-manifest)
 * 
 * @param me
 */
public CPResource(final DefaultElement me) {
    super(me.getName());
    files = new Vector<CPFile>();
    dependencies = new Vector<CPDependency>();

    // setAttributes(me.attributes());
    setContent(me.content());

    this.identifier = me.attributeValue(CPCore.IDENTIFIER);
    this.type = me.attributeValue(CPCore.TYPE);
    this.href = me.attributeValue(CPCore.HREF);
    this.xmlbase = me.attributeValue(CPCore.BASE, "");

}
 
Example 8
Source File: CPOrganization.java    From olat with Apache License 2.0 5 votes vote down vote up
/**
 * this constructor is used when the cp is built (parsing XML manifest file)
 * 
 * @param me
 */
CPOrganization(final DefaultElement me) {
    super(me.getName());
    items = new Vector<CPItem>();
    errors = new Vector<String>();
    setAttributes(me.attributes());
    setContent(me.content());

    this.identifier = me.attributeValue(CPCore.IDENTIFIER);
    this.structure = me.attributeValue(CPCore.STRUCTURE, "hierarchical");
    // this.title = me.

}
 
Example 9
Source File: CPItem.java    From olat with Apache License 2.0 5 votes vote down vote up
/**
 * constructor is needed while building the datamodel-tree (parsing XML)
 * 
 * @param me
 */
public CPItem(final DefaultElement me, final DefaultElement parent) {
    super(me.getName());
    items = new Vector<CPItem>();
    errors = new Vector<String>();

    // setAttributes(me.attributes());
    setContent(me.content());
    this.parent = parent;
    this.identifier = me.attributeValue(CPCore.IDENTIFIER);
    this.identifierRef = me.attributeValue(CPCore.IDENTIFIERREF, "");

    final String val = me.attributeValue(CPCore.ISVISIBLE, "true");
    this.visible = (val != null && val.equals("true"));
}
 
Example 10
Source File: CPFile.java    From olat with Apache License 2.0 5 votes vote down vote up
/**
 * Constructor, used when building up the cp (parsing XML-manifest)
 * 
 * @param me
 * @param xmlBase
 *            xmlBase-attribute of the parental resource-element
 * @param packageFolder
 *            TODO
 */
public CPFile(final DefaultElement me, final String xmlBase, final VFSContainer rootDir) {
    super(me.getName());
    setContent(me.content());
    this.href = me.attributeValue(CPCore.HREF);
    if (xmlBase.equals("")) {
        file = (VFSLeaf) rootDir.resolve(href);
    } else {
        file = (VFSLeaf) rootDir.resolve(xmlBase + "/" + href);
    }
}
 
Example 11
Source File: CPManifest.java    From olat with Apache License 2.0 5 votes vote down vote up
/**
 * this constructor is used when building up the cp (parsing XML)
 * 
 * @param me
 */
public CPManifest(final CPCore cp, final DefaultElement me) {
    super(me.getName());
    errors = new Vector<String>();
    this.identifier = me.attributeValue(CPCore.IDENTIFIER);
    this.schemaLocation = me.attributeValue(CPCore.SCHEMALOCATION);
    this.setNamespace(me.getNamespace());
    this.cp = cp;
    // FIXME: namespaces ! xmlns
    setContent(me.content());
}
 
Example 12
Source File: CPDependency.java    From olat with Apache License 2.0 5 votes vote down vote up
/**
 * this constructor is neeeded when building up the cp (parsing XML manifest file)
 * 
 * @param me
 */
public CPDependency(final DefaultElement me) {
    super(me.getName());
    identifierRef = me.attributeValue(CPCore.IDENTIFIERREF);
    if (identifierRef.equals(null)) {
        throw new OLATRuntimeException(CPOrganizations.class, "Invalid IMS-Manifest ( <dependency> element without identifierref )", new Exception());
    }
}