private static Element handleMetaproperty(Element propertyElement){
String uriAttribute=propertyElement.getAttributeValue("uri");
String classAttribute=propertyElement.getAttributeValue("class");
String label=propertyElement.getChild("label", fresnelNS).getChildTextTrim("title", fresnelNS);
URI pURI=new URIImpl(uriAttribute);
Element tableRow=new Element("tr")
.setAttribute("style","padding: 0px; margin: 0px; border: 0px;");
Element property=new Element("div")
.setAttribute("class", "property-div")
.setAttribute("style", "overflow: hidden;")
.addContent(new Element("span")
.setAttribute("style","vertical-align: top; margin: 0px; padding: 0px;")
.addContent(new Element("table")
.setAttribute("style","border: 0px; width: 100%; padding: 0px; margin: 0px; border-spacing: 0px;")
.addContent(tableRow)));
if (classAttribute!=null) {
property.setAttribute("style", property.getAttributeValue("style")+";"+classAttribute);
}
// add label
// div holding the label text
Element labelDiv=new Element("div")
.setAttribute("style","cursor: help;")
.setAttribute("class","tooltip")
.setAttribute("title","Property: "+pURI.stringValue());
if (label!=null && !label.trim().equals("")) {
labelDiv.setText(label);
} else {
labelDiv.setText(pURI.getLocalName());
}
// td holding the labelDiv
Element labelElement=new Element("td")
.setAttribute("style","width: 35%; vertical-align: top; padding: 0px; margin: 0px; border: 0px;")
.addContent(labelDiv);
// add td holding label to row
tableRow.addContent(labelElement);
// add values
Element valuesElement=new Element("td")
.setAttribute("style","width: *; vertical-align: top; padding: 0px; margin: 0px; border: 0px;");
// get Content before/after declarations for value
String beforeText="",afterText="";
try {
//Element before=(Element) XPath.selectSingleNode(propertyElement, "//content/before");
Element before=propertyElement
.getChild("values", fresnelNS)
.getChild("content", fresnelNS)
.getChild("before", fresnelNS);
if (before != null) {
beforeText=before.getTextTrim();
}
} catch (NullPointerException e1) {//(JDOMException e1) {
//e1.printStackTrace();
}
try {
//Element after=(Element) XPath.selectSingleNode(propertyElement, "//content/after");
Element after=propertyElement
.getChild("values", fresnelNS)
.getChild("content", fresnelNS)
.getChild("after", fresnelNS);
if (after !=null) {
afterText=after.getTextTrim();
}
} catch (NullPointerException e1) {//(JDOMException e1) {
//e1.printStackTrace();
}
Element values=new Element("div");
List<Element> valuesData=propertyElement.getChild("values",fresnelNS).getChildren("value",fresnelNS);
for (Element value:valuesData) {
values.addContent(beforeText);
String text=value.getChildTextTrim("title", fresnelNS);
String outputType=value.getAttributeValue("output-type");
if (outputType!=null) {
if (outputType.equals("http://www.w3.org/2004/09/fresnel#externalLink")) {
values.addContent(new Element("a")
.setAttribute("href", text)
.setText(text));
} else if (outputType.equals("http://www.w3.org/2004/09/fresnel#image")) {
values.addContent(new Element("img")
.setAttribute("src", text));
} else {
//NEW: take out unknown output-type
values.addContent(text);//+"(unknown output-type: "+outputType+")");
}
} else {
try {
URI textURI=new URIImpl(text);
values.addContent(new Element("a")
.setAttribute("href", text)
.setText(text));
String uriEncoded=URLEncoder.encode(textURI.stringValue(), "UTF-8");
values.addContent(new Element("a")
.setAttribute("onclick", "setHrefs()")
.setAttribute("href", "?resource="+uriEncoded)
.setAttribute("class", "tooltip")
.setAttribute("title","Lens: DEFAULT :: Resource: "+textURI)