return map;
}
private PluginEntity readPluginConfig(WarItem zipItem)
throws UnsupportedEncodingException, DocumentException {
PluginEntity result = new PluginEntity();
Element root = DocumentHelper.parseText(zipItem.data.toString("UTF-8"))
.getRootElement();
result.setName(root.elementText("name"));
result.setTitle(root.elementText("title"));
result.setVersion(root.elementText("version"));
result.setDescription(root.elementText("description"));
result.setWebsite(root.elementText("website"));
if (root.element("entry-point-class") != null) {
result.setEntryPointClass(StringUtils.strip(
root.elementText("entry-point-class")));
}
if (root.element("plugin-config-url") != null) {
result.setConfigURL(StringUtils.strip(
root.elementText("plugin-config-url")));
}
StringBuffer header = new StringBuffer();
if (root.element("header-javascript") != null) {
for (Element e : (List<Element>)root.elements("header-javascript")) {
header.append("<script type=\"text/javascript\" src=\"/file/plugins/")
.append(result.getName()).append("/").append(e.getText())
.append("\"></script>\n");
}
}
if (root.element("header-css") != null) {
for (Element e : (List<Element>)root.elements("header-css")) {
header.append("<link rel=\"stylesheet\" type=\"text/css\" href=\"/file/plugins/")
.append(result.getName()).append("/").append(e.getText())
.append("\"/>\n");
}
}
result.setPageHeader(header.toString());
if (root.element("config") != null) {
result.setConfigStructure(root.element("config").asXML());
}
return result;
}