Author: bpoussin Date: 2012-08-07 17:55:35 +0200 (Tue, 07 Aug 2012) New Revision: 231 Url: http://chorem.org/repositories/revision/chorem/231 Log: prise en compte des nouvelles methodes wikitty 3.8 (getWikittyId au lieu de getId) Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/GenericAction.java trunk/chorem-webmotion/src/main/java/org/wikitty/web/jsptag/WikittyDisplay.java trunk/chorem-webmotion/src/main/java/org/wikitty/web/jsptag/WikittyInput.java Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/GenericAction.java =================================================================== --- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/GenericAction.java 2012-08-07 15:55:07 UTC (rev 230) +++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/GenericAction.java 2012-08-07 15:55:35 UTC (rev 231) @@ -110,7 +110,7 @@ Wikitty w = client.restore(id); if (w != null) { result.put("id", id); - result.put("version", w.getVersion()); + result.put("version", w.getWikittyVersion()); result.put("extensions", StringUtils.join(w.getExtensionNames(), ",")); for (WikittyExtension ext : w.getExtensions()) { result.put(ext.getName() + ".version", ext.getVersion()); @@ -249,7 +249,7 @@ Wikitty value = e.getValue(); // Avoid potential null value if (value != null) { - String id = value.getId(); + String id = value.getWikittyId(); String label = value.toString(extName); Map<String, String> item = new LinkedHashMap<String, String>(); item.put("extension", extName); @@ -478,7 +478,7 @@ getContext().addInfoMessage("message", "Object saved" + error); - return renderURL("/wikitty/view/"+w.getId()); + return renderURL("/wikitty/view/"+w.getWikittyId()); } /** Modified: trunk/chorem-webmotion/src/main/java/org/wikitty/web/jsptag/WikittyDisplay.java =================================================================== --- trunk/chorem-webmotion/src/main/java/org/wikitty/web/jsptag/WikittyDisplay.java 2012-08-07 15:55:07 UTC (rev 230) +++ trunk/chorem-webmotion/src/main/java/org/wikitty/web/jsptag/WikittyDisplay.java 2012-08-07 15:55:35 UTC (rev 231) @@ -111,7 +111,7 @@ break; } } else { - /*{<div class="alert alert-error"><%=wikitty.getId()%> doesn't have field '<%=fqfield%>'</div>}*/ + /*{<div class="alert alert-error"><%=wikitty.getWikittyId()%> doesn't have field '<%=fqfield%>'</div>}*/ } } @@ -120,7 +120,7 @@ throws JspException, IOException { byte[] fieldAsBytes = wikitty.getFieldAsBytes(extName, fieldName); if (fieldAsBytes != null) { - String url = contextPath + "/wikitty/view/" + wikitty.getId() + "/" + extName + "/" + fieldName; + String url = contextPath + "/wikitty/view/" + wikitty.getWikittyId() + "/" + extName + "/" + fieldName; /*{<%=label%> : <a href="<%=url%>">Download</a>}*/ } else { /*{<%=label%> : }*/ @@ -205,7 +205,7 @@ if (values != null) { for (Wikitty value : values) { if (value != null) { - String url = contextPath + "/wikitty/view/" + value.getId(); + String url = contextPath + "/wikitty/view/" + value.getWikittyId(); /*{<li><a href="<%=url%>"><%=value%></a></li>}*/ } } Modified: trunk/chorem-webmotion/src/main/java/org/wikitty/web/jsptag/WikittyInput.java =================================================================== --- trunk/chorem-webmotion/src/main/java/org/wikitty/web/jsptag/WikittyInput.java 2012-08-07 15:55:07 UTC (rev 230) +++ trunk/chorem-webmotion/src/main/java/org/wikitty/web/jsptag/WikittyInput.java 2012-08-07 15:55:35 UTC (rev 231) @@ -138,7 +138,7 @@ /*{<i class="icon-question-sign" title="<%=help%>"></i>}*/ } } else { - /*{<div class="alert alert-error"><%=wikitty.getId()%> doesn't have field '<%=fqfield%>'</div>}*/ + /*{<div class="alert alert-error"><%=wikitty.getWikittyId()%> doesn't have field '<%=fqfield%>'</div>}*/ } } @@ -207,7 +207,7 @@ protected void inputString(JspWriter output, String contextPath, String name, Wikitty wikitty, FieldType field, String extName , String fieldName) throws JspException, IOException { - String id = wikitty.getId() + "-" + extName + "-" + fieldName; + String id = wikitty.getWikittyId() + "-" + extName + "-" + fieldName; String fieldValue = wikitty.getFieldAsString(extName, fieldName); String value = fieldValue !=null ? fieldValue : ""; if ("monoline".equalsIgnoreCase(field.getSubtype())) { @@ -233,7 +233,7 @@ protected void inputSelectString(JspWriter output, String contextPath, String name, Wikitty wikitty, FieldType field, String extName , String fieldName) throws JspException, IOException { - String id = wikitty.getId() + "-" + extName + "-" + fieldName; + String id = wikitty.getWikittyId() + "-" + extName + "-" + fieldName; String value = wikitty.getFieldAsString(extName, fieldName); /*{<select id="text-<%=id%>" name="<%=name%>" <%=getDynamicAttribute()%> }*/ if (field.isCollection()) { @@ -254,7 +254,7 @@ protected void inputCollectionString(JspWriter output, String contextPath, String name, Wikitty wikitty, FieldType field, String extName , String fieldName) throws JspException, IOException { - String id = wikitty.getId() + "-" + extName + "-" + fieldName; + String id = wikitty.getWikittyId() + "-" + extName + "-" + fieldName; List<String> value = wikitty.getFieldAsList(extName, fieldName, String.class); if ("monoline".equalsIgnoreCase(field.getSubtype())) { @@ -280,7 +280,7 @@ protected void inputWikitty(JspWriter output, String contextPath, String name, Wikitty wikitty, FieldType field, String extName , String fieldName) throws JspException, IOException { - String id = wikitty.getId() + "-" + extName + "-" + fieldName; + String id = wikitty.getWikittyId() + "-" + extName + "-" + fieldName; String value = wikitty.getFieldAsWikitty(extName, fieldName); Wikitty wikittyValue = wikitty.getFieldAsWikitty(extName, fieldName, false); @@ -324,7 +324,7 @@ protected void inputCollectionWikitty(JspWriter output, String contextPath, String name, Wikitty wikitty, FieldType field, String extName , String fieldName) throws JspException, IOException { - String id = wikitty.getId() + "-" + extName + "-" + fieldName; + String id = wikitty.getWikittyId() + "-" + extName + "-" + fieldName; List<Wikitty> values = wikitty.getFieldAsWikittyList(extName, fieldName, false); String url = contextPath + "/wikitty-json/search?extension=" + field.getAllowed(); @@ -335,7 +335,7 @@ for (Wikitty w :values) { if (w != null) { prePopulate += String.format("%s{id:'%s', label:'%s'}", sep, - StringEscapeUtils.escapeEcmaScript(w.getId()), + StringEscapeUtils.escapeEcmaScript(w.getWikittyId()), StringEscapeUtils.escapeEcmaScript(w.toString())); sep = ","; }