diff --git a/NiHao/bin/META-INF/taglib.tld b/NiHao/bin/META-INF/taglib.tld new file mode 100644 index 0000000..42f6786 --- /dev/null +++ b/NiHao/bin/META-INF/taglib.tld @@ -0,0 +1,161 @@ + + + 2.1 + 3.0 + nihao + http://www.xwolf.es/nihao + NiHao Taglib + + Text + nihao.tags.Text + empty + Simple literal + + id + Workset field name + true + + + + PasswordBox + nihao.tags.PasswordBox + empty + PasswordBox (input type=password) + + id + Workset field name + true + + + htmlid + id inside HTML code + false + + + styleclass + CSS class + false + + + value + Value, overrides workset value + false + + + + TextBox + nihao.tags.TextBox + empty + TextBox (input type=text) + + id + Workset field name + true + + + htmlid + id inside HTML code + false + + + styleclass + CSS class + false + + + value + Value, overrides workset value + false + + + + Submit + nihao.tags.Submit + empty + Submit (input type=submit) + + htmlid + id inside HTML code + false + + + styleclass + CSS class + false + + + label + Button text + true + + + execute + Workset method to execute before the page loads and after workset values are updated + false + + + + Loop + nihao.tags.Loop + JSP + Loops n times + + id + Workset field name + false + + + times + Integer number of times + false + + + + ForEach + nihao.tags.ForEach + JSP + Loops throught an array or list + + id + Workset field name + true + + + as + Context variable name, must start with | + true + + + + If + nihao.tags.If + JSP + Evaluates or check definition + + id + Workset boolean field name + true + + + + Else + nihao.tags.Else + JSP + Enters if previous Q:If don't + + + Violation + nihao.tags.Violation + JSP + Prints a validation Violatkion error + + id + Violation name + true + + + \ No newline at end of file diff --git a/NiHao/release/NiHao-0.8c.jar b/NiHao/release/NiHao-0.8c.jar index b211c5d..7f374c1 100644 --- a/NiHao/release/NiHao-0.8c.jar +++ b/NiHao/release/NiHao-0.8c.jar Binary files differ diff --git a/NiHao/src/META-INF/taglib.tld b/NiHao/src/META-INF/taglib.tld new file mode 100644 index 0000000..42f6786 --- /dev/null +++ b/NiHao/src/META-INF/taglib.tld @@ -0,0 +1,161 @@ + + + 2.1 + 3.0 + nihao + http://www.xwolf.es/nihao + NiHao Taglib + + Text + nihao.tags.Text + empty + Simple literal + + id + Workset field name + true + + + + PasswordBox + nihao.tags.PasswordBox + empty + PasswordBox (input type=password) + + id + Workset field name + true + + + htmlid + id inside HTML code + false + + + styleclass + CSS class + false + + + value + Value, overrides workset value + false + + + + TextBox + nihao.tags.TextBox + empty + TextBox (input type=text) + + id + Workset field name + true + + + htmlid + id inside HTML code + false + + + styleclass + CSS class + false + + + value + Value, overrides workset value + false + + + + Submit + nihao.tags.Submit + empty + Submit (input type=submit) + + htmlid + id inside HTML code + false + + + styleclass + CSS class + false + + + label + Button text + true + + + execute + Workset method to execute before the page loads and after workset values are updated + false + + + + Loop + nihao.tags.Loop + JSP + Loops n times + + id + Workset field name + false + + + times + Integer number of times + false + + + + ForEach + nihao.tags.ForEach + JSP + Loops throught an array or list + + id + Workset field name + true + + + as + Context variable name, must start with | + true + + + + If + nihao.tags.If + JSP + Evaluates or check definition + + id + Workset boolean field name + true + + + + Else + nihao.tags.Else + JSP + Enters if previous Q:If don't + + + Violation + nihao.tags.Violation + JSP + Prints a validation Violatkion error + + id + Violation name + true + + + \ No newline at end of file diff --git a/NiHao/src/nihao/NiHao.java b/NiHao/src/nihao/NiHao.java index 5ce95c5..b873f74 100644 --- a/NiHao/src/nihao/NiHao.java +++ b/NiHao/src/nihao/NiHao.java @@ -35,7 +35,7 @@ if (ctx != null) return; Resources.addClassLoader(Thread.currentThread().getContextClassLoader()); - ctx = new FileContext("META-INF/nihao.ctx"); + ctx = new FileContext("/WEB-INF/nihao.ctx"); ctx.commit(); // Changesets if (ctx.haveChangesets()) { diff --git a/NiHao/src/nihao/SessionController.java b/NiHao/src/nihao/SessionController.java index 3e659be..a004ea6 100644 --- a/NiHao/src/nihao/SessionController.java +++ b/NiHao/src/nihao/SessionController.java @@ -12,7 +12,7 @@ public class SessionController implements Serializable { private static final long serialVersionUID = 1L; - private static final String CTL_ID = "::QCORE:SESSION_CONTROLLER"; + private static final String CTL_ID = "::NIHAO:SESSION_CONTROLLER"; private static final long USERCACHETIMEOUT = 60000; // 1 minuto, una vez que // pase se rechequea el // usuario (no se sale @@ -48,7 +48,7 @@ * @return boolean */ public boolean isLogged() { - return user != null && user != guestUser; + return user != null && !guestUser.equals(user); } /** diff --git a/NiHao/src/nihao/WebCall.java b/NiHao/src/nihao/WebCall.java index ab9febd..2c8ba6a 100644 --- a/NiHao/src/nihao/WebCall.java +++ b/NiHao/src/nihao/WebCall.java @@ -243,6 +243,7 @@ * Va a la página de Prohibido */ public void goForbidden() throws IOException, ServletException { + LogProvider.getProvider().warn("forbidden!!: "+WebCall.getWebCall().url); go(NiHao.getConf().getLoginConf().getPageForbidden()); } diff --git a/NiHao/src/nihao/WorksetController.java b/NiHao/src/nihao/WorksetController.java index 27fc5fb..b682b0a 100644 --- a/NiHao/src/nihao/WorksetController.java +++ b/NiHao/src/nihao/WorksetController.java @@ -9,7 +9,7 @@ public class WorksetController implements Serializable { private static final long serialVersionUID = 1L; - private static final String CTL_ID = "::QCORE:WORKSET_CONTROLLER"; + private static final String CTL_ID = "::NIHAO:WORKSET_CONTROLLER"; private LRUCache cache = new LRUCache(NiHao.getConf().getWorksetCacheSize()); private WorksetController() { diff --git a/NiHao/src/nihao/context/Context.java b/NiHao/src/nihao/context/Context.java index 1c24f7f..fc5113b 100644 --- a/NiHao/src/nihao/context/Context.java +++ b/NiHao/src/nihao/context/Context.java @@ -309,7 +309,7 @@ InputStream input = Resources.getResourceAsStream(path); if (input == null) - input = Resources.getResourceAsStream("META-INF/" + path); + input = Resources.getResourceAsStream("/WEB-INF/" + path); if (input == null) throw new NiHaoException("Can't open context file: " + path); String includestr = Conversor.readToString(input); diff --git a/NiHao/src/nihao/context/StructureItemPage.java b/NiHao/src/nihao/context/StructureItemPage.java index 3da17ca..570bdb6 100644 --- a/NiHao/src/nihao/context/StructureItemPage.java +++ b/NiHao/src/nihao/context/StructureItemPage.java @@ -80,7 +80,7 @@ public void addGroup(String name, boolean allow) { if (allow) - groupsA.add(name.substring(1)); + groupsA.add(name); else groupsD.add(name); } diff --git a/NiHao/src/nihao/login/User.java b/NiHao/src/nihao/login/User.java index 927e1ab..5241efd 100644 --- a/NiHao/src/nihao/login/User.java +++ b/NiHao/src/nihao/login/User.java @@ -55,4 +55,12 @@ public String toString() { return id + ": " + nick; } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof User)) + return false; + User u=(User) obj; + return id==u.id; + } }