Wikitty-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- 1653 discussions
r1156 - in trunk: wikitty-publication/src/main/java/org/nuiton/wikitty/publication wikitty-publication/src/main/java/org/nuiton/wikitty/publication/externalize wikitty-publication-ui/src/main/java/org/nuiton/wikitty/publication/ui/action
by mfortun@users.nuiton.org 16 Aug '11
by mfortun@users.nuiton.org 16 Aug '11
16 Aug '11
Author: mfortun
Date: 2011-08-16 11:50:46 +0200 (Tue, 16 Aug 2011)
New Revision: 1156
Url: http://nuiton.org/repositories/revision/wikitty/1156
Log:
*reorganize packaging
*handling java mime into eval mechanism
Added:
trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/AbstractDecoredClass.java
trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/CodeDecorator.java
Removed:
trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/UiCodeDecorator.java
trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/externalize/AbstractDecoredClass.java
Modified:
trunk/wikitty-publication-ui/src/main/java/org/nuiton/wikitty/publication/ui/action/PublicationActionEdit.java
trunk/wikitty-publication-ui/src/main/java/org/nuiton/wikitty/publication/ui/action/PublicationActionEval.java
trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/MimeTypePubHelper.java
trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/externalize/WikittyPublicationClassLoader.java
trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/externalize/WikittyPublicationExternalize.java
trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/externalize/WikittyServiceJarLoader.java
Copied: trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/AbstractDecoredClass.java (from rev 1151, trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/externalize/AbstractDecoredClass.java)
===================================================================
--- trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/AbstractDecoredClass.java (rev 0)
+++ trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/AbstractDecoredClass.java 2011-08-16 09:50:46 UTC (rev 1156)
@@ -0,0 +1,23 @@
+package org.nuiton.wikitty.publication;
+
+import java.util.Map;
+
+
+/**
+ * Abstract class for the skeleton and signature for wikittyPubText content
+ * transform and compile as Java class.
+ *
+ * This class allow the evaluator engine to call the eval method to return
+ * the result of the compiled code from the wikitty pub text content.
+ *
+ *
+ * @author mfortun
+ *
+ */
+public abstract class AbstractDecoredClass {
+
+
+ public abstract Object eval(Map<String, Object> bindings) throws Exception ;
+
+
+}
Copied: trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/CodeDecorator.java (from rev 1151, trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/UiCodeDecorator.java)
===================================================================
--- trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/CodeDecorator.java (rev 0)
+++ trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/CodeDecorator.java 2011-08-16 09:50:46 UTC (rev 1156)
@@ -0,0 +1,254 @@
+package org.nuiton.wikitty.publication;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.processor.Processor;
+import org.nuiton.processor.filters.GeneratorTemplatesFilter;
+import org.nuiton.processor.filters.GeneratorTemplatesFilterIn;
+import org.nuiton.util.StringUtil;
+import org.nuiton.wikitty.entities.Wikitty;
+import org.nuiton.wikitty.publication.entities.WikittyPubText;
+import org.nuiton.wikitty.publication.entities.WikittyPubTextHelper;
+import org.nuiton.wikitty.search.operators.Element;
+
+public class CodeDecorator {
+
+ static private Log log = LogFactory
+ .getLog(CodeDecorator.class);
+
+ /*
+ * Après le script engine le ui Code décorateur
+ *
+ * décorer à l'inverse en fait transformer du html en js qui contient du
+ * html par exemple
+ *
+ * regex for html end token need to add /n at the end
+ * "</[\\w\\d]*>"
+ */
+
+ protected String DEFAULT_MIME_TYPE_RETURN = "text/html";
+ protected String MIME_SEP = "/";
+
+ protected Map<String, FilterOption> filtersOptions;
+
+
+ static protected FilterOption defaultFilterOption;
+
+ static {
+ defaultFilterOption = new FilterOption();
+ defaultFilterOption.setOpeningTemplate("var result=\"");
+ defaultFilterOption.setWriteString("result");
+ defaultFilterOption.setStringDelim("\"");
+ defaultFilterOption.setConcatChar("+");
+ defaultFilterOption.setEndingCar(";");
+ defaultFilterOption.setClosingWriterChar("");
+ defaultFilterOption.setOpeningWriterChar("+=");
+ defaultFilterOption.setClosingTemplate("\";");
+ defaultFilterOption.setMimeType("application/javascript");
+
+
+
+ }
+
+ public CodeDecorator() {
+ filtersOptions = new HashMap<String, FilterOption>();
+
+
+ // add basic value js and htmlp
+ filtersOptions.put("html.javascript", defaultFilterOption);
+
+ }
+
+ public Wikitty transformPubUIToPubText(Wikitty wikitty) throws IOException {
+
+ if (!wikitty.hasExtension(WikittyPubText.EXT_WIKITTYPUBTEXT)) {
+ return wikitty;
+ }
+
+ GeneratorTemplatesFilter filter = new GeneratorTemplatesFilter();
+ GeneratorTemplatesFilterIn filterIn = new GeneratorTemplatesFilterIn(
+ filter);
+
+ String mime = WikittyPubTextHelper.getMimeType(wikitty);
+ String initialVersion = wikitty.getVersion();
+
+ /*
+ * changement de mime type changement de
+ */
+ /*
+ * Fonction du mime type
+ */
+
+ String[] mimeTab = StringUtil.split(mime, MIME_SEP);
+
+ FilterOption foption = filtersOptions.get(mimeTab[1]);
+ if (foption == null) {
+ foption = defaultFilterOption;
+ }
+
+ filterIn.setConcacChar(foption.getConcatChar());
+ filterIn.setStringDelim(foption.getStringDelim());
+ filterIn.getParent().setWriteString(foption.getWriteString());
+ filterIn.setEndCar(foption.getEndingCar());
+ filterIn.setOpeningWriterChar(foption.getOpeningWriterChar());
+ filterIn.setClosingWriterChar(foption.getClosingWriterChar());
+
+ String decoringAffect = foption.getOpeningTemplate();
+ // initialize new content
+ String decoredContent = StringUtils.EMPTY;
+
+ // set default content result (override if wikitty content define it)
+ decoredContent += WikittyPublicationConstant.CONTEXT_VAR
+ + ".setContentType(\"" + DEFAULT_MIME_TYPE_RETURN + "\")"
+ + foption.getEndingCar();
+
+ Processor proc = new Processor();
+ proc.setInputFilter(filterIn);
+
+ StringWriter writer = new StringWriter();
+ String content = WikittyPubTextHelper.getContent(wikitty);
+ StringReader reader = new StringReader(content);
+ // process string
+ proc.process(reader, writer);
+
+ decoredContent += decoringAffect;
+ // replace element between <% %> and <%= %>
+ decoredContent += writer.toString();
+
+ // end of string
+ decoredContent += foption.getClosingTemplate();
+ // set the content
+ WikittyPubTextHelper.setContent(wikitty, decoredContent);
+ // get associated mimeType and set it
+ WikittyPubTextHelper.setMimeType(wikitty, foption.getMimeType());
+ // restore version
+ wikitty.setVersion(initialVersion);
+
+ return wikitty;
+ }
+
+ public boolean isTransformationNeeded(Wikitty wikitty) {
+ if (!wikitty.hasExtension(WikittyPubText.EXT_WIKITTYPUBTEXT)) {
+ return false;
+ }
+ String mime = WikittyPubTextHelper.getMimeType(wikitty);
+ return isMimeTypeUi(mime);
+ }
+
+
+ public boolean isTransformationNeeded(WikittyPubText wikitty) {
+ String mime = wikitty.getMimeType();
+ return isMimeTypeUi(mime);
+ }
+
+
+ public boolean isMimeTypeUi(String mime){
+ MimeTypePubHelper helper = new MimeTypePubHelper();
+ String mimeKeyOption = helper.pubUiMimeToConverterOption(mime);
+ return filtersOptions.containsKey(mimeKeyOption);
+ }
+
+ public boolean isDecorated(String string) {
+ return filtersOptions.containsKey(string);
+
+ }
+
+
+ /**
+ * Use to transform wikittyPubText.content into compilable Java
+ * @param wikitty the wikitty pub text
+ * @return the java code
+ */
+ public String getCode(Wikitty wikitty) {
+
+ if (isTransformationNeeded(wikitty)) {
+ try {
+ wikitty = transformPubUIToPubText(wikitty);
+ } catch (IOException e) {
+ log.debug("Error while transform ui");
+ }
+ }
+
+ String content = WikittyPubTextHelper.getContent(wikitty);
+ String mimeType = WikittyPubTextHelper.getMimeType(wikitty);
+ String className = WikittyPubTextHelper.getName(wikitty);// +"PublicationClass";
+ String classContent = StringUtils.EMPTY;
+
+ // Set<String> labels = (Set<String>)
+ // wikitty.getField(WikittyLabel.EXT_WIKITTYLABEL,
+ // WikittyLabel.FIELD_WIKITTYLABEL_LABELS);
+ // classContent += "package org.nuiton.wikitty.publication;" ;
+ // classContent += "package "+ labels.toArray()[0].toString() +";";
+ classContent += "import org.apache.commons.logging.Log;";
+ classContent += "import org.apache.commons.logging.LogFactory;";
+ classContent += "import org.nuiton.wikitty.ScriptEvaluator;";
+ classContent += "import " + AbstractDecoredClass.class.getName() + ";";
+ classContent += "import org.nuiton.wikitty.entities.*;";
+ classContent += "import org.nuiton.wikitty.publication.entities.*;";
+ classContent += "import org.nuiton.wikitty.publication.action.*;";
+ classContent += "import java.util.*;";
+
+ classContent += "public class " + className + " extends "
+ + AbstractDecoredClass.class.getSimpleName() + " {";
+
+ classContent += "public Object eval(Map<String, Object> bindings ) throws Exception {";
+
+ // TODO mfortun-2011-07-08 write a better "filter" must isolate specific
+ // mime type that correspond to precompilable langague
+ classContent += "Object result = null;";
+ classContent += "String content = \""
+ + StringEscapeUtils.escapeJava(content) + "\";";
+ classContent += "String mimeType = \""
+ + StringEscapeUtils.escapeJava(mimeType) + "\";";
+ classContent += "String criteriaName= \"" + Element.ELT_ID + ":"
+ + wikitty.getId() + "\";";
+ classContent += " result = ScriptEvaluator.eval(null, criteriaName, content, mimeType, bindings);";
+ classContent += "return result;";
+
+ if (mimeType.equals(MimeTypePubHelper.JAVA_TYPE)){
+
+ /*
+ * Iterate on element that must be in the context and write
+ *
+ * classContent = "+type+" "+name+" = bindings.get(\""+name+"\");";
+ *
+ * ?
+ */
+ // contruct variables that can be used inside the java code.
+ classContent = "PublicationContext "
+ + WikittyPublicationConstant.CONTEXT_VAR
+ + " = bindings.get(\""
+ + WikittyPublicationConstant.CONTEXT_VAR + "\");";
+ classContent = "WikittyPublicationConstant "
+ + WikittyPublicationConstant.EVAL_VAR
+ + " = bindings.get(\""
+ + WikittyPublicationConstant.EVAL_VAR + "\");";
+ classContent = "String " + WikittyPublicationConstant.PAGE_NAME_VAR
+ + " = bindings.get(\""
+ + WikittyPublicationConstant.PAGE_NAME_VAR + "\");";
+ classContent = "List<String> "
+ + WikittyPublicationConstant.SUBCONTEXT_VAR
+ + " = bindings.get(\""
+ + WikittyPublicationConstant.SUBCONTEXT_VAR + "\");";
+ classContent = "Wikitty " + WikittyPublicationConstant.WIKITTY_VAR
+ + " = bindings.get(\""
+ + WikittyPublicationConstant.WIKITTY_VAR + "\");";
+
+ classContent += content;
+
+ }
+
+ classContent += "\n}\n}\n";
+
+ return classContent;
+ }
+
+}
Modified: trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/MimeTypePubHelper.java
===================================================================
--- trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/MimeTypePubHelper.java 2011-08-16 09:23:21 UTC (rev 1155)
+++ trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/MimeTypePubHelper.java 2011-08-16 09:50:46 UTC (rev 1156)
@@ -56,7 +56,7 @@
// change this to a handler to have specific langage compiler as jython etc
protected List<String> compilable;
protected ScriptEngineManager manager;
- protected UiCodeDecorator decorator;
+ protected CodeDecorator decorator;
static public String COMMON_MIME_SEP ="/";
static public String PUBLICATION_MIME_SEP=".";
@@ -78,7 +78,7 @@
public static String DEFAULT_MIME_TYPE = "application/octet-stream";
public MimeTypePubHelper() {
- decorator = new UiCodeDecorator();
+ decorator = new CodeDecorator();
compilable = new LinkedList<String>();
bidiMap = new DualHashBidiMap();
manager = ScriptEvaluator.getScriptEnginManager(null);
Deleted: trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/UiCodeDecorator.java
===================================================================
--- trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/UiCodeDecorator.java 2011-08-16 09:23:21 UTC (rev 1155)
+++ trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/UiCodeDecorator.java 2011-08-16 09:50:46 UTC (rev 1156)
@@ -1,157 +0,0 @@
-package org.nuiton.wikitty.publication;
-
-import java.io.IOException;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.commons.lang.StringUtils;
-import org.nuiton.processor.Processor;
-import org.nuiton.processor.filters.GeneratorTemplatesFilter;
-import org.nuiton.processor.filters.GeneratorTemplatesFilterIn;
-import org.nuiton.util.StringUtil;
-import org.nuiton.wikitty.entities.Wikitty;
-import org.nuiton.wikitty.publication.entities.WikittyPubText;
-import org.nuiton.wikitty.publication.entities.WikittyPubTextHelper;
-
-public class UiCodeDecorator {
-
- /*
- * Après le script engine le ui Code décorateur
- *
- * décorer à l'inverse en fait transformer du html en js qui contient du
- * html par exemple
- *
- * regex for html end token need to add /n at the end
- * "</[\\w\\d]*>"
- */
-
- protected String DEFAULT_MIME_TYPE_RETURN = "text/html";
- protected String MIME_SEP = "/";
-
- protected Map<String, FilterOption> filtersOptions;
-
-
- static protected FilterOption defaultFilterOption;
-
- static {
- defaultFilterOption = new FilterOption();
- defaultFilterOption.setOpeningTemplate("var result=\"");
- defaultFilterOption.setWriteString("result");
- defaultFilterOption.setStringDelim("\"");
- defaultFilterOption.setConcatChar("+");
- defaultFilterOption.setEndingCar(";");
- defaultFilterOption.setClosingWriterChar("");
- defaultFilterOption.setOpeningWriterChar("+=");
- defaultFilterOption.setClosingTemplate("\";");
- defaultFilterOption.setMimeType("application/javascript");
-
-
-
- }
-
- public UiCodeDecorator() {
- filtersOptions = new HashMap<String, FilterOption>();
-
-
- // add basic value js and htmlp
- filtersOptions.put("html.javascript", defaultFilterOption);
-
- }
-
- public Wikitty transformPubUIToPubText(Wikitty wikitty) throws IOException {
-
- if (!wikitty.hasExtension(WikittyPubText.EXT_WIKITTYPUBTEXT)) {
- return wikitty;
- }
-
- GeneratorTemplatesFilter filter = new GeneratorTemplatesFilter();
- GeneratorTemplatesFilterIn filterIn = new GeneratorTemplatesFilterIn(
- filter);
-
- String mime = WikittyPubTextHelper.getMimeType(wikitty);
- String initialVersion = wikitty.getVersion();
-
- /*
- * changement de mime type changement de
- */
- /*
- * Fonction du mime type
- */
-
- String[] mimeTab = StringUtil.split(mime, MIME_SEP);
-
- FilterOption foption = filtersOptions.get(mimeTab[1]);
- if (foption == null) {
- foption = defaultFilterOption;
- }
-
- filterIn.setConcacChar(foption.getConcatChar());
- filterIn.setStringDelim(foption.getStringDelim());
- filterIn.getParent().setWriteString(foption.getWriteString());
- filterIn.setEndCar(foption.getEndingCar());
- filterIn.setOpeningWriterChar(foption.getOpeningWriterChar());
- filterIn.setClosingWriterChar(foption.getClosingWriterChar());
-
- String decoringAffect = foption.getOpeningTemplate();
- // initialize new content
- String decoredContent = StringUtils.EMPTY;
-
- // set default content result (override if wikitty content define it)
- decoredContent += WikittyPublicationConstant.CONTEXT_VAR
- + ".setContentType(\"" + DEFAULT_MIME_TYPE_RETURN + "\")"
- + foption.getEndingCar();
-
- Processor proc = new Processor();
- proc.setInputFilter(filterIn);
-
- StringWriter writer = new StringWriter();
- String content = WikittyPubTextHelper.getContent(wikitty);
- StringReader reader = new StringReader(content);
- // process string
- proc.process(reader, writer);
-
- decoredContent += decoringAffect;
- // replace element between <% %> and <%= %>
- decoredContent += writer.toString();
-
- // end of string
- decoredContent += foption.getClosingTemplate();
- // set the content
- WikittyPubTextHelper.setContent(wikitty, decoredContent);
- // get associated mimeType and set it
- WikittyPubTextHelper.setMimeType(wikitty, foption.getMimeType());
- // restore version
- wikitty.setVersion(initialVersion);
-
- return wikitty;
- }
-
- public boolean isTransformationNeeded(Wikitty wikitty) {
- if (!wikitty.hasExtension(WikittyPubText.EXT_WIKITTYPUBTEXT)) {
- return false;
- }
- String mime = WikittyPubTextHelper.getMimeType(wikitty);
- return isMimeTypeUi(mime);
- }
-
-
- public boolean isTransformationNeeded(WikittyPubText wikitty) {
- String mime = wikitty.getMimeType();
- return isMimeTypeUi(mime);
- }
-
-
- public boolean isMimeTypeUi(String mime){
- MimeTypePubHelper helper = new MimeTypePubHelper();
- String mimeKeyOption = helper.pubUiMimeToConverterOption(mime);
- return filtersOptions.containsKey(mimeKeyOption);
- }
-
- public boolean isDecorated(String string) {
- return filtersOptions.containsKey(string);
-
- }
-
-}
Deleted: trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/externalize/AbstractDecoredClass.java
===================================================================
--- trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/externalize/AbstractDecoredClass.java 2011-08-16 09:23:21 UTC (rev 1155)
+++ trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/externalize/AbstractDecoredClass.java 2011-08-16 09:50:46 UTC (rev 1156)
@@ -1,23 +0,0 @@
-package org.nuiton.wikitty.publication.externalize;
-
-import java.util.Map;
-
-
-/**
- * Abstract class for the skeleton and signature for wikittyPubText content
- * transform and compile as Java class.
- *
- * This class allow the evaluator engine to call the eval method to return
- * the result of the compiled code from the wikitty pub text content.
- *
- *
- * @author mfortun
- *
- */
-public abstract class AbstractDecoredClass {
-
-
- public abstract Object eval(Map<String, Object> bindings) throws Exception ;
-
-
-}
Modified: trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/externalize/WikittyPublicationClassLoader.java
===================================================================
--- trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/externalize/WikittyPublicationClassLoader.java 2011-08-16 09:23:21 UTC (rev 1155)
+++ trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/externalize/WikittyPublicationClassLoader.java 2011-08-16 09:50:46 UTC (rev 1156)
@@ -26,4 +26,21 @@
return defineClass(name, b, off, len);
}
+
+ /*
+ * Réutiliser cette classe pour la création du class loader pour wikitty publication
+ *
+ *
+ * Charger tout les jar contenu dans le wikitty publication en fonction du context
+ * et du context apps.
+ *
+ * faire un md5 du contenu de tout les wikittypubcontenant les jar.
+ * et si il est différent de celui qu'on devrait avoir on reload
+ * sinon on réutilise les jar.
+ *
+ * mettre les jar dans un dossier ?
+ *
+ *
+ */
+
}
Modified: trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/externalize/WikittyPublicationExternalize.java
===================================================================
--- trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/externalize/WikittyPublicationExternalize.java 2011-08-16 09:23:21 UTC (rev 1155)
+++ trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/externalize/WikittyPublicationExternalize.java 2011-08-16 09:50:46 UTC (rev 1156)
@@ -19,7 +19,7 @@
import org.nuiton.wikitty.entities.WikittyLabelHelper;
import org.nuiton.wikitty.publication.MimeTypePubHelper;
import org.nuiton.wikitty.publication.PropertiesExtended;
-import org.nuiton.wikitty.publication.UiCodeDecorator;
+import org.nuiton.wikitty.publication.CodeDecorator;
import org.nuiton.wikitty.publication.WikittyFileUtil;
import org.nuiton.wikitty.publication.WikittyPublicationConstant;
import org.nuiton.wikitty.publication.entities.WikittyPubData;
@@ -97,7 +97,7 @@
static public void externalize(ApplicationConfig conf, Criteria crit)
throws ArgumentsParserException, IOException {
-
+ CodeDecorator decorator = new CodeDecorator();
MimeTypePubHelper mimeHelper = new MimeTypePubHelper();
File currentFile = new File(".");
@@ -186,7 +186,7 @@
File javaFile = new File(tempDirectory.getAbsolutePath()
+ File.separator + labelPath + name + SOURCE_EXTENSION);
javaFile.createNewFile();
- String codeClass = getCode(wikit);
+ String codeClass = decorator.getCode(wikit);
FileUtil.writeString(javaFile, codeClass);
File classDirectory = new File(tempDirectory.getAbsolutePath()
@@ -259,89 +259,6 @@
* en jar et on va supprimer le dossier tempJar
*/
- public static String getCode(Wikitty wikitty) {
- MimeTypePubHelper mimeHelper = new MimeTypePubHelper();
- UiCodeDecorator uidecDecorator = new UiCodeDecorator();
- if (uidecDecorator.isTransformationNeeded(wikitty)) {
- try {
- wikitty = uidecDecorator.transformPubUIToPubText(wikitty);
- } catch (IOException e) {
- log.debug("Error while transform ui");
- }
- }
+
- String content = WikittyPubTextHelper.getContent(wikitty);
- String mimeType = WikittyPubTextHelper.getMimeType(wikitty);
- String className = WikittyPubTextHelper.getName(wikitty);// +"PublicationClass";
- String classContent = StringUtils.EMPTY;
-
- // Set<String> labels = (Set<String>)
- // wikitty.getField(WikittyLabel.EXT_WIKITTYLABEL,
- // WikittyLabel.FIELD_WIKITTYLABEL_LABELS);
- // classContent += "package org.nuiton.wikitty.publication;" ;
- // classContent += "package "+ labels.toArray()[0].toString() +";";
- classContent += "import org.apache.commons.logging.Log;";
- classContent += "import org.apache.commons.logging.LogFactory;";
- classContent += "import org.nuiton.wikitty.ScriptEvaluator;";
- classContent += "import " + AbstractDecoredClass.class.getName() + ";";
- classContent += "import org.nuiton.wikitty.entities.*;";
- classContent += "import org.nuiton.wikitty.publication.entities.*;";
- classContent += "import org.nuiton.wikitty.publication.action.*;";
- classContent += "import java.util.*;";
-
- classContent += "public class " + className + " extends "
- + AbstractDecoredClass.class.getSimpleName() + " {";
-
- classContent += "public Object eval(Map<String, Object> bindings ) throws Exception {";
-
- // TODO mfortun-2011-07-08 write a better "filter" must isolate specific
- // mime type that correspond to precompilable langague
- classContent += "Object result = null;";
- classContent += "String content = \""
- + StringEscapeUtils.escapeJava(content) + "\";";
- classContent += "String mimeType = \""
- + StringEscapeUtils.escapeJava(mimeType) + "\";";
- classContent += "String criteriaName= \"" + Element.ELT_ID + ":"
- + wikitty.getId() + "\";";
- classContent += " result = ScriptEvaluator.eval(null, criteriaName, content, mimeType, bindings);";
- classContent += "return result;";
-
- if (mimeType.equals(MimeTypePubHelper.JAVA_TYPE)){
-
- /*
- * Iterate on element that must be in the context and write
- *
- * classContent = "+type+" "+name+" = bindings.get(\""+name+"\");";
- *
- * ?
- */
- // contruct variables that can be used inside the java code.
- classContent = "PublicationContext "
- + WikittyPublicationConstant.CONTEXT_VAR
- + " = bindings.get(\""
- + WikittyPublicationConstant.CONTEXT_VAR + "\");";
- classContent = "WikittyPublicationConstant "
- + WikittyPublicationConstant.EVAL_VAR
- + " = bindings.get(\""
- + WikittyPublicationConstant.EVAL_VAR + "\");";
- classContent = "String " + WikittyPublicationConstant.PAGE_NAME_VAR
- + " = bindings.get(\""
- + WikittyPublicationConstant.PAGE_NAME_VAR + "\");";
- classContent = "List<String> "
- + WikittyPublicationConstant.SUBCONTEXT_VAR
- + " = bindings.get(\""
- + WikittyPublicationConstant.SUBCONTEXT_VAR + "\");";
- classContent = "Wikitty " + WikittyPublicationConstant.WIKITTY_VAR
- + " = bindings.get(\""
- + WikittyPublicationConstant.WIKITTY_VAR + "\");";
-
- classContent += content;
-
- }
-
- classContent += "\n}\n}\n";
-
- return classContent;
- }
-
}
Modified: trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/externalize/WikittyServiceJarLoader.java
===================================================================
--- trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/externalize/WikittyServiceJarLoader.java 2011-08-16 09:23:21 UTC (rev 1155)
+++ trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/externalize/WikittyServiceJarLoader.java 2011-08-16 09:50:46 UTC (rev 1156)
@@ -48,6 +48,7 @@
public class WikittyServiceJarLoader extends AbstractWikittyFileService {
public static String JAR_LOCATION_KEY = "wikitty.publication.repository.jar";
+ public static String JARS_LOCATION_KEY = "wikitty.publication.repository.jars";
/** Class logger. */
private static Log log = LogFactory.getLog(WikittyServiceJarLoader.class);
Modified: trunk/wikitty-publication-ui/src/main/java/org/nuiton/wikitty/publication/ui/action/PublicationActionEdit.java
===================================================================
--- trunk/wikitty-publication-ui/src/main/java/org/nuiton/wikitty/publication/ui/action/PublicationActionEdit.java 2011-08-16 09:23:21 UTC (rev 1155)
+++ trunk/wikitty-publication-ui/src/main/java/org/nuiton/wikitty/publication/ui/action/PublicationActionEdit.java 2011-08-16 09:50:46 UTC (rev 1156)
@@ -131,13 +131,13 @@
}
if (wikitty == null) {
- System.out.println("ici");
+
// si le wikitty est null, et qu'on etait pas en edition
// cela signifie qu'on ne retrouve pas le wikitty a editer
// on creer un nouveau wikitty vide que l'on editera
wikitty = new WikittyImpl();
} else {
- System.out.println("on passe en set");
+
// on met a jour le wikitty avec les infos trouvees dans les
// arguments
@@ -249,7 +249,6 @@
}
- System.out.println("tehre" + isStore);
if (isStore) {
log.info("store requested");
log.debug(wikitty);
Modified: trunk/wikitty-publication-ui/src/main/java/org/nuiton/wikitty/publication/ui/action/PublicationActionEval.java
===================================================================
--- trunk/wikitty-publication-ui/src/main/java/org/nuiton/wikitty/publication/ui/action/PublicationActionEval.java 2011-08-16 09:23:21 UTC (rev 1155)
+++ trunk/wikitty-publication-ui/src/main/java/org/nuiton/wikitty/publication/ui/action/PublicationActionEval.java 2011-08-16 09:50:46 UTC (rev 1156)
@@ -1,32 +1,40 @@
package org.nuiton.wikitty.publication.ui.action;
import com.opensymphony.xwork2.ActionContext;
+
+import org.apache.commons.io.FileUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;
+import org.nuiton.util.FileUtil;
import org.nuiton.util.StringUtil;
import org.nuiton.wikitty.ScriptEvaluator;
import org.nuiton.wikitty.WikittyProxy;
import org.nuiton.wikitty.WikittyService;
import org.nuiton.wikitty.entities.Wikitty;
-import org.nuiton.wikitty.publication.UiCodeDecorator;
+import org.nuiton.wikitty.publication.AbstractDecoredClass;
+import org.nuiton.wikitty.publication.CodeDecorator;
+import org.nuiton.wikitty.publication.MimeTypePubHelper;
import org.nuiton.wikitty.publication.WikittyPublicationConstant;
import org.nuiton.wikitty.publication.entities.WikittyPubData;
import org.nuiton.wikitty.publication.entities.WikittyPubDataHelper;
import org.nuiton.wikitty.publication.entities.WikittyPubText;
import org.nuiton.wikitty.publication.entities.WikittyPubTextCompiled;
import org.nuiton.wikitty.publication.entities.WikittyPubTextCompiledHelper;
+import org.nuiton.wikitty.publication.entities.WikittyPubTextCompiledImpl;
import org.nuiton.wikitty.publication.entities.WikittyPubTextHelper;
-import org.nuiton.wikitty.publication.externalize.AbstractDecoredClass;
+import org.nuiton.wikitty.publication.externalize.CompileHelper;
import org.nuiton.wikitty.publication.externalize.WikittyPublicationClassLoader;
import org.nuiton.wikitty.search.Criteria;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
+import java.io.File;
import java.io.IOException;
import java.io.InputStream;
+import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -44,6 +52,10 @@
/** to use log facility, just put in your code: log.info(\"...\"); */
static private Log log = LogFactory.getLog(PublicationActionEval.class);
+ static protected String JAVA_TEMP_DIR_NAME = "PublicationJavaEvalDir";
+ static protected String JAR_TEMP_DIR_NAME= "PublicationJarRepository";
+ static protected String MD5_FILE = "JarMD5";
+
protected String contentType;
protected HttpServletResponse response;
protected HttpServletRequest request;
@@ -71,7 +83,8 @@
log.info("path " + subContext);
Object result;
-
+ CodeDecorator decorator = new CodeDecorator();
+
Criteria criteria = searchCriteria(subContext);
if (criteria == null) {
@@ -99,8 +112,70 @@
result = String.format("no data found for criteria '%s'",
criteria);
} else if (w
- .hasExtension(WikittyPubTextCompiled.EXT_WIKITTYPUBTEXTCOMPILED)) {
+ .hasExtension(WikittyPubTextCompiled.EXT_WIKITTYPUBTEXTCOMPILED)|| WikittyPubTextHelper.getMimeType(w).equals(MimeTypePubHelper.JAVA_TYPE)) {
+ if (WikittyPubTextHelper.getMimeType(w).equals(MimeTypePubHelper.JAVA_TYPE)){
+ String name = WikittyPubTextHelper.getName(w);
+ if (! FileUtils.getTempDirectory().exists()){
+ FileUtils.getTempDirectory().mkdir();
+ }
+
+ File javaWikittyFile = new File(FileUtils
+ .getTempDirectory().getAbsolutePath()
+ + File.separator + JAVA_TEMP_DIR_NAME);
+ if ( !javaWikittyFile.exists()){
+ javaWikittyFile.mkdir();
+ }
+
+ String javaContent = decorator.getCode(w);
+ String content = null;
+ try {
+ File javaFile = new File(
+ javaWikittyFile.getAbsolutePath()
+ + File.separator + name + ".java");
+
+ if (javaFile.exists()) {
+ content = FileUtil.readAsString(javaFile);
+ }
+ if (content == null
+ || !StringUtil.encodeMD5(javaContent).equals(
+ StringUtil.encodeMD5(content))) {
+ javaFile.createNewFile();
+ FileUtil.writeString(javaFile, javaContent);
+
+ PrintWriter writer = new PrintWriter(System.out);
+ // compile
+ CompileHelper.compile(javaWikittyFile, javaFile,
+ javaWikittyFile, writer);
+ }
+
+
+ File classFile = new File (javaWikittyFile.getAbsolutePath()+File.separator+name+".class");
+
+ byte[] wikittyByte = FileUtil.fileToByte(classFile);
+
+ w.addExtension(WikittyPubTextCompiledImpl.extensionWikittyPubTextCompiled);
+ WikittyPubTextCompiledHelper
+ .setByteCode(w, wikittyByte);
+ } catch (Exception e) {
+ // TODO Mfortun-2011-08-16 really handle exception
+ if (log.isErrorEnabled()){
+ log.error(
+ "Error while transforming wikittyPubText to wikittyPubTextCompiled wikitty:"
+ + w, e);
+ }
+
+ result = getError(context);
+ }
+
+ }
+
+
+
+
+
+
+
byte[] content = WikittyPubTextCompiledHelper.getByteCode(w);
if (content == null) {
result = getError(context);
@@ -143,7 +218,7 @@
}
} else {
- UiCodeDecorator decorator = new UiCodeDecorator();
+
log.debug("Check if transformed needed");
if (decorator.isTransformationNeeded(w)) {
log.debug("transformeneed");
1
0
Author: jcouteau
Date: 2011-08-16 11:23:21 +0200 (Tue, 16 Aug 2011)
New Revision: 1155
Url: http://nuiton.org/repositories/revision/wikitty/1155
Log:
Improve doc
Modified:
trunk/src/site/rst/user/faq.rst
trunk/src/site/rst/user/search.rst
trunk/src/site/rst/user/security.rst
Modified: trunk/src/site/rst/user/faq.rst
===================================================================
--- trunk/src/site/rst/user/faq.rst 2011-08-16 09:21:41 UTC (rev 1154)
+++ trunk/src/site/rst/user/faq.rst 2011-08-16 09:23:21 UTC (rev 1155)
@@ -38,11 +38,11 @@
Exemple
~~~~~~~
-Dans cet exemple, le droit de lecture est accordé au privateGroup. On vérifie
-donc que l'utilisateur authentifié fait soit partie du privateGroup soit on
-restreint les résultats aux objets dont le reader n'est pas le privateGroup::
+Dans cet exemple, le droit de lecture est accordé soit au privateGroup, soit à
+tout le monde. On vérifie donc que l'utilisateur authentifié fait soit partie du
+privateGroup soit on restreint les résultats aux objets dont le reader n'est pas
+le privateGroup::
-
// Récupère le privateGroup (méthode métier)
WikittyGroup privateGroup = getPrivateGroup();
Modified: trunk/src/site/rst/user/search.rst
===================================================================
--- trunk/src/site/rst/user/search.rst 2011-08-16 09:21:41 UTC (rev 1154)
+++ trunk/src/site/rst/user/search.rst 2011-08-16 09:23:21 UTC (rev 1155)
@@ -72,7 +72,7 @@
* Contient : contains - Vérifie si un champ multivalué contient une valeur.
-* Dans : in - Vérifie si un champ est une valeur
+* Dans : in - Vérifie si un champ est compris dans une liste de valeurs.
* Egalité d'extension : exteq - Vérifie si un Wikitty possède une extension
Modified: trunk/src/site/rst/user/security.rst
===================================================================
--- trunk/src/site/rst/user/security.rst 2011-08-16 09:21:41 UTC (rev 1154)
+++ trunk/src/site/rst/user/security.rst 2011-08-16 09:23:21 UTC (rev 1155)
@@ -180,20 +180,20 @@
Pour chaque extension, on a la même hiérachie de droit qui donnent des
possibilités différentes :
-+----------+----------------------+----------+-------------+----------------------+
-| Type | Lecture/ | Ecriture | Suppression | Changement de droits |
-| | Création d'instances | | | |
-+==========+======================+==========+=============+======================+
-| Reader | X | | | |
-+----------+----------------------+----------+-------------+----------------------+
-| Writer | X | X | | |
-+----------+----------------------+----------+-------------+----------------------+
-| Owner | X | X | X | |
-+----------+----------------------+----------+-------------+----------------------+
-| Admin | X | X | X | X |
-+----------+----------------------+----------+-------------+----------------------+
-| AppAdmin | X | X | X | X |
-+----------+----------------------+----------+-------------+----------------------+
++----------+----------------------+----------+-------------+---------------+
+| Type | Lecture- | Ecriture | Suppression | Changement de |
+| | Création d'instances | | | droits |
++==========+======================+==========+=============+===============+
+| Reader | X | | | |
++----------+----------------------+----------+-------------+---------------+
+| Writer | X | X | | |
++----------+----------------------+----------+-------------+---------------+
+| Owner | X | X | X | |
++----------+----------------------+----------+-------------+---------------+
+| Admin | X | X | X | X |
++----------+----------------------+----------+-------------+---------------+
+| AppAdmin | X | X | X | X |
++----------+----------------------+----------+-------------+---------------+
Si le reader est vide, tout le monde peut créer des instances de l'extension.
Pour que seuls les AppAdmin et le owner puissent créer des instances, il faut
1
0
r1154 - trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search
by jcouteau@users.nuiton.org 16 Aug '11
by jcouteau@users.nuiton.org 16 Aug '11
16 Aug '11
Author: jcouteau
Date: 2011-08-16 11:21:41 +0200 (Tue, 16 Aug 2011)
New Revision: 1154
Url: http://nuiton.org/repositories/revision/wikitty/1154
Log:
Improve javadoc
Modified:
trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/Search.java
Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/Search.java
===================================================================
--- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/Search.java 2011-08-16 09:21:25 UTC (rev 1153)
+++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/Search.java 2011-08-16 09:21:41 UTC (rev 1154)
@@ -37,13 +37,21 @@
import org.nuiton.wikitty.WikittyUtil;
/**
- * Helper to create a criteria with a restriction
- * <p/>
+ * Helper to create a criteria with restrictions.
+ *
+ * To create a search, use Search.query() and add restrictions to that
+ * query. In the end, create the criteria from the query and use it on find
+ * methods.
+ *
* Element :
- * <extensionName>.<fieldName>[.<fieldType>] : search on an extension and field with specific type (optional)
- * Criteria.ALL_EXTENSIONS.<fieldName>.<fieldType> : search on all extension and field name with specific type
- * <p/>
+ * * <extensionName>.<fieldName>[.<fieldType>] : search on an extension and field with specific type (optional)
+ * * Criteria.ALL_EXTENSIONS.<fieldName>.<fieldType> : search on all extension and field name with specific type
+ *
* <fieldType> specify search on field as NUMERIC, STRING, WIKITTY, BOOLEAN, DATE. Use Element.ElementType to specify type.
+ *
+ * Some patterns might be available depending on the restriction used. They are :
+ * * '*' replace any number of characters
+ * * '?' replace one character
*/
public class Search {
@@ -122,11 +130,11 @@
}
/**
- * Create new query on existent criteria to add new constraint to existent
- * criteria.
+ * Create a new query on an existing criteria to add new constraints to
+ * the existing criteria.
*
- * @param criteria
- * @return
+ * @param criteria the existing criteria
+ * @return a new query to add constraints to the criteria.
*/
public static Search query(Criteria criteria) {
Search search = query();
@@ -145,9 +153,17 @@
/**
* Contains.
*
- * @param element
- * @param values
- * @return
+ * Search on lists (multivalued fields) that a field contains all the values
+ * of the list given in parameter.
+ *
+ * Ex : The field with value [toto,titi,tutu] contains [titi,tutu] but not
+ * [titi,tutu,tata]
+ *
+ * Ps : Use wildcards if you search for substrings.
+ *
+ * @param element the element on which the restriction is put
+ * @param values the values to search in the element
+ * @return {@code this} with the {@code contains} restriction added.
*/
public Search contains(String element, Collection<String> values) {
restrictions.add(RestrictionHelper.contains(elt(element),
@@ -158,10 +174,18 @@
/**
* Contains.
*
- * @param element
- * @param value1
- * @param values
- * @return
+ * Search on lists (multivalued fields) that a field contains all the values
+ * given in parameter.
+ *
+ * Ex : The field with value [toto,titi,tutu] contains [titi,tutu] but not
+ * [titi,tutu,tata]
+ *
+ * Ps : Use wildcards if you search for substrings.
+ *
+ * @param element the element on which the restriction is put
+ * @param value1 first value to search in the field
+ * @param values list of values to search in the field
+ * @return {@code this} with the {@code contains} restriction added.
*/
public Search contains(String element, String value1, String ... values) {
restrictions.add(RestrictionHelper.contains(elt(element),
@@ -170,11 +194,18 @@
}
/**
- * Contains.
+ * In.
*
- * @param element
- * @param values
- * @return
+ * Search if a field is contained in the list of values in parameter
+ *
+ * Ex : The field with value titi is in [titi,tutu] but not in
+ * [tutu,tata]
+ *
+ * Ps : Use wildcards in the values if you search for substrings.
+ *
+ * @param element the element on which the restriction is put
+ * @param values list of values the field must be in
+ * @return {@code this} with the {@code in} restriction added.
*/
public Search in(String element, Collection<String> values) {
restrictions.add(RestrictionHelper.in(elt(element),
@@ -183,12 +214,19 @@
}
/**
- * Contains.
+ * In.
*
- * @param element
- * @param value1
- * @param values
- * @return
+ * Search if a field is contained in the list of values in parameter
+ *
+ * Ex : The field with value titi is in [titi,tutu] but not in
+ * [tutu,tata]
+ *
+ * Ps : Use wildcards in the values if you search for substrings.
+ *
+ * @param element the element on which the restriction is put
+ * @param value1 first value the field must be in
+ * @param values list of values the field must be in
+ * @return {@code this} with the {@code in} restriction added.
*/
public Search in(String element, String value1, String ... values) {
restrictions.add(RestrictionHelper.in(elt(element),
@@ -199,8 +237,12 @@
/**
* Equals.
*
- * @param element
- * @param value
+ * Restrict search so that the field value equals the parameter.
+ *
+ * You might use patterns in your equality.
+ *
+ * @param element the field on which the search is made
+ * @param value the value the element must be equals to
* @return {@code this}
*/
public Search eq(String element, String value) {
@@ -209,10 +251,12 @@
}
/**
- * Looking find specific extension
+ * Extension equals.
*
- * @param value
- * @return {@code this}
+ * Restrict search to wikitties that got the extension in parameter.
+ *
+ * @param value the extension to restrict the results to
+ * @return {@code this} with the {@code exteq} restriction added.
*/
public Search exteq(String value) {
restrictions.add(RestrictionHelper.eq(elt(Element.ELT_EXTENSION), value));
@@ -220,10 +264,12 @@
}
/**
- * Looking find specific id
+ * Id equals.
*
- * @param value
- * @return {@code this}
+ * Restrict search to wikitties that got the id in parameter.
+ *
+ * @param value the id to restrict the results to
+ * @return {@code this} with the {@code ideq} restriction added.
*/
public Search ideq(String value) {
restrictions.add(RestrictionHelper.eq(elt(Element.ELT_ID), value));
@@ -231,11 +277,14 @@
}
/**
- * Equals each collection elements.
+ * Equals.
*
- * @param element
- * @param values
- * @return {@code this}
+ * Restrict search so that the field value equals all the members of the
+ * list in parameters.
+ *
+ * @param element the element on which the restriction is put
+ * @param values list of values that the element must be equals to
+ * @return {@code this} with the {@code ideq} restriction added.
*/
public Search eq(String element, Collection<String> values) {
for (String value : values) {
@@ -245,10 +294,12 @@
}
/**
- * Equals each collection elements.
+ * Extension equals.
*
- * @param values
- * @return {@code this}
+ * Restrict search to wikitties that got all the extensions in parameter.
+ *
+ * @param values list of the extension to restrict the results to
+ * @return {@code this} with the {@code exteq} restriction added.
*/
public Search exteq(Collection<String> values) {
for (String value : values) {
@@ -259,10 +310,13 @@
/**
* Not equals.
+ *
+ * Restrict search to elements that are not equals to the value given in
+ * parameter.
*
- * @param element
- * @param value
- * @return {@code this}
+ * @param element the element on which the restriction is put
+ * @param value the value the element must not be equals to.
+ * @return {@code this} with the {@code neq} restriction added.
*/
public Search neq(String element, String value) {
restrictions.add(RestrictionHelper.neq(elt(element), value));
@@ -270,10 +324,13 @@
}
/**
- * Not equals.
+ * Extension not equals.
*
- * @param value
- * @return {@code this}
+ * Restrict search to wikitties that do not get the extension given in
+ * parameter.
+ *
+ * @param value the extension that the wikitties must not have.
+ * @return {@code this} with the {@code extneq} restriction added.
*/
public Search extneq(String value) {
restrictions.add(RestrictionHelper.neq(elt(Element.ELT_EXTENSION), value));
@@ -281,10 +338,12 @@
}
/**
- * Not equals.
+ * Id not equals.
*
- * @param value
- * @return {@code this}
+ * Restrict search to wikitties that do not have the id given in parameter.
+ *
+ * @param value the id the wikitties must not have.
+ * @return {@code this} with the {@code idneq} restriction added.
*/
public Search idneq(String value) {
restrictions.add(RestrictionHelper.neq(elt(Element.ELT_ID), value));
@@ -293,10 +352,12 @@
/**
* Greater than.
+ *
+ * Search if an element value is greater than the parameter.
*
- * @param element
- * @param value
- * @return {@code this}
+ * @param element the element on which the restriction is put
+ * @param value the value to be compared to
+ * @return {@code this} with the {@code gt} restriction added.
*/
public Search gt(String element, String value) {
restrictions.add(RestrictionHelper.great(elt(element), value));
@@ -304,11 +365,13 @@
}
/**
- * Greater or equals.
+ * Greater than or equals.
+ *
+ * Search if an element value is greater than or equals to the parameter.
*
- * @param element
- * @param value
- * @return {@code this}
+ * @param element the field on which the search is made
+ * @param value the value to be compared to
+ * @return {@code this} with the {@code ge} restriction added.
*/
public Search ge(String element, String value) {
restrictions.add(RestrictionHelper.greatEq(elt(element), value));
@@ -317,10 +380,12 @@
/**
* Less than.
+ *
+ * Search if an element value is less than the parameter.
*
- * @param element
- * @param value
- * @return {@code this}
+ * @param element the element on which the restriction is put
+ * @param value the value to be compared to
+ * @return {@code this} with the {@code lt} restriction added.
*/
public Search lt(String element, String value) {
restrictions.add(RestrictionHelper.less(elt(element), value));
@@ -328,11 +393,13 @@
}
/**
- * Less or equals.
+ * Less than or equals.
+ *
+ * Search if an element value is less than or equals to the parameter.
*
- * @param element
- * @param value
- * @return {@code this}
+ * @param element the element on which the restriction is put.
+ * @param value the value to be compared to.
+ * @return {@code this} with the {@code le} restriction added.
*/
public Search le(String element, String value) {
restrictions.add(RestrictionHelper.lessEq(elt(element), value));
@@ -340,13 +407,15 @@
}
/**
- * Restrict search so that the element value is between lower and upper
- * values (it can also be equals)
+ * Between.
+ *
+ * Restrict search so that the element value is between the lower and upper
+ * values (it can also be equals).
*
- * @param element the element you put the restriction on
- * @param lowerValue the lower bound
- * @param upperValue the upper bound
- * @return {@code this}
+ * @param element the element on which the restriction is put.
+ * @param lowerValue the lower bound.
+ * @param upperValue the upper bound.
+ * @return {@code this} with the {@code le} restriction added.
*/
public Search bw(String element, String lowerValue, String upperValue) {
restrictions.add(RestrictionHelper.between(elt(element), lowerValue, upperValue));
@@ -355,10 +424,12 @@
/**
* Starts with.
- *
- * @param element
- * @param value
- * @return {@code this}
+ *
+ * Search if an element starts with the value in parameter.
+ *
+ * @param element the element on which the restriction is put.
+ * @param value the value the element must start with.
+ * @return {@code this} with the {@code sw} restriction added.
*/
public Search sw(String element, String value) {
restrictions.add(RestrictionHelper.start(elt(element), value));
@@ -367,10 +438,12 @@
/**
* Not starts with.
+ *
+ * Search if an element does not starts with the value in parameter.
*
- * @param element
- * @param value
- * @return {@code this}
+ * @param element the element on which the restriction is put.
+ * @param value the value the element must not start with.
+ * @return {@code this} with the {@code nsw} restriction added.
*/
public Search nsw(String element, String value) {
restrictions.add(RestrictionHelper.not(
@@ -380,10 +453,12 @@
/**
* Ends with.
+ *
+ * Search if an element ends with the value in parameter.
*
- * @param element
- * @param value
- * @return {@code this}
+ * @param element the element on which the restriction is put
+ * @param value the value the element must ends with.
+ * @return {@code this} with the {@code ew} restriction added.
*/
public Search ew(String element, String value) {
restrictions.add(RestrictionHelper.end(elt(element), value));
@@ -392,10 +467,12 @@
/**
* Not ends with.
- *
- * @param element
- * @param value
- * @return {@code this}
+ *
+ * Search if an element does not ends with the value in parameter.
+ *
+ * @param element the element on which the restriction is put
+ * @param value the value the element must not ends with.
+ * @return {@code this} with the {@code notew} restriction added.
*/
public Search notew(String element, String value) {
restrictions.add(RestrictionHelper.not(
@@ -405,9 +482,12 @@
/**
* Keyword.
+ *
+ * Search if the value in parameter is present in any field of any
+ * extension.
*
- * @param value
- * @return {@code this}
+ * @param value the value to find.
+ * @return {@code this} with the {@code keyword} restriction added.
*/
public Search keyword(String value) {
restrictions.add(RestrictionHelper.keyword(value));
@@ -417,8 +497,10 @@
/**
* Is null.
*
- * @param fieldName
- * @return {@code this}
+ * Check that a field is null.
+ *
+ * @param fieldName the field that must be null.
+ * @return {@code this} with the {@code isNull} restriction added.
*/
public Search isNull(String fieldName) {
restrictions.add(RestrictionHelper.isNull(fieldName));
@@ -428,8 +510,10 @@
/**
* Is not null.
*
- * @param fieldName
- * @return {@code this}
+ * Check that a field is not null.
+ *
+ * @param fieldName the field that must not be null.
+ * @return {@code this} with the {@code isNotNull} restriction added.
*/
public Search isNotNull(String fieldName) {
restrictions.add(RestrictionHelper.isNotNull(fieldName));
@@ -439,7 +523,9 @@
/**
* False.
*
- * @return {@code this}
+ * Add a restriction that always return false.
+ *
+ * @return {@code this} with the {@code rFalse} restriction added.
*/
public Search rFalse() {
restrictions.add(RestrictionHelper.rFalse());
@@ -449,7 +535,9 @@
/**
* True.
*
- * @return {@code this}
+ * Add a restriction that always return true.
+ *
+ * @return {@code this} with the {@code rTrue} restriction added.
*/
public Search rTrue() {
restrictions.add(RestrictionHelper.rTrue());
@@ -459,7 +547,10 @@
/**
* Like.
*
- * @param element
+ * Check that a string is present in a field. For example "tric" is present
+ * in "Restriction".
+ *
+ * @param element the element on which the restriction is put
* @param value
* @param searchAs
* @return {@code this}
@@ -478,7 +569,7 @@
/**
* Unlike.
*
- * @param element
+ * @param element the element on which the restriction is put
* @param value
* @param searchAs
* @return {@code this}
@@ -531,6 +622,11 @@
return search;
}
+ /**
+ *
+ * @param foreignFieldName
+ * @return
+ */
public Search associated(String foreignFieldName) {
Search search = new SubSearch(foreignFieldName, this);
return search;
1
0
r1153 - trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services
by jcouteau@users.nuiton.org 16 Aug '11
by jcouteau@users.nuiton.org 16 Aug '11
16 Aug '11
Author: jcouteau
Date: 2011-08-16 11:21:25 +0200 (Tue, 16 Aug 2011)
New Revision: 1153
Url: http://nuiton.org/repositories/revision/wikitty/1153
Log:
Prevent NPE
Modified:
trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittySecurityUtil.java
Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittySecurityUtil.java
===================================================================
--- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittySecurityUtil.java 2011-08-16 09:17:37 UTC (rev 1152)
+++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittySecurityUtil.java 2011-08-16 09:21:25 UTC (rev 1153)
@@ -67,7 +67,9 @@
if (WikittyGroupHelper.hasExtension(group)) {
Set<String> members = WikittyGroupHelper.getMembers(group);
- return members.contains(userId);
+ if (members != null) {
+ return members.contains(userId);
+ }
}
}
1
0
r1152 - in trunk/wikitty-solr/src: main/java/org/nuiton/wikitty/storage/solr test/java/org/nuiton/wikitty/storage/solr
by jcouteau@users.nuiton.org 16 Aug '11
by jcouteau@users.nuiton.org 16 Aug '11
16 Aug '11
Author: jcouteau
Date: 2011-08-16 11:17:37 +0200 (Tue, 16 Aug 2011)
New Revision: 1152
Url: http://nuiton.org/repositories/revision/wikitty/1152
Log:
#1220 - Strange errors during tests - Possible resource leak !
Close resource in tests. Adding the possibility to do it in the WikittySearchEngineSolr, need to propagate that to other services/search engines ? No error shown anymore
Modified:
trunk/wikitty-solr/src/main/java/org/nuiton/wikitty/storage/solr/SolrResource.java
trunk/wikitty-solr/src/main/java/org/nuiton/wikitty/storage/solr/WikittySearchEngineSolr.java
trunk/wikitty-solr/src/test/java/org/nuiton/wikitty/storage/solr/SolrSearchInMemoryTest.java
trunk/wikitty-solr/src/test/java/org/nuiton/wikitty/storage/solr/SolrSearchServerTest.java
trunk/wikitty-solr/src/test/java/org/nuiton/wikitty/storage/solr/SolrTestHelper.java
trunk/wikitty-solr/src/test/java/org/nuiton/wikitty/storage/solr/WikittyServiceSolr.java
Modified: trunk/wikitty-solr/src/main/java/org/nuiton/wikitty/storage/solr/SolrResource.java
===================================================================
--- trunk/wikitty-solr/src/main/java/org/nuiton/wikitty/storage/solr/SolrResource.java 2011-08-15 16:06:36 UTC (rev 1151)
+++ trunk/wikitty-solr/src/main/java/org/nuiton/wikitty/storage/solr/SolrResource.java 2011-08-16 09:17:37 UTC (rev 1152)
@@ -80,6 +80,10 @@
BasicAction.Current().add(lastResourceRecord);
}
+ protected void close() {
+
+ }
+
public Map<String, SolrInputDocument> getAddedDocs() {
Map<String, SolrInputDocument> result = addedDocs.get();
if (result == null) {
Modified: trunk/wikitty-solr/src/main/java/org/nuiton/wikitty/storage/solr/WikittySearchEngineSolr.java
===================================================================
--- trunk/wikitty-solr/src/main/java/org/nuiton/wikitty/storage/solr/WikittySearchEngineSolr.java 2011-08-15 16:06:36 UTC (rev 1151)
+++ trunk/wikitty-solr/src/main/java/org/nuiton/wikitty/storage/solr/WikittySearchEngineSolr.java 2011-08-16 09:17:37 UTC (rev 1152)
@@ -92,6 +92,9 @@
/** JTA resource */
protected SolrResource solrResource;
+ /** CoreContainer used to init the server and close it when finished **/
+ protected CoreContainer solrCore;
+
/**
* Init wikitty search engine on solr embedded server.
*
@@ -131,8 +134,8 @@
try {
CoreContainer.Initializer initializer = new CoreContainer.Initializer();
- CoreContainer coreContainer = initializer.initialize();
- solrServer = new EmbeddedSolrServer(coreContainer, "");
+ solrCore = initializer.initialize();
+ solrServer = new EmbeddedSolrServer(solrCore, "");
fieldModifier = new FieldModifier(extensionStorage);
solrResource = new SolrResource(solrServer);
@@ -467,6 +470,8 @@
}
} catch (Exception eee) {
throw new WikittyException("Can't delete wikitty in index", eee);
+ } finally {
+ solrResource.close();
}
timeLog.log(startTime, "delete", String.format(
"nb %s", ids.size()));
@@ -994,4 +999,11 @@
return doc;
}
+ /**
+ * Method to destroy properly the search engine. Mainly used in tests
+ */
+ protected void destroy() {
+ solrCore.shutdown();
+ }
+
}
Modified: trunk/wikitty-solr/src/test/java/org/nuiton/wikitty/storage/solr/SolrSearchInMemoryTest.java
===================================================================
--- trunk/wikitty-solr/src/test/java/org/nuiton/wikitty/storage/solr/SolrSearchInMemoryTest.java 2011-08-15 16:06:36 UTC (rev 1151)
+++ trunk/wikitty-solr/src/test/java/org/nuiton/wikitty/storage/solr/SolrSearchInMemoryTest.java 2011-08-16 09:17:37 UTC (rev 1152)
@@ -24,6 +24,7 @@
*/
package org.nuiton.wikitty.storage.solr;
+import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.nuiton.util.ApplicationConfig;
import org.nuiton.wikitty.WikittyConfig;
@@ -36,7 +37,7 @@
*/
public class SolrSearchInMemoryTest extends AbstractSearchTest {
- WikittyService service;
+ static protected WikittyService service;
static protected ApplicationConfig config = WikittyConfig.getConfig("wikitty-config-sample-inmemory.properties");
@@ -45,6 +46,11 @@
SolrTestHelper.initTests(config);
}
+ @AfterClass
+ public static void closeTests() {
+ SolrTestHelper.closeTests((WikittyServiceSolr)service);
+ }
+
@Override
public WikittyService getWikittyService() {
Modified: trunk/wikitty-solr/src/test/java/org/nuiton/wikitty/storage/solr/SolrSearchServerTest.java
===================================================================
--- trunk/wikitty-solr/src/test/java/org/nuiton/wikitty/storage/solr/SolrSearchServerTest.java 2011-08-15 16:06:36 UTC (rev 1151)
+++ trunk/wikitty-solr/src/test/java/org/nuiton/wikitty/storage/solr/SolrSearchServerTest.java 2011-08-16 09:17:37 UTC (rev 1152)
@@ -24,6 +24,7 @@
*/
package org.nuiton.wikitty.storage.solr;
+import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.nuiton.util.ApplicationConfig;
import org.nuiton.wikitty.WikittyConfig;
@@ -35,15 +36,20 @@
*/
public class SolrSearchServerTest extends AbstractSearchTest {
- WikittyService service;
+ protected static WikittyService service;
- static protected ApplicationConfig config = WikittyConfig.getConfig("wikitty-config-sample-server.properties");
+ protected static ApplicationConfig config = WikittyConfig.getConfig("wikitty-config-sample-server.properties");
@BeforeClass
public static void initTests() {
SolrTestHelper.initTests(config);
}
+ @AfterClass
+ public static void closeTests() {
+ SolrTestHelper.closeTests((WikittyServiceSolr) service);
+ }
+
@Override
public WikittyService getWikittyService() {
Modified: trunk/wikitty-solr/src/test/java/org/nuiton/wikitty/storage/solr/SolrTestHelper.java
===================================================================
--- trunk/wikitty-solr/src/test/java/org/nuiton/wikitty/storage/solr/SolrTestHelper.java 2011-08-15 16:06:36 UTC (rev 1151)
+++ trunk/wikitty-solr/src/test/java/org/nuiton/wikitty/storage/solr/SolrTestHelper.java 2011-08-16 09:17:37 UTC (rev 1152)
@@ -56,4 +56,8 @@
config.setOption(WikittyConfigOption.WIKITTY_DATA_DIR.key,
dataDirectory.getAbsolutePath());
}
+
+ public static void closeTests(WikittyServiceSolr service) {
+ service.close();
+ }
}
Modified: trunk/wikitty-solr/src/test/java/org/nuiton/wikitty/storage/solr/WikittyServiceSolr.java
===================================================================
--- trunk/wikitty-solr/src/test/java/org/nuiton/wikitty/storage/solr/WikittyServiceSolr.java 2011-08-15 16:06:36 UTC (rev 1151)
+++ trunk/wikitty-solr/src/test/java/org/nuiton/wikitty/storage/solr/WikittyServiceSolr.java 2011-08-16 09:17:37 UTC (rev 1152)
@@ -44,4 +44,8 @@
wikittyStorage = new WikittyStorageInMemory();
searchEngine = new WikittySearchEngineSolr(config, extensionStorage);
}
+
+ public void close(){
+ ((WikittySearchEngineSolr)searchEngine).destroy();
+ }
}
1
0
r1151 - trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search
by bpoussin@users.nuiton.org 15 Aug '11
by bpoussin@users.nuiton.org 15 Aug '11
15 Aug '11
Author: bpoussin
Date: 2011-08-15 18:06:36 +0200 (Mon, 15 Aug 2011)
New Revision: 1151
Url: http://nuiton.org/repositories/revision/wikitty/1151
Log:
Evolution #1675: Permit to set the minimum entry to permit value become a facet
setFacetMinCount must return criteria
Modified:
trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/Criteria.java
Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/Criteria.java
===================================================================
--- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/Criteria.java 2011-08-15 10:45:13 UTC (rev 1150)
+++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/Criteria.java 2011-08-15 16:06:36 UTC (rev 1151)
@@ -180,8 +180,9 @@
return facetMinCount;
}
- public void setFacetMinCount(int facetMinCount) {
+ public Criteria setFacetMinCount(int facetMinCount) {
this.facetMinCount = facetMinCount;
+ return this;
}
public List<Criteria> getFacetCriteria() {
1
0
r1150 - in trunk: wikitty-api/src/main/java/org/nuiton/wikitty/search wikitty-solr/src/main/java/org/nuiton/wikitty/storage/solr
by bpoussin@users.nuiton.org 15 Aug '11
by bpoussin@users.nuiton.org 15 Aug '11
15 Aug '11
Author: bpoussin
Date: 2011-08-15 12:45:13 +0200 (Mon, 15 Aug 2011)
New Revision: 1150
Url: http://nuiton.org/repositories/revision/wikitty/1150
Log:
Evolution #1675: Permit to set the minimum entry to permit value become a facet
Modified:
trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/Criteria.java
trunk/wikitty-solr/src/main/java/org/nuiton/wikitty/storage/solr/WikittySearchEngineSolr.java
Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/Criteria.java
===================================================================
--- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/Criteria.java 2011-08-15 09:34:12 UTC (rev 1149)
+++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/Criteria.java 2011-08-15 10:45:13 UTC (rev 1150)
@@ -82,6 +82,12 @@
/** Last index to get result. */
protected int endIndex = ALL_ELEMENTS;
+ /**
+ * nombre minimum de valeur pour qu'une valeur apparaisse dans les facets.
+ * par defaut, il doit y avoir plus que 1 valeur.
+ */
+ protected int facetMinCount = 1;
+
/** Facet on criteria. */
protected List<Criteria> facetCriteria;
/** Facet on field. */
@@ -170,6 +176,14 @@
return this;
}
+ public int getFacetMinCount() {
+ return facetMinCount;
+ }
+
+ public void setFacetMinCount(int facetMinCount) {
+ this.facetMinCount = facetMinCount;
+ }
+
public List<Criteria> getFacetCriteria() {
return facetCriteria;
}
Modified: trunk/wikitty-solr/src/main/java/org/nuiton/wikitty/storage/solr/WikittySearchEngineSolr.java
===================================================================
--- trunk/wikitty-solr/src/main/java/org/nuiton/wikitty/storage/solr/WikittySearchEngineSolr.java 2011-08-15 09:34:12 UTC (rev 1149)
+++ trunk/wikitty-solr/src/main/java/org/nuiton/wikitty/storage/solr/WikittySearchEngineSolr.java 2011-08-15 10:45:13 UTC (rev 1150)
@@ -688,7 +688,7 @@
if ((facetField != null && !facetField.isEmpty())
|| (facetCriteria != null && !facetCriteria.isEmpty())) {
query.setFacet(true);
- query.setFacetMinCount(1);
+ query.setFacetMinCount(criteria.getFacetMinCount());
// query.setFacetLimit(8); // no limit actualy
// field facetisation
1
0
r1149 - trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search
by bpoussin@users.nuiton.org 15 Aug '11
by bpoussin@users.nuiton.org 15 Aug '11
15 Aug '11
Author: bpoussin
Date: 2011-08-15 11:34:12 +0200 (Mon, 15 Aug 2011)
New Revision: 1149
Url: http://nuiton.org/repositories/revision/wikitty/1149
Log:
change setOrder et addOrder to have varargs argument and not only one argument
Modified:
trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/Criteria.java
Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/Criteria.java
===================================================================
--- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/Criteria.java 2011-08-15 05:52:59 UTC (rev 1148)
+++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/Criteria.java 2011-08-15 09:34:12 UTC (rev 1149)
@@ -213,15 +213,15 @@
return sortAscending;
}
- public Criteria addSortAscending(String field) {
+ public Criteria addSortAscending(String ... field) {
if (sortAscending == null) {
sortAscending = new ArrayList<String>();
}
- sortAscending.add(field);
+ sortAscending.addAll(Arrays.asList(field));
return this;
}
- public Criteria setSortAscending(String[] sortAscending) {
+ public Criteria setSortAscending(String ... sortAscending) {
this.sortAscending = Arrays.asList(sortAscending);
return this;
}
@@ -235,15 +235,15 @@
return sortDescending;
}
- public Criteria addSortDescending(String field) {
+ public Criteria addSortDescending(String ... field) {
if (sortDescending == null) {
sortDescending = new ArrayList<String>();
}
- sortDescending.add(field);
+ sortDescending.addAll(Arrays.asList(field));
return this;
}
- public Criteria setSortDescending(String[] sortDescending) {
+ public Criteria setSortDescending(String ... sortDescending) {
this.sortDescending = Arrays.asList(sortDescending);
return this;
}
1
0
r1148 - in trunk: wikitty-api/src/test/resources wikitty-jdbc/src/test/resources wikitty-lucene/src/test/resources wikitty-solr/src/test/resources
by bpoussin@users.nuiton.org 15 Aug '11
by bpoussin@users.nuiton.org 15 Aug '11
15 Aug '11
Author: bpoussin
Date: 2011-08-15 07:52:59 +0200 (Mon, 15 Aug 2011)
New Revision: 1148
Url: http://nuiton.org/repositories/revision/wikitty/1148
Log:
fix Anomalie #1673: Directory ObjectStore and PutObjectStoreDirHere is created during wikitty utilisation
suppression de fichier jbossts-properties.xml dans les ressources de tests car plus utile, il y en a un dans le repertoire des ressources de l'api qui fixe les problemes
Removed:
trunk/wikitty-api/src/test/resources/jbossts-properties.xml
trunk/wikitty-jdbc/src/test/resources/jbossts-properties.xml
trunk/wikitty-lucene/src/test/resources/jbossts-properties.xml
trunk/wikitty-solr/src/test/resources/jbossts-properties.xml
Deleted: trunk/wikitty-api/src/test/resources/jbossts-properties.xml
===================================================================
--- trunk/wikitty-api/src/test/resources/jbossts-properties.xml 2011-08-15 05:48:47 UTC (rev 1147)
+++ trunk/wikitty-api/src/test/resources/jbossts-properties.xml 2011-08-15 05:52:59 UTC (rev 1148)
@@ -1,139 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
-<!--
- %%Ignore-License
-
- JBoss, Home of Professional Open Source
- Copyright 2009, Red Hat Middleware LLC, and individual contributors
- as indicated by the @author tags.
- See the copyright.txt in the distribution for a
- full listing of individual contributors.
- This copyrighted material is made available to anyone wishing to use,
- modify, copy, or redistribute it subject to the terms and conditions
- of the GNU Lesser General Public License, v. 2.1.
- This program is distributed in the hope that it will be useful, but WITHOUT A
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public License,
- v.2.1 along with this distribution; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- MA 02110-1301, USA.
-
- (C) 2009,
- @author JBoss, a division of Red Hat.
--->
-<properties>
- <!--
- This is the JBossTS configuration file for running ArjunaJTA.
- It should be called jbossts-properties.xml.
- You need a different version for ArjunaCore or JTS usage.
-
- ***************************
-
- Property values may be literals or be tokens of the form ${p1[,p2][:v]}
- in which case the token values are substituted for the values of the corresponding system
- properties as follows:
-
- - Any occurance of ${p} with the System.getProperty(p) value.
- If there is no such property p defined, then the ${p} reference will remain unchanged.
-
- - If the property reference is of the form ${p:v} and there is no such property p,
- then the default value v will be returned.
-
- - If the property reference is of the form ${p1,p2} or ${p1,p2:v} then
- the primary and the secondary properties will be tried in turn, before
- returning either the unchanged input, or the default value.
-
- The property ${/} is replaced with System.getProperty("file.separator")
- value and the property ${:} is replaced with System.getProperty("path.separator").
-
- Note this substitution applies to property values only at the point they are read from
- the config file. Tokens in system properties won't be substituted.
- -->
-
- <!-- (default is YES) -->
- <entry key="CoordinatorEnvironmentBean.commitOnePhase">YES</entry>
-
- <!-- default is under user.home - must be writeable!) -->
- <entry key="ObjectStoreEnvironmentBean.objectStoreDir">target${/}jbossts</entry>
-
- <!-- (default is ON) -->
- <entry key="ObjectStoreEnvironmentBean.transactionSync">ON</entry>
-
- <!-- (Must be unique across all Arjuna instances.) -->
- <entry key="CoreEnvironmentBean.nodeIdentifier">1</entry>
-
- <!-- Which Xid types to recover -->
- <entry key="JTAEnvironmentBean.xaRecoveryNodes">1</entry>
-
- <entry key="JTAEnvironmentBean.xaResourceOrphanFilterClassNames">
- com.arjuna.ats.internal.jta.recovery.arjunacore.JTATransactionLogXAResourceOrphanFilter
- com.arjuna.ats.internal.jta.recovery.arjunacore.JTANodeNameXAResourceOrphanFilter
- </entry>
-
- <!--
- Base port number for determining a unique number to associate with an instance of the transaction service
- (which is needed in order to support multiple instances on the same machine).
- Use the value 0 to allow the system to select the first available port number.
- If the port number is non-zero and the port is in use then the value will be incremented until either a successful binding
- to the loopback address is created or until the the maximum number of ports (specified by the
- CoreEnvironmentBean.socketProcessIdMaxPorts property) have been tried or until the port number
- reaches the maximum possible port number.
- -->
- <entry key="CoreEnvironmentBean.socketProcessIdPort">0</entry>
-
-
-
- <!--
- Periodic recovery modules to use. Invoked in the order they appear in the list.
- Check http://www.jboss.org/community/docs/DOC-10788 for more information
- on recovery modules and their configuration when running in various
- deployments.
- -->
- <entry key="RecoveryEnvironmentBean.recoveryModuleClassNames">
- com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule
- com.arjuna.ats.internal.txoj.recovery.TORecoveryModule
- com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule
- </entry>
-
- <!-- Expiry scanners to use (order of invocation is random). -->
- <entry key="RecoveryEnvironmentBean.expiryScannerClassNames">
- com.arjuna.ats.internal.arjuna.recovery.ExpiredTransactionStatusManagerScanner
- </entry>
-
- <!--
- Add the following to the set of expiryScannerClassNames above to move logs that cannot be completed by failure recovery.
- But be sure you know what you are doing and why!
- com.arjuna.ats.internal.arjuna.recovery.AtomicActionExpiryScanner
- -->
-
- <!--
- The address and port number on which the recovery manager listens
- If running within an AS then the address the AS is bound to (jboss.bind.address) takes precedence
- -->
- <entry key="RecoveryEnvironmentBean.recoveryPort">4712</entry>
-
- <entry key="RecoveryEnvironmentBean.recoveryAddress"></entry>
-
- <!--
- Use this to fix the port on which the TransactionStatusManager listens,
- The default behaviour is to use any free port.
- -->
- <entry key="RecoveryEnvironmentBean.transactionStatusManagerPort">0</entry>
-
- <!--
- Use this to fix the address on which the TransactionStatusManager binds,
- The default behaviour is to use the loopback address (ie localhost).
- If running within an AS then the address the AS is bound to (jboss.bind.address) takes precedence
- -->
- <entry key="RecoveryEnvironmentBean.transactionStatusManagerAddress"></entry>
-
- <!--
- For cases where the recovery manager is in process with the transaction manager and nothing else uses
- the ObjectStore, it is possible to disable the socket based recovery listener by setting this to NO.
- Caution: use of this property can allow multiple recovery processes to run on the same ObjectStore
- if you are not careful. That in turn can lead to incorrect transaction processing. Use with care.
- -->
- <entry key="RecoveryEnvironmentBean.recoveryListener">YES</entry>
-
-</properties>
Deleted: trunk/wikitty-jdbc/src/test/resources/jbossts-properties.xml
===================================================================
--- trunk/wikitty-jdbc/src/test/resources/jbossts-properties.xml 2011-08-15 05:48:47 UTC (rev 1147)
+++ trunk/wikitty-jdbc/src/test/resources/jbossts-properties.xml 2011-08-15 05:52:59 UTC (rev 1148)
@@ -1,139 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
-<!--
- %%Ignore-License
-
- JBoss, Home of Professional Open Source
- Copyright 2009, Red Hat Middleware LLC, and individual contributors
- as indicated by the @author tags.
- See the copyright.txt in the distribution for a
- full listing of individual contributors.
- This copyrighted material is made available to anyone wishing to use,
- modify, copy, or redistribute it subject to the terms and conditions
- of the GNU Lesser General Public License, v. 2.1.
- This program is distributed in the hope that it will be useful, but WITHOUT A
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public License,
- v.2.1 along with this distribution; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- MA 02110-1301, USA.
-
- (C) 2009,
- @author JBoss, a division of Red Hat.
--->
-<properties>
- <!--
- This is the JBossTS configuration file for running ArjunaJTA.
- It should be called jbossts-properties.xml.
- You need a different version for ArjunaCore or JTS usage.
-
- ***************************
-
- Property values may be literals or be tokens of the form ${p1[,p2][:v]}
- in which case the token values are substituted for the values of the corresponding system
- properties as follows:
-
- - Any occurance of ${p} with the System.getProperty(p) value.
- If there is no such property p defined, then the ${p} reference will remain unchanged.
-
- - If the property reference is of the form ${p:v} and there is no such property p,
- then the default value v will be returned.
-
- - If the property reference is of the form ${p1,p2} or ${p1,p2:v} then
- the primary and the secondary properties will be tried in turn, before
- returning either the unchanged input, or the default value.
-
- The property ${/} is replaced with System.getProperty("file.separator")
- value and the property ${:} is replaced with System.getProperty("path.separator").
-
- Note this substitution applies to property values only at the point they are read from
- the config file. Tokens in system properties won't be substituted.
- -->
-
- <!-- (default is YES) -->
- <entry key="CoordinatorEnvironmentBean.commitOnePhase">YES</entry>
-
- <!-- default is under user.home - must be writeable!) -->
- <entry key="ObjectStoreEnvironmentBean.objectStoreDir">target${/}jbossts</entry>
-
- <!-- (default is ON) -->
- <entry key="ObjectStoreEnvironmentBean.transactionSync">ON</entry>
-
- <!-- (Must be unique across all Arjuna instances.) -->
- <entry key="CoreEnvironmentBean.nodeIdentifier">1</entry>
-
- <!-- Which Xid types to recover -->
- <entry key="JTAEnvironmentBean.xaRecoveryNodes">1</entry>
-
- <entry key="JTAEnvironmentBean.xaResourceOrphanFilterClassNames">
- com.arjuna.ats.internal.jta.recovery.arjunacore.JTATransactionLogXAResourceOrphanFilter
- com.arjuna.ats.internal.jta.recovery.arjunacore.JTANodeNameXAResourceOrphanFilter
- </entry>
-
- <!--
- Base port number for determining a unique number to associate with an instance of the transaction service
- (which is needed in order to support multiple instances on the same machine).
- Use the value 0 to allow the system to select the first available port number.
- If the port number is non-zero and the port is in use then the value will be incremented until either a successful binding
- to the loopback address is created or until the the maximum number of ports (specified by the
- CoreEnvironmentBean.socketProcessIdMaxPorts property) have been tried or until the port number
- reaches the maximum possible port number.
- -->
- <entry key="CoreEnvironmentBean.socketProcessIdPort">0</entry>
-
-
-
- <!--
- Periodic recovery modules to use. Invoked in the order they appear in the list.
- Check http://www.jboss.org/community/docs/DOC-10788 for more information
- on recovery modules and their configuration when running in various
- deployments.
- -->
- <entry key="RecoveryEnvironmentBean.recoveryModuleClassNames">
- com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule
- com.arjuna.ats.internal.txoj.recovery.TORecoveryModule
- com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule
- </entry>
-
- <!-- Expiry scanners to use (order of invocation is random). -->
- <entry key="RecoveryEnvironmentBean.expiryScannerClassNames">
- com.arjuna.ats.internal.arjuna.recovery.ExpiredTransactionStatusManagerScanner
- </entry>
-
- <!--
- Add the following to the set of expiryScannerClassNames above to move logs that cannot be completed by failure recovery.
- But be sure you know what you are doing and why!
- com.arjuna.ats.internal.arjuna.recovery.AtomicActionExpiryScanner
- -->
-
- <!--
- The address and port number on which the recovery manager listens
- If running within an AS then the address the AS is bound to (jboss.bind.address) takes precedence
- -->
- <entry key="RecoveryEnvironmentBean.recoveryPort">4712</entry>
-
- <entry key="RecoveryEnvironmentBean.recoveryAddress"></entry>
-
- <!--
- Use this to fix the port on which the TransactionStatusManager listens,
- The default behaviour is to use any free port.
- -->
- <entry key="RecoveryEnvironmentBean.transactionStatusManagerPort">0</entry>
-
- <!--
- Use this to fix the address on which the TransactionStatusManager binds,
- The default behaviour is to use the loopback address (ie localhost).
- If running within an AS then the address the AS is bound to (jboss.bind.address) takes precedence
- -->
- <entry key="RecoveryEnvironmentBean.transactionStatusManagerAddress"></entry>
-
- <!--
- For cases where the recovery manager is in process with the transaction manager and nothing else uses
- the ObjectStore, it is possible to disable the socket based recovery listener by setting this to NO.
- Caution: use of this property can allow multiple recovery processes to run on the same ObjectStore
- if you are not careful. That in turn can lead to incorrect transaction processing. Use with care.
- -->
- <entry key="RecoveryEnvironmentBean.recoveryListener">YES</entry>
-
-</properties>
Deleted: trunk/wikitty-lucene/src/test/resources/jbossts-properties.xml
===================================================================
--- trunk/wikitty-lucene/src/test/resources/jbossts-properties.xml 2011-08-15 05:48:47 UTC (rev 1147)
+++ trunk/wikitty-lucene/src/test/resources/jbossts-properties.xml 2011-08-15 05:52:59 UTC (rev 1148)
@@ -1,139 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
-<!--
- %%Ignore-License
-
- JBoss, Home of Professional Open Source
- Copyright 2009, Red Hat Middleware LLC, and individual contributors
- as indicated by the @author tags.
- See the copyright.txt in the distribution for a
- full listing of individual contributors.
- This copyrighted material is made available to anyone wishing to use,
- modify, copy, or redistribute it subject to the terms and conditions
- of the GNU Lesser General Public License, v. 2.1.
- This program is distributed in the hope that it will be useful, but WITHOUT A
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public License,
- v.2.1 along with this distribution; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- MA 02110-1301, USA.
-
- (C) 2009,
- @author JBoss, a division of Red Hat.
--->
-<properties>
- <!--
- This is the JBossTS configuration file for running ArjunaJTA.
- It should be called jbossts-properties.xml.
- You need a different version for ArjunaCore or JTS usage.
-
- ***************************
-
- Property values may be literals or be tokens of the form ${p1[,p2][:v]}
- in which case the token values are substituted for the values of the corresponding system
- properties as follows:
-
- - Any occurance of ${p} with the System.getProperty(p) value.
- If there is no such property p defined, then the ${p} reference will remain unchanged.
-
- - If the property reference is of the form ${p:v} and there is no such property p,
- then the default value v will be returned.
-
- - If the property reference is of the form ${p1,p2} or ${p1,p2:v} then
- the primary and the secondary properties will be tried in turn, before
- returning either the unchanged input, or the default value.
-
- The property ${/} is replaced with System.getProperty("file.separator")
- value and the property ${:} is replaced with System.getProperty("path.separator").
-
- Note this substitution applies to property values only at the point they are read from
- the config file. Tokens in system properties won't be substituted.
- -->
-
- <!-- (default is YES) -->
- <entry key="CoordinatorEnvironmentBean.commitOnePhase">YES</entry>
-
- <!-- default is under user.home - must be writeable!) -->
- <entry key="ObjectStoreEnvironmentBean.objectStoreDir">target${/}jbossts</entry>
-
- <!-- (default is ON) -->
- <entry key="ObjectStoreEnvironmentBean.transactionSync">ON</entry>
-
- <!-- (Must be unique across all Arjuna instances.) -->
- <entry key="CoreEnvironmentBean.nodeIdentifier">1</entry>
-
- <!-- Which Xid types to recover -->
- <entry key="JTAEnvironmentBean.xaRecoveryNodes">1</entry>
-
- <entry key="JTAEnvironmentBean.xaResourceOrphanFilterClassNames">
- com.arjuna.ats.internal.jta.recovery.arjunacore.JTATransactionLogXAResourceOrphanFilter
- com.arjuna.ats.internal.jta.recovery.arjunacore.JTANodeNameXAResourceOrphanFilter
- </entry>
-
- <!--
- Base port number for determining a unique number to associate with an instance of the transaction service
- (which is needed in order to support multiple instances on the same machine).
- Use the value 0 to allow the system to select the first available port number.
- If the port number is non-zero and the port is in use then the value will be incremented until either a successful binding
- to the loopback address is created or until the the maximum number of ports (specified by the
- CoreEnvironmentBean.socketProcessIdMaxPorts property) have been tried or until the port number
- reaches the maximum possible port number.
- -->
- <entry key="CoreEnvironmentBean.socketProcessIdPort">0</entry>
-
-
-
- <!--
- Periodic recovery modules to use. Invoked in the order they appear in the list.
- Check http://www.jboss.org/community/docs/DOC-10788 for more information
- on recovery modules and their configuration when running in various
- deployments.
- -->
- <entry key="RecoveryEnvironmentBean.recoveryModuleClassNames">
- com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule
- com.arjuna.ats.internal.txoj.recovery.TORecoveryModule
- com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule
- </entry>
-
- <!-- Expiry scanners to use (order of invocation is random). -->
- <entry key="RecoveryEnvironmentBean.expiryScannerClassNames">
- com.arjuna.ats.internal.arjuna.recovery.ExpiredTransactionStatusManagerScanner
- </entry>
-
- <!--
- Add the following to the set of expiryScannerClassNames above to move logs that cannot be completed by failure recovery.
- But be sure you know what you are doing and why!
- com.arjuna.ats.internal.arjuna.recovery.AtomicActionExpiryScanner
- -->
-
- <!--
- The address and port number on which the recovery manager listens
- If running within an AS then the address the AS is bound to (jboss.bind.address) takes precedence
- -->
- <entry key="RecoveryEnvironmentBean.recoveryPort">4712</entry>
-
- <entry key="RecoveryEnvironmentBean.recoveryAddress"></entry>
-
- <!--
- Use this to fix the port on which the TransactionStatusManager listens,
- The default behaviour is to use any free port.
- -->
- <entry key="RecoveryEnvironmentBean.transactionStatusManagerPort">0</entry>
-
- <!--
- Use this to fix the address on which the TransactionStatusManager binds,
- The default behaviour is to use the loopback address (ie localhost).
- If running within an AS then the address the AS is bound to (jboss.bind.address) takes precedence
- -->
- <entry key="RecoveryEnvironmentBean.transactionStatusManagerAddress"></entry>
-
- <!--
- For cases where the recovery manager is in process with the transaction manager and nothing else uses
- the ObjectStore, it is possible to disable the socket based recovery listener by setting this to NO.
- Caution: use of this property can allow multiple recovery processes to run on the same ObjectStore
- if you are not careful. That in turn can lead to incorrect transaction processing. Use with care.
- -->
- <entry key="RecoveryEnvironmentBean.recoveryListener">YES</entry>
-
-</properties>
Deleted: trunk/wikitty-solr/src/test/resources/jbossts-properties.xml
===================================================================
--- trunk/wikitty-solr/src/test/resources/jbossts-properties.xml 2011-08-15 05:48:47 UTC (rev 1147)
+++ trunk/wikitty-solr/src/test/resources/jbossts-properties.xml 2011-08-15 05:52:59 UTC (rev 1148)
@@ -1,139 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
-<!--
- %%Ignore-License
-
- JBoss, Home of Professional Open Source
- Copyright 2009, Red Hat Middleware LLC, and individual contributors
- as indicated by the @author tags.
- See the copyright.txt in the distribution for a
- full listing of individual contributors.
- This copyrighted material is made available to anyone wishing to use,
- modify, copy, or redistribute it subject to the terms and conditions
- of the GNU Lesser General Public License, v. 2.1.
- This program is distributed in the hope that it will be useful, but WITHOUT A
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public License,
- v.2.1 along with this distribution; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- MA 02110-1301, USA.
-
- (C) 2009,
- @author JBoss, a division of Red Hat.
--->
-<properties>
- <!--
- This is the JBossTS configuration file for running ArjunaJTA.
- It should be called jbossts-properties.xml.
- You need a different version for ArjunaCore or JTS usage.
-
- ***************************
-
- Property values may be literals or be tokens of the form ${p1[,p2][:v]}
- in which case the token values are substituted for the values of the corresponding system
- properties as follows:
-
- - Any occurance of ${p} with the System.getProperty(p) value.
- If there is no such property p defined, then the ${p} reference will remain unchanged.
-
- - If the property reference is of the form ${p:v} and there is no such property p,
- then the default value v will be returned.
-
- - If the property reference is of the form ${p1,p2} or ${p1,p2:v} then
- the primary and the secondary properties will be tried in turn, before
- returning either the unchanged input, or the default value.
-
- The property ${/} is replaced with System.getProperty("file.separator")
- value and the property ${:} is replaced with System.getProperty("path.separator").
-
- Note this substitution applies to property values only at the point they are read from
- the config file. Tokens in system properties won't be substituted.
- -->
-
- <!-- (default is YES) -->
- <entry key="CoordinatorEnvironmentBean.commitOnePhase">YES</entry>
-
- <!-- default is under user.home - must be writeable!) -->
- <entry key="ObjectStoreEnvironmentBean.objectStoreDir">target${/}jbossts</entry>
-
- <!-- (default is ON) -->
- <entry key="ObjectStoreEnvironmentBean.transactionSync">ON</entry>
-
- <!-- (Must be unique across all Arjuna instances.) -->
- <entry key="CoreEnvironmentBean.nodeIdentifier">1</entry>
-
- <!-- Which Xid types to recover -->
- <entry key="JTAEnvironmentBean.xaRecoveryNodes">1</entry>
-
- <entry key="JTAEnvironmentBean.xaResourceOrphanFilterClassNames">
- com.arjuna.ats.internal.jta.recovery.arjunacore.JTATransactionLogXAResourceOrphanFilter
- com.arjuna.ats.internal.jta.recovery.arjunacore.JTANodeNameXAResourceOrphanFilter
- </entry>
-
- <!--
- Base port number for determining a unique number to associate with an instance of the transaction service
- (which is needed in order to support multiple instances on the same machine).
- Use the value 0 to allow the system to select the first available port number.
- If the port number is non-zero and the port is in use then the value will be incremented until either a successful binding
- to the loopback address is created or until the the maximum number of ports (specified by the
- CoreEnvironmentBean.socketProcessIdMaxPorts property) have been tried or until the port number
- reaches the maximum possible port number.
- -->
- <entry key="CoreEnvironmentBean.socketProcessIdPort">0</entry>
-
-
-
- <!--
- Periodic recovery modules to use. Invoked in the order they appear in the list.
- Check http://www.jboss.org/community/docs/DOC-10788 for more information
- on recovery modules and their configuration when running in various
- deployments.
- -->
- <entry key="RecoveryEnvironmentBean.recoveryModuleClassNames">
- com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule
- com.arjuna.ats.internal.txoj.recovery.TORecoveryModule
- com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule
- </entry>
-
- <!-- Expiry scanners to use (order of invocation is random). -->
- <entry key="RecoveryEnvironmentBean.expiryScannerClassNames">
- com.arjuna.ats.internal.arjuna.recovery.ExpiredTransactionStatusManagerScanner
- </entry>
-
- <!--
- Add the following to the set of expiryScannerClassNames above to move logs that cannot be completed by failure recovery.
- But be sure you know what you are doing and why!
- com.arjuna.ats.internal.arjuna.recovery.AtomicActionExpiryScanner
- -->
-
- <!--
- The address and port number on which the recovery manager listens
- If running within an AS then the address the AS is bound to (jboss.bind.address) takes precedence
- -->
- <entry key="RecoveryEnvironmentBean.recoveryPort">4712</entry>
-
- <entry key="RecoveryEnvironmentBean.recoveryAddress"></entry>
-
- <!--
- Use this to fix the port on which the TransactionStatusManager listens,
- The default behaviour is to use any free port.
- -->
- <entry key="RecoveryEnvironmentBean.transactionStatusManagerPort">0</entry>
-
- <!--
- Use this to fix the address on which the TransactionStatusManager binds,
- The default behaviour is to use the loopback address (ie localhost).
- If running within an AS then the address the AS is bound to (jboss.bind.address) takes precedence
- -->
- <entry key="RecoveryEnvironmentBean.transactionStatusManagerAddress"></entry>
-
- <!--
- For cases where the recovery manager is in process with the transaction manager and nothing else uses
- the ObjectStore, it is possible to disable the socket based recovery listener by setting this to NO.
- Caution: use of this property can allow multiple recovery processes to run on the same ObjectStore
- if you are not careful. That in turn can lead to incorrect transaction processing. Use with care.
- -->
- <entry key="RecoveryEnvironmentBean.recoveryListener">YES</entry>
-
-</properties>
1
0
r1147 - in trunk/wikitty-api/src/main: java/org/nuiton/wikitty/services resources
by bpoussin@users.nuiton.org 15 Aug '11
by bpoussin@users.nuiton.org 15 Aug '11
15 Aug '11
Author: bpoussin
Date: 2011-08-15 07:48:47 +0200 (Mon, 15 Aug 2011)
New Revision: 1147
Url: http://nuiton.org/repositories/revision/wikitty/1147
Log:
fix Anomalie #1673: Directory ObjectStore and PutObjectStoreDirHere is created during wikitty utilisation
Added:
trunk/wikitty-api/src/main/resources/jbossts-properties.xml
Modified:
trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyTransaction.java
Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyTransaction.java
===================================================================
--- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyTransaction.java 2011-08-14 13:57:57 UTC (rev 1146)
+++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyTransaction.java 2011-08-15 05:48:47 UTC (rev 1147)
@@ -24,14 +24,11 @@
*/
package org.nuiton.wikitty.services;
-import java.sql.Connection;
-import java.sql.SQLException;
+import com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean;
+import com.arjuna.ats.internal.arjuna.objectstore.VolatileStore;
+import com.arjuna.common.internal.util.propertyservice.BeanPopulator;
import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
import javax.transaction.Status;
import javax.transaction.TransactionManager;
import javax.transaction.UserTransaction;
@@ -64,6 +61,15 @@
};
private WikittyTransaction() {
+ // pour regler le probleme de repertoire ObjectStore qui apparaisse
+ // en conjonction avec le fichier de config jbossts-properties.xml
+ // voir:
+ // - http://docs.redhat.com/docs/en-US/JBoss_Enterprise_Application_Platform/4.2…
+ // - https://issues.jboss.org/browse/JBTM-852
+ BeanPopulator.getNamedInstance(
+ ObjectStoreEnvironmentBean.class, "communicationStore")
+ .setObjectStoreType(VolatileStore.class.getName());
+
tagValues = new HashMap<Object, Object>();
}
Copied: trunk/wikitty-api/src/main/resources/jbossts-properties.xml (from rev 1140, trunk/wikitty-api/src/test/resources/jbossts-properties.xml)
===================================================================
--- trunk/wikitty-api/src/main/resources/jbossts-properties.xml (rev 0)
+++ trunk/wikitty-api/src/main/resources/jbossts-properties.xml 2011-08-15 05:48:47 UTC (rev 1147)
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+<!--
+ %%Ignore-License
+
+ JBoss, Home of Professional Open Source
+ Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ as indicated by the @author tags.
+ See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+ This copyrighted material is made available to anyone wishing to use,
+ modify, copy, or redistribute it subject to the terms and conditions
+ of the GNU Lesser General Public License, v. 2.1.
+ This program is distributed in the hope that it will be useful, but WITHOUT A
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ You should have received a copy of the GNU Lesser General Public License,
+ v.2.1 along with this distribution; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA.
+
+ (C) 2009,
+ @author JBoss, a division of Red Hat.
+-->
+<properties>
+ <!--
+ This is the JBossTS configuration file for running ArjunaJTA.
+ It should be called jbossts-properties.xml.
+ You need a different version for ArjunaCore or JTS usage.
+
+ ***************************
+
+ Property values may be literals or be tokens of the form ${p1[,p2][:v]}
+ in which case the token values are substituted for the values of the corresponding system
+ properties as follows:
+
+ - Any occurance of ${p} with the System.getProperty(p) value.
+ If there is no such property p defined, then the ${p} reference will remain unchanged.
+
+ - If the property reference is of the form ${p:v} and there is no such property p,
+ then the default value v will be returned.
+
+ - If the property reference is of the form ${p1,p2} or ${p1,p2:v} then
+ the primary and the secondary properties will be tried in turn, before
+ returning either the unchanged input, or the default value.
+
+ The property ${/} is replaced with System.getProperty("file.separator")
+ value and the property ${:} is replaced with System.getProperty("path.separator").
+
+ Note this substitution applies to property values only at the point they are read from
+ the config file. Tokens in system properties won't be substituted.
+ -->
+
+ <!-- (default is YES) -->
+ <entry key="CoordinatorEnvironmentBean.commitOnePhase">YES</entry>
+
+ <!--
+ | added for wikitty to prevent creation of directory PutObjectStoreDirHere.
+ | Default jbossts value is ShadowNoFileLockStore
+ |-->
+ <entry key="ObjectStoreEnvironmentBean.objectStoreType">${wikittyJBosstsStore:com.arjuna.ats.internal.arjuna.objectstore.VolatileStore}</entry>
+
+ <!-- default is under user.home - must be writeable!) -->
+ <entry key="ObjectStoreEnvironmentBean.objectStoreDir">${wikittyJBosstsStoreDir:target${/}wikitty-jbossts}</entry>
+
+ <!-- (default is ON) -->
+ <entry key="ObjectStoreEnvironmentBean.transactionSync">ON</entry>
+
+ <!-- (Must be unique across all Arjuna instances.) -->
+ <entry key="CoreEnvironmentBean.nodeIdentifier">1</entry>
+
+ <!-- Which Xid types to recover -->
+ <entry key="JTAEnvironmentBean.xaRecoveryNodes">1</entry>
+
+ <entry key="JTAEnvironmentBean.xaResourceOrphanFilterClassNames">
+ com.arjuna.ats.internal.jta.recovery.arjunacore.JTATransactionLogXAResourceOrphanFilter
+ com.arjuna.ats.internal.jta.recovery.arjunacore.JTANodeNameXAResourceOrphanFilter
+ </entry>
+
+ <!--
+ Base port number for determining a unique number to associate with an instance of the transaction service
+ (which is needed in order to support multiple instances on the same machine).
+ Use the value 0 to allow the system to select the first available port number.
+ If the port number is non-zero and the port is in use then the value will be incremented until either a successful binding
+ to the loopback address is created or until the the maximum number of ports (specified by the
+ CoreEnvironmentBean.socketProcessIdMaxPorts property) have been tried or until the port number
+ reaches the maximum possible port number.
+ -->
+ <entry key="CoreEnvironmentBean.socketProcessIdPort">0</entry>
+
+
+
+ <!--
+ Periodic recovery modules to use. Invoked in the order they appear in the list.
+ Check http://www.jboss.org/community/docs/DOC-10788 for more information
+ on recovery modules and their configuration when running in various
+ deployments.
+ -->
+ <entry key="RecoveryEnvironmentBean.recoveryModuleClassNames">
+ com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule
+ com.arjuna.ats.internal.txoj.recovery.TORecoveryModule
+ com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule
+ </entry>
+
+ <!-- Expiry scanners to use (order of invocation is random). -->
+ <entry key="RecoveryEnvironmentBean.expiryScannerClassNames">
+ com.arjuna.ats.internal.arjuna.recovery.ExpiredTransactionStatusManagerScanner
+ </entry>
+
+ <!--
+ Add the following to the set of expiryScannerClassNames above to move logs that cannot be completed by failure recovery.
+ But be sure you know what you are doing and why!
+ com.arjuna.ats.internal.arjuna.recovery.AtomicActionExpiryScanner
+ -->
+
+ <!--
+ The address and port number on which the recovery manager listens
+ If running within an AS then the address the AS is bound to (jboss.bind.address) takes precedence
+ -->
+ <entry key="RecoveryEnvironmentBean.recoveryPort">4712</entry>
+
+ <entry key="RecoveryEnvironmentBean.recoveryAddress"></entry>
+
+ <!--
+ Use this to fix the port on which the TransactionStatusManager listens,
+ The default behaviour is to use any free port.
+ -->
+ <entry key="RecoveryEnvironmentBean.transactionStatusManagerPort">0</entry>
+
+ <!--
+ Use this to fix the address on which the TransactionStatusManager binds,
+ The default behaviour is to use the loopback address (ie localhost).
+ If running within an AS then the address the AS is bound to (jboss.bind.address) takes precedence
+ -->
+ <entry key="RecoveryEnvironmentBean.transactionStatusManagerAddress"></entry>
+
+ <!--
+ For cases where the recovery manager is in process with the transaction manager and nothing else uses
+ the ObjectStore, it is possible to disable the socket based recovery listener by setting this to NO.
+ Caution: use of this property can allow multiple recovery processes to run on the same ObjectStore
+ if you are not careful. That in turn can lead to incorrect transaction processing. Use with care.
+ -->
+ <entry key="RecoveryEnvironmentBean.recoveryListener">YES</entry>
+
+</properties>
1
0