Browse Source

Neue XML Elemente für KERN 5.2 #7

master
Daniel Quathamer 1 month ago
parent
commit
9c0112ff58
  1. 18
      src/de/superx/common/Maske.java
  2. 47
      src/de/superx/servlet/ServletUtils.java
  3. 8
      src/de/superx/servlet/Themenbaum.java
  4. 2
      superx/edit/kern/webapp_manager.jsp

18
src/de/superx/common/Maske.java

@ -870,6 +870,7 @@ public class Maske extends NamedIdObject implements Serializable { @@ -870,6 +870,7 @@ public class Maske extends NamedIdObject implements Serializable {
result.append("<UserID admin=\"" + (user.isAdmin() ? "true" : "false") + "\">" + user.getId().toString()
+ "</UserID>\n");
result.append(addGeneralInfo());
result.append(ServletUtils.addCustomElementsToXml(mandantenID));
if (user != null) {
result.append(user.getThemenbaum().getMenupath(this.getId().toString()));
if (showNavigation) {
@ -1063,6 +1064,7 @@ public class Maske extends NamedIdObject implements Serializable { @@ -1063,6 +1064,7 @@ public class Maske extends NamedIdObject implements Serializable {
// link back to home page
addBacklink(request, result);
result.append(addGeneralInfo());
result.append(ServletUtils.addCustomElementsToXml(mandantenID));
result.append(getStylesheetXml());
result.append(getMaskResult(user, request, dbCon));
result.append("</ergebnisse>\n");
@ -2030,6 +2032,22 @@ public class Maske extends NamedIdObject implements Serializable { @@ -2030,6 +2032,22 @@ public class Maske extends NamedIdObject implements Serializable {
"Hinzufügen von " + key + ":\n " + customadd + DateUtils.getNowString());
result.append(customadd);
}
if (key.startsWith("CUSTOM_CSS")) {
String customcss = ((RepositoryItemCollection) SxPools.get(mandantenID).getRepository().get(key))
.get("content").toString();
if(customcss!=null && !customcss.trim().equals(""))
{
result.append("<custom_css><style type=\"text/css\"><![CDATA["+customcss+"]]></style></custom_css>");
}
}
if (key.startsWith("CUSTOM_JS")) {
String customjs = ((RepositoryItemCollection) SxPools.get(mandantenID).getRepository().get(key))
.get("content").toString();
if(customjs!=null && !customjs.trim().equals(""))
{
result.append("<custom_js><script language=\"javascript\"><![CDATA["+customjs+"]]></script></custom_js>");
}
}
}
}

47
src/de/superx/servlet/ServletUtils.java

@ -9,6 +9,7 @@ import java.text.ParseException; @@ -9,6 +9,7 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Collection;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
@ -31,10 +32,14 @@ import de.memtext.util.DateUtils; @@ -31,10 +32,14 @@ import de.memtext.util.DateUtils;
import de.memtext.util.ServletHelper;
import de.memtext.util.StringUtils;
import de.superx.common.DBServletException;
import de.superx.common.RepositoryItemCollection;
import de.superx.common.SuperX_el;
import de.superx.common.SxResultSet;
import de.superx.common.SxUser;
import de.superx.common.TranslationContainer;
import de.superx.util.SqlStringUtils;
import freemarker.template.TemplateException;
import freemarker.template.TemplateModelException;
/**
* @author Daniel Quathamer Projektgruppe SuperX ServletUtils.java @ Diese
@ -583,6 +588,48 @@ public class ServletUtils { @@ -583,6 +588,48 @@ public class ServletUtils {
}
return result;
}
public static StringBuffer addCustomElementsToXml(String mandantenID)
{
StringBuffer result = new StringBuffer("");
Iterator it = SxPools.get(mandantenID).getRepository().keySet().iterator();
while (it.hasNext()) {
String key = (String) it.next();
if (key.startsWith("CUSTOM_CSS")) {
String customcss="";
try {
customcss = ((RepositoryItemCollection) SxPools.get(mandantenID).getRepository().get(key))
.get("content").toString();
} catch (TemplateModelException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if(customcss!=null && !customcss.trim().equals(""))
{
result.append("<custom_css><style type=\"text/css\"><![CDATA["+customcss+"]]></style></custom_css>");
}
}
if (key.startsWith("CUSTOM_JS")) {
String customjs="";
try {
customjs = ((RepositoryItemCollection) SxPools.get(mandantenID).getRepository().get(key))
.get("content").toString();
} catch (TemplateModelException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if(customjs!=null && !customjs.trim().equals(""))
{
result.append("<custom_js><script language=\"javascript\"><![CDATA["+customjs+"]]></script></custom_js>");
}
}
}
return result;
}
}
// Created on 15.01.2004

8
src/de/superx/servlet/Themenbaum.java

@ -39,7 +39,9 @@ import de.superx.common.SuperX_el; @@ -39,7 +39,9 @@ import de.superx.common.SuperX_el;
import de.superx.common.SxResultRow;
import de.superx.common.ThemenbaumI;
import de.superx.common.TransletCache;
import de.superx.servlet.ServletUtils;
import de.superx.util.SqlStringUtils;
import freemarker.template.TemplateModelException;
public class Themenbaum implements ThemenbaumI, Serializable {
@ -104,7 +106,7 @@ public class Themenbaum implements ThemenbaumI, Serializable { @@ -104,7 +106,7 @@ public class Themenbaum implements ThemenbaumI, Serializable {
* @throws NichtAngemeldetException
*/
private StringBuffer getMenuXmlAndInitMenu() throws SQLException,
DBServletException, KeyParentEqualException, NoMainEntryException, NichtAngemeldetException {
DBServletException, KeyParentEqualException, NoMainEntryException, NichtAngemeldetException {
StringBuffer result = new StringBuffer();
result.append("<menue hisinone_active=\""
+ (SuperXManager.isHis1 ? "true" : "false") + "\"\n"
@ -116,6 +118,8 @@ public class Themenbaum implements ThemenbaumI, Serializable { @@ -116,6 +118,8 @@ public class Themenbaum implements ThemenbaumI, Serializable {
result.append(">");
result.append(Maske.addGeneralInfo());
result.append(ServletUtils.addCustomElementsToXml(mandantenID));
String welcomedPerson = login_name;
if (login_name == null || login_name.trim().equals(""))
welcomedPerson = userid.toString();
@ -344,10 +348,12 @@ public class Themenbaum implements ThemenbaumI, Serializable { @@ -344,10 +348,12 @@ public class Themenbaum implements ThemenbaumI, Serializable {
+ " showNavigation=\""+showNavigation+"\"");
if (SxPools.get(mandantenID).getRepository().containsKey("K_aufklappbarer Themenbaum")&&SxPools.get(mandantenID).getRepository().get("K_aufklappbarer Themenbaum").toString().equals("1"))
{
//TODO: klappt noch nicht in Tabellen:
result.append(" aufklappbarer_themenbaum=\"true\"");
}
result.append(">\n");
result.append(Maske.addGeneralInfo());
result.append(ServletUtils.addCustomElementsToXml(mandantenID));
result.append("<user id=\"" + Themenbaum.this.userid + "\" admin=\""
+ (Themenbaum.this.isAdmin ? "true" : "false") + "\"><![CDATA["
+ Themenbaum.this.login_name + "]]></user>\n");

2
superx/edit/kern/webapp_manager.jsp

@ -427,7 +427,7 @@ if(tab.equals("log")) @@ -427,7 +427,7 @@ if(tab.equals("log"))
<form name="log" >
<div class="container" id="loadMask" >
<div> (max. letzte <input type="text" size="5" maxlength="5" name="loglines" value="100" /> Zeilen)
<div> (max. letzte <input type="text" size="5" maxlength="10" name="loglines" value="100" /> Zeilen)
<textarea id="Inhalt" name="Inhalt" class="textarea" placeholder="Inhalt..." rows="20"></textarea>

Loading…
Cancel
Save