Verschiedener Kleinkram, hauptsächlich Formatierungen und @Override-Annotiationen
git-svn-id: https://svn.libreccm.org/ccm/trunk@2142 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
0c7dca5463
commit
50bb1a275b
|
|
@ -42,17 +42,13 @@ import org.w3c.dom.Attr;
|
||||||
*/
|
*/
|
||||||
public class Element {
|
public class Element {
|
||||||
|
|
||||||
private static final Logger s_log = Logger.getLogger
|
private static final Logger s_log = Logger.getLogger(Element.class.getName());
|
||||||
(Element.class.getName());
|
|
||||||
|
|
||||||
protected org.w3c.dom.Element m_element;
|
protected org.w3c.dom.Element m_element;
|
||||||
/* DOM element that is being wrapped */
|
/* DOM element that is being wrapped */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* owner document
|
* owner document
|
||||||
*/
|
*/
|
||||||
private org.w3c.dom.Document m_doc;
|
private org.w3c.dom.Document m_doc;
|
||||||
|
|
||||||
private static ThreadLocal s_localDocument = new ThreadLocal() {
|
private static ThreadLocal s_localDocument = new ThreadLocal() {
|
||||||
@Override
|
@Override
|
||||||
public Object initialValue() {
|
public Object initialValue() {
|
||||||
|
|
@ -63,16 +59,37 @@ public class Element {
|
||||||
return builder.newDocumentBuilder().newDocument();
|
return builder.newDocumentBuilder().newDocument();
|
||||||
} catch (ParserConfigurationException e) {
|
} catch (ParserConfigurationException e) {
|
||||||
s_log.error(e);
|
s_log.error(e);
|
||||||
throw new UncheckedWrapperException
|
throw new UncheckedWrapperException("INTERNAL: Could not create thread local DOM document.", e);
|
||||||
("INTERNAL: Could not create thread local DOM document.", e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
private static org.w3c.dom.Document getDocument() {
|
private static org.w3c.dom.Document getDocument() {
|
||||||
return (org.w3c.dom.Document) s_localDocument.get();
|
return (org.w3c.dom.Document) s_localDocument.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// public org.w3c.dom.Document getOwnerDocument() {
|
||||||
|
// if (null == m_doc) {
|
||||||
|
// m_doc = (org.w3c.dom.Document) s_localDocument.get();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// return m_doc;
|
||||||
|
// }
|
||||||
|
// public void importElement(final Element element) {
|
||||||
|
// element.m_element = (org.w3c.dom.Element) this.m_element.getOwnerDocument().importNode(element.m_element, true);
|
||||||
|
// }
|
||||||
|
|
||||||
|
public void syncDocs() {
|
||||||
|
if (m_doc == null) {
|
||||||
|
m_doc = (org.w3c.dom.Document) s_localDocument.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!m_element.getOwnerDocument().equals(m_doc)) {
|
||||||
|
m_element = (org.w3c.dom.Element) m_doc.importNode(m_element, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Protected constructor to set up factories, etc. Does not actually
|
* Protected constructor to set up factories, etc. Does not actually
|
||||||
* create a new element. Used if we are programatically setting the
|
* create a new element. Used if we are programatically setting the
|
||||||
|
|
@ -175,8 +192,7 @@ public class Element {
|
||||||
}
|
}
|
||||||
|
|
||||||
Element copyTo = new Element();
|
Element copyTo = new Element();
|
||||||
copyTo.m_element = m_doc.createElementNS
|
copyTo.m_element = m_doc.createElementNS(copyFrom.m_element.getNamespaceURI(), copyFrom.getName());
|
||||||
(copyFrom.m_element.getNamespaceURI(), copyFrom.getName());
|
|
||||||
this.m_element.appendChild(copyTo.m_element);
|
this.m_element.appendChild(copyTo.m_element);
|
||||||
newChildElementHelper(copyFrom, copyTo);
|
newChildElementHelper(copyFrom, copyTo);
|
||||||
return copyTo;
|
return copyTo;
|
||||||
|
|
@ -235,6 +251,7 @@ public class Element {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds an attribute to the element.
|
* Adds an attribute to the element.
|
||||||
*
|
*
|
||||||
|
|
@ -388,7 +405,6 @@ public class Element {
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public java.util.Map getAttributes() {
|
public java.util.Map getAttributes() {
|
||||||
// Retrieve the attributes of the DOM Element
|
// Retrieve the attributes of the DOM Element
|
||||||
org.w3c.dom.NamedNodeMap attributeNodeMap =
|
org.w3c.dom.NamedNodeMap attributeNodeMap =
|
||||||
|
|
@ -431,7 +447,6 @@ public class Element {
|
||||||
return m_element.getTagName();
|
return m_element.getTagName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Functions to allow this class to interact appropriately with the
|
* Functions to allow this class to interact appropriately with the
|
||||||
* Document class (for example, allows nodes to be moved around,
|
* Document class (for example, allows nodes to be moved around,
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@
|
||||||
ccmVersion="6.1"
|
ccmVersion="6.1"
|
||||||
name="scientificcms"
|
name="scientificcms"
|
||||||
prettyName="Scientific CMS"
|
prettyName="Scientific CMS"
|
||||||
version="2-0-0"
|
version="2-1-0"
|
||||||
release="devel"
|
release="SNAPSHOT-r2136"
|
||||||
webxml="web-sci.xml"
|
webxml="web-sci.xml"
|
||||||
webapp="ROOT"
|
webapp="ROOT"
|
||||||
xsi:schemaLocation="http://ccm.redhat.com/ccm-project file:tools-ng/common/xsd/project.xsd">
|
xsi:schemaLocation="http://ccm.redhat.com/ccm-project file:tools-ng/common/xsd/project.xsd">
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ public class PublicationExtraXmlGenerator implements ExtraXMLGenerator {
|
||||||
|
|
||||||
private boolean listMode;
|
private boolean listMode;
|
||||||
|
|
||||||
|
@Override
|
||||||
public void generateXML(final ContentItem item,
|
public void generateXML(final ContentItem item,
|
||||||
final Element element,
|
final Element element,
|
||||||
final PageState state) {
|
final PageState state) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue