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
December 2010
- 6 participants
- 128 discussions
Author: bpoussin
Date: 2010-12-22 15:41:17 +0100 (Wed, 22 Dec 2010)
New Revision: 644
Url: http://nuiton.org/repositories/revision/wikitty/644
Log:
change lucene version from 2.9.3 to 2.9.4
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-12-22 04:36:17 UTC (rev 643)
+++ trunk/pom.xml 2010-12-22 14:41:17 UTC (rev 644)
@@ -152,7 +152,7 @@
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
- <version>2.9.3</version>
+ <version>2.9.4</version>
<scope>compile</scope>
</dependency>
1
0
r643 - in trunk: wikitty-api/src/main/java/org/nuiton/wikitty/search wikitty-solr-impl/src/main/resources wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr
by bpoussin@users.nuiton.org 22 Dec '10
by bpoussin@users.nuiton.org 22 Dec '10
22 Dec '10
Author: bpoussin
Date: 2010-12-22 05:36:17 +0100 (Wed, 22 Dec 2010)
New Revision: 643
Url: http://nuiton.org/repositories/revision/wikitty/643
Log:
- search case unsensitive and accent unsensitive work for like and unlike
- units tests pass
- don't store not necessary field in lucene
Modified:
trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/Search.java
trunk/wikitty-solr-impl/src/main/resources/schema.xml
trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/SolrSearchTest.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 2010-12-22 03:40:56 UTC (rev 642)
+++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/Search.java 2010-12-22 04:36:17 UTC (rev 643)
@@ -207,6 +207,12 @@
return this;
}
+ public Search like(String element, String value) {
+ restrictions.add(RestrictionHelper.like(
+ elt(element), value, Like.SearchAs.AsText));
+ return this;
+ }
+
/**
* Unlike.
*
@@ -220,6 +226,12 @@
return this;
}
+ public Search unlike(String element, String value) {
+ restrictions.add(RestrictionHelper.unlike(
+ elt(element), value, Like.SearchAs.AsText));
+ return this;
+ }
+
/**
* Not equals.
*
Modified: trunk/wikitty-solr-impl/src/main/resources/schema.xml
===================================================================
--- trunk/wikitty-solr-impl/src/main/resources/schema.xml 2010-12-22 03:40:56 UTC (rev 642)
+++ trunk/wikitty-solr-impl/src/main/resources/schema.xml 2010-12-22 04:36:17 UTC (rev 643)
@@ -123,17 +123,17 @@
<field name="#id" type="string" indexed="true" stored="true" required="true" />
<field name="#extensions" type="string" indexed="true" stored="true" multiValued="true"/>
<field name="#not_null_fields" type="string" indexed="true" stored="true" multiValued="true"/>
- <field name="#tree.root" type="string" indexed="true" stored="true" multiValued="true"/>
- <field name="#tree.parents" type="string" indexed="true" stored="true" multiValued="true"/>
+ <field name="#tree.root" type="string" indexed="true" stored="false" multiValued="true"/>
+ <field name="#tree.parents" type="string" indexed="true" stored="false" multiValued="true"/>
<!-- need for WikittySearchEngineSolr implementation -->
<dynamicfield name="#tree*" type="string" indexed="true" stored="false" multiValued="true"/>
<!-- copy all field (except binary) in '#fulltext' field for fulltext search -->
- <field name="#fulltext" type="text" indexed="true" stored="true" multiValued="true"/>
+ <field name="#fulltext" type="text" indexed="true" stored="false" multiValued="true"/>
<!-- copied field not stored -->
- <dynamicField name="*_s_c" type="string_lc" indexed="true" stored="true" multiValued="true"/>
- <dynamicField name="*_s_t" type="text" indexed="true" stored="true" multiValued="true"/>
+ <dynamicField name="*_s_c" type="string_lc" indexed="true" stored="false" multiValued="true"/>
+ <dynamicField name="*_s_t" type="text" indexed="true" stored="false" multiValued="true"/>
<!-- on indexe pas les binary field -->
<dynamicField name="*_bi" type="binary" indexed="false" stored="false" multiValued="true"/>
Modified: trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/SolrSearchTest.java
===================================================================
--- trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/SolrSearchTest.java 2010-12-22 03:40:56 UTC (rev 642)
+++ trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/SolrSearchTest.java 2010-12-22 04:36:17 UTC (rev 643)
@@ -410,40 +410,40 @@
}
// on ignore ce test car le like toLowercase devrait disparaitre et pour l'instant il ne marche pas :(
- @Ignore
+// @Ignore
@Test
public void testLikeSearch() throws Exception {
- Criteria criteria = Search.query().like("Category.name", "hArDwArE", Like.SearchAs.ToLowerCase).criteria();
+ Criteria criteria = Search.query().like("Category.name", "hArDwArE").criteria();
PagedResult<String> pagedResult = ws.findAllByCriteria(null, criteria);
List<String> result = pagedResult.getAll();
assertEquals(1, result.size());
- criteria = Search.query().like("Category.name", "*wAre", Like.SearchAs.ToLowerCase).criteria();
+ criteria = Search.query().like("Category.name", "*wAr*").criteria();
pagedResult = ws.findAllByCriteria(null, criteria);
result = pagedResult.getAll();
assertEquals(1, result.size());
- criteria = Search.query().like("Category.name", "Har*", Like.SearchAs.ToLowerCase).criteria();
+ criteria = Search.query().like("Category.name", "Har*").criteria();
pagedResult = ws.findAllByCriteria(null, criteria);
result = pagedResult.getAll();
assertEquals(1, result.size());
- criteria = Search.query().like("Test.description", "help", Like.SearchAs.AsText).criteria();
+ criteria = Search.query().like("Test.description", "help").criteria();
pagedResult = ws.findAllByCriteria(null, criteria);
assertEquals(1, pagedResult.getNumFound());
- criteria = Search.query().like("Test.description", "helped", Like.SearchAs.AsText).criteria();
+ criteria = Search.query().like("Test.description", "helped").criteria();
pagedResult = ws.findAllByCriteria(null, criteria);
assertEquals(1, pagedResult.getNumFound());
}
// on ignore ce test car le like toLowercase devrait disparaitre et pour l'instant il ne marche pas :(
- @Ignore
+// @Ignore
@Test
public void testLikeStrict() throws Exception {
Criteria criteria = Search.query()
- .like("Product.name_s", "paint red", SearchAs.ToLowerCase)
+ .like("Product.name_s", "paint red")
.criteria()
.setFirstIndex(0).setEndIndex(Criteria.ALL_ELEMENTS);
@@ -455,13 +455,13 @@
assertEquals("Paint red", w.getFieldAsString("Product", "name"));
criteria = Search.query()
- .like("Product.name_s", "paint", SearchAs.ToLowerCase)
+ .like("Product.name_s", "paint")
.criteria()
.setFirstIndex(0).setEndIndex(Criteria.ALL_ELEMENTS);
result = ws.findAllByCriteria(null, criteria);
list = result.getAll();
- assertEquals(0, list.size());
+ assertEquals(5, list.size());
}
/** test that doing a search with a date criteria is possible */
@@ -558,7 +558,6 @@
Assert.assertEquals(1, result.size());
}
{
- System.out.println("#######");
// avec accent specifiquement sur le champs name
// mais sans accent pour la recherche
// et et majuscule
1
0
r642 - in trunk/wikitty-solr-impl/src: main/java/org/nuiton/wikitty/storage/solr main/resources test/java/org/nuiton/wikitty/storage/solr
by bpoussin@users.nuiton.org 22 Dec '10
by bpoussin@users.nuiton.org 22 Dec '10
22 Dec '10
Author: bpoussin
Date: 2010-12-22 04:40:56 +0100 (Wed, 22 Dec 2010)
New Revision: 642
Url: http://nuiton.org/repositories/revision/wikitty/642
Log:
- search case unsensitive and accent unsensitive work for like and unlike
Modified:
trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/Restriction2Solr.java
trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/WikittySearchEngineSolr.java
trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/WikittySearchEngineSolrIndexInTreeNode.java
trunk/wikitty-solr-impl/src/main/resources/schema.xml
trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/SolrSearchTest.java
trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/TreeTest.java
Modified: trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/Restriction2Solr.java
===================================================================
--- trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/Restriction2Solr.java 2010-12-21 15:34:09 UTC (rev 641)
+++ trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/Restriction2Solr.java 2010-12-22 03:40:56 UTC (rev 642)
@@ -285,7 +285,7 @@
element2solr += WikittySolrConstant.SUFFIX_STRING_FULLTEXT;
break;
case ToLowerCase:
- element2solr += WikittySolrConstant.SUFFIX_STRING_FULLTEXT;
+ element2solr += WikittySolrConstant.SUFFIX_STRING_LOWERCASE;
break;
}
}
Modified: trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/WikittySearchEngineSolr.java
===================================================================
--- trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/WikittySearchEngineSolr.java 2010-12-21 15:34:09 UTC (rev 641)
+++ trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/WikittySearchEngineSolr.java 2010-12-22 03:40:56 UTC (rev 642)
@@ -62,6 +62,7 @@
import org.nuiton.wikitty.search.Search;
import java.io.File;
+import java.util.Collections;
import org.nuiton.util.ApplicationConfig;
import org.nuiton.wikitty.WikittyConfig;
import org.nuiton.wikitty.WikittyUtil;
@@ -244,7 +245,6 @@
// Copy old field value
SolrDocument found = SolrUtil.findById(solrServer, id);
if (found != null) {
- // FIXME poussin 20101209 a finir en ne copiant que le necessaire voir javadoc du package
doc = SolrUtil.copySolrDocument(found, true, fieldToCopyPattern);
solrResource.addDoc(id, doc);
} else {
@@ -263,7 +263,7 @@
Collection<String> includedChildNodeIds = getIncludedNodeIds(id);
Collection<String> excludedChildNodeIds = getExcludedNodeIds(id);
- // Find all node contain child
+ // Find all node contain is as attachment
SolrQuery query = new SolrQuery(SOLR_QUERY_PARSER
+ WikittyTreeNode.FQ_FIELD_WIKITTYTREENODE_ATTACHMENT
+ SUFFIX_WIKITTY + ":" + id);
@@ -389,31 +389,56 @@
if (w.hasExtension(WikittyTreeNode.EXT_WIKITTYTREENODE)) {
Set<String> attachments = WikittyTreeNodeHelper.getAttachment(w);
- reindexChildTreeNode.putIncludedAttachments(id, attachments);
+ if (attachments == null) {
+ attachments = Collections.emptySet();
+ }
- // Search deleted children
+ //
+ // recherche des anciennes attachments
+ //
+ Collection oldAttachments = null;
+ Set<String> oldAttachmentsCopy;
+
+ // Search deleted attachments
SolrDocument treeNodeDoc = SolrUtil.findById(solrServer, id);
if (treeNodeDoc != null) {
- Collection oldAttachments = treeNodeDoc.getFieldValues(
+ oldAttachments = treeNodeDoc.getFieldValues(
WikittyTreeNode.FQ_FIELD_WIKITTYTREENODE_ATTACHMENT + SUFFIX_WIKITTY);
- if (oldAttachments != null) {
- // if no more children, remove all old children
- if(attachments == null) {
- reindexChildTreeNode.putExcludedAttachments(id, oldAttachments);
- } else {
- // exclude only the removed children
- for (Object oldAttachment : oldAttachments) {
- if(!attachments.contains(oldAttachment)) {
- reindexChildTreeNode.putExcludedAttachment(id,(String) oldAttachment);
- }
- }
- }
- }
}
+ // make copy to modify it
+ if (oldAttachments == null) {
+ oldAttachments = Collections.emptySet();
+ }
+ oldAttachmentsCopy = new HashSet<String>(oldAttachments);
- // Get new parent id (may be the same old parent)
- String parentId = WikittyTreeNodeHelper.getParent(w);
- reindexChildTreeNode.putParent(id, parentId);
+
+
+ // les attachments seulement dans old doivent etre exclus
+ oldAttachmentsCopy.removeAll(attachments);
+ reindexChildTreeNode.putExcludedAttachments(id, oldAttachmentsCopy);
+
+ if (w.getDirty().contains(WikittyTreeNode.FQ_FIELD_WIKITTYTREENODE_PARENT)
+ || null == WikittyTreeNodeHelper.getParent(w)
+ || WikittyUtil.versionGreaterThan("1", w.getVersion())) {
+ // si le pere a change
+ // ou qu'il est null (creation d'un nouvel arbre)
+ // ou que l'objet n'a jamais ete sauve 1 > version
+ // il faut indexer les attachments
+
+ // il faut reindexer tous les attachments
+ reindexChildTreeNode.putIncludedAttachments(id, attachments);
+
+ // Get new parent id (may be the same old parent)
+ String parentId = WikittyTreeNodeHelper.getParent(w);
+ reindexChildTreeNode.putParent(id, parentId);
+ } else {
+ // les attachments seulement dans les nouveaux doivent etre inclus
+ Set<String> attachmentsCopy = new HashSet<String>(attachments);
+ attachmentsCopy.removeAll(oldAttachments);
+ reindexChildTreeNode.putIncludedAttachments(id, attachmentsCopy);
+ }
+
+
}
// Index
Modified: trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/WikittySearchEngineSolrIndexInTreeNode.java
===================================================================
--- trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/WikittySearchEngineSolrIndexInTreeNode.java 2010-12-21 15:34:09 UTC (rev 641)
+++ trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/WikittySearchEngineSolrIndexInTreeNode.java 2010-12-22 03:40:56 UTC (rev 642)
@@ -65,8 +65,6 @@
import java.util.LinkedHashSet;
import java.util.LinkedList;
import org.nuiton.util.ApplicationConfig;
-import org.nuiton.util.CollectionUtil;
-import org.nuiton.util.StringUtil;
import org.nuiton.wikitty.WikittyConfig;
import org.nuiton.wikitty.WikittyUtil;
import org.nuiton.wikitty.entities.WikittyTreeNodeHelper;
@@ -257,6 +255,14 @@
return result;
}
+ /**
+ * Reindexe les noeuds passe en parametre et reindexe automatiquement leurs
+ * sous noeuds
+ *
+ * @param solrResource
+ * @param treeNodeToIndex
+ * @throws Exception
+ */
protected void reindexTreeNode(SolrResource solrResource,
LinkedHashSet<String> treeNodeToIndex) throws Exception {
LinkedList<String> todo = new LinkedList<String>(treeNodeToIndex);
@@ -341,6 +347,7 @@
for (String id : ids) {
SolrDocument doc = SolrUtil.findById(solrServer, id);
if (doc.containsKey(TREENODE_ROOT)) {
+ // child are automaticaly done in reindexTreeNode method
treeNodeToIndex.add(id);
}
solrResource.deleteDoc(id);
Modified: trunk/wikitty-solr-impl/src/main/resources/schema.xml
===================================================================
--- trunk/wikitty-solr-impl/src/main/resources/schema.xml 2010-12-21 15:34:09 UTC (rev 641)
+++ trunk/wikitty-solr-impl/src/main/resources/schema.xml 2010-12-22 03:40:56 UTC (rev 642)
@@ -58,6 +58,7 @@
sortMissingLast="true">
<analyzer> <!-- no type to indicated that used it for both type: index and query -->
<tokenizer class="solr.StandardTokenizerFactory"/>
+ <filter class="solr.ASCIIFoldingFilterFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
@@ -75,6 +76,7 @@
positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
+ <filter class="solr.ASCIIFoldingFilterFactory"/>
<filter class="solr.StopFilterFactory"
ignoreCase="true"
words="stopwords_fr.txt"
@@ -82,7 +84,8 @@
/>
<filter class="solr.WordDelimiterFilterFactory"
generateWordParts="1" generateNumberParts="1" catenateWords="1"
- catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
+ catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"
+ preserveOriginal="1"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EnglishPorterFilterFactory"
protected="protwords.txt"/>
@@ -90,13 +93,15 @@
</analyzer>
<analyzer type="query">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
+ <filter class="solr.ASCIIFoldingFilterFactory"/>
<filter class="solr.SynonymFilterFactory"
synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
<filter class="solr.StopFilterFactory"
ignoreCase="true" words="stopwords_fr.txt"/>
<filter class="solr.WordDelimiterFilterFactory"
generateWordParts="1" generateNumberParts="1" catenateWords="0"
- catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
+ catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"
+ preserveOriginal="1"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EnglishPorterFilterFactory"
protected="protwords.txt"/>
Modified: trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/SolrSearchTest.java
===================================================================
--- trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/SolrSearchTest.java 2010-12-21 15:34:09 UTC (rev 641)
+++ trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/SolrSearchTest.java 2010-12-22 03:40:56 UTC (rev 642)
@@ -540,9 +540,32 @@
{
// avec accent specifiquement sur le champs name mais sans accent pour la recherche
Criteria criteria = Search.query().eq(
- WikittyGroup.FQ_FIELD_WIKITTYGROUP_NAME,"ceca").criteria();
+ WikittyGroup.FQ_FIELD_WIKITTYGROUP_NAME
+ + WikittySolrConstant.SUFFIX_STRING
+ + WikittySolrConstant.SUFFIX_STRING_FULLTEXT, "ceca").criteria();
PagedResult<String> result = ws.findAllByCriteria(null, criteria);
Assert.assertEquals(1, result.size());
}
+ {
+ // avec accent specifiquement sur le champs name
+ // mais sans accent pour la recherche
+ // et et majuscule
+ Criteria criteria = Search.query().eq(
+ WikittyGroup.FQ_FIELD_WIKITTYGROUP_NAME
+ + WikittySolrConstant.SUFFIX_STRING
+ + WikittySolrConstant.SUFFIX_STRING_FULLTEXT, "CECA").criteria();
+ PagedResult<String> result = ws.findAllByCriteria(null, criteria);
+ Assert.assertEquals(1, result.size());
+ }
+ {
+ System.out.println("#######");
+ // avec accent specifiquement sur le champs name
+ // mais sans accent pour la recherche
+ // et et majuscule
+ Criteria criteria = Search.query().like(
+ WikittyGroup.FQ_FIELD_WIKITTYGROUP_NAME, "CECA").criteria();
+ PagedResult<String> result = ws.findAllByCriteria(null, criteria);
+ Assert.assertEquals(1, result.size());
+ }
}
}
Modified: trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/TreeTest.java
===================================================================
--- trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/TreeTest.java 2010-12-21 15:34:09 UTC (rev 641)
+++ trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/TreeTest.java 2010-12-22 03:40:56 UTC (rev 642)
@@ -506,4 +506,19 @@
sum = sum(node32);
assertEquals(1, sum);
}
+
+ // verifier que l'indexation de l'arbre fonctionne bien et la reindexation aussi
+ @Test
+ public void testReindexation() throws Exception {
+// FIXME poussin 20101222 a faire
+ // creer deux arbres (3 noeud)
+ // mettre 3 attachments par noeud (les memes) dans les 2 arbres
+
+ // enlever un attachment par noeud et supprime le noeud intermediaire
+ // en meme temps et store les arbres
+
+ // verifier que tout est bien reindexe et que le dernier noeud est bien
+ // devenu un noeud root
+ }
+
}
1
0
Author: sletellier
Date: 2010-12-21 16:34:09 +0100 (Tue, 21 Dec 2010)
New Revision: 641
Url: http://nuiton.org/repositories/revision/wikitty/641
Log:
Update headers
Modified:
trunk/src/site/rst/generation.rst
trunk/wikitty-api/src/it/generation/src/test/java/org/nuiton/wikitty/test/entities/TestEntities.java
trunk/wikitty-api/src/it/generation/src/test/java/org/nuiton/wikitty/test/entities2/TestEntities.java
trunk/wikitty-api/src/it/generation/src/test/java/org/nuiton/wikitty/test/entities3/TestEntities.java
trunk/wikitty-api/src/it/generation/src/test/java/org/nuiton/wikitty/test/entities4/TestEntities.java
trunk/wikitty-api/src/it/generation/src/test/java/org/nuiton/wikitty/test/entities5/TestEntities.java
trunk/wikitty-api/src/main/java/org/nuiton/wikitty/WikittyProxy.java
trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyCache.java
trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceAccessStat.java
trunk/wikitty-api/src/test/java/org/nuiton/wikitty/addons/WikittyLabelUtilTest.java
trunk/wikitty-api/src/test/java/org/nuiton/wikitty/entities/BusinessEntityImplTest.java
trunk/wikitty-api/src/test/java/org/nuiton/wikitty/entities/WikittyCopyOnWriteTest.java
trunk/wikitty-api/src/test/java/org/nuiton/wikitty/entities/WikittyExtensionTest.java
trunk/wikitty-api/src/test/java/org/nuiton/wikitty/services/WikittyServiceCachedTest.java
trunk/wikitty-dto/src/main/java/org/nuiton/wikitty/dto/DTOHelper.java
trunk/wikitty-jdbc-impl/src/test/java/org/nuiton/wikitty/services/ProxyTest.java
trunk/wikitty-jdbc-impl/src/test/resources/log4j.properties
trunk/wikitty-jdbc-impl/src/test/resources/postrges-wikitty-config.properties
trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/AbstractAction.java
trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/AbstractActionOnWikitty.java
trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/ActionEdit.java
trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/ActionError.java
trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/ActionEval.java
trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/ActionRaw.java
trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/ActionView.java
trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/WikittyPublicationAction.java
trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/WikittyPublicationContext.java
trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/WikittyPublicationServlet.java
trunk/wikitty-publication/src/main/resources/wikitty-publication-ws-codelutin.properties
trunk/wikitty-publication/src/main/webapp/WEB-INF/jsp/edit.jsp
trunk/wikitty-publication/src/main/webapp/WEB-INF/jsp/footer.jsp
trunk/wikitty-publication/src/main/webapp/WEB-INF/jsp/header.jsp
trunk/wikitty-publication/src/main/webapp/WEB-INF/jsp/view.jsp
trunk/wikitty-publication/src/main/webapp/WEB-INF/web.xml
trunk/wikitty-publication/src/main/webapp/css/wikitty-publication.css
trunk/wikitty-publication/src/site/rst/wp-analyse.rst
trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/FieldModifier.java
trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/SolrResource.java
trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/SolrUtil.java
trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/TypeFieldModifier.java
trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/WikittySolrConstant.java
trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/package-info.java
trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/WikittySearchEngineSolrTest.java
Modified: trunk/src/site/rst/generation.rst
===================================================================
--- trunk/src/site/rst/generation.rst 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/src/site/rst/generation.rst 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,3 +1,27 @@
+.. -
+.. * #%L
+.. * Wikitty
+.. *
+.. * $Id$
+.. * $HeadURL$
+.. * %%
+.. * Copyright (C) 2009 - 2010 CodeLutin
+.. * %%
+.. * This program is free software: you can redistribute it and/or modify
+.. * it under the terms of the GNU Lesser General Public License as
+.. * published by the Free Software Foundation, either version 3 of the
+.. * License, or (at your option) any later version.
+.. *
+.. * This program is distributed in the hope that it will be useful,
+.. * but WITHOUT ANY WARRANTY; without even the implied warranty of
+.. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+.. * GNU General Lesser Public License for more details.
+.. *
+.. * You should have received a copy of the GNU General Lesser Public
+.. * License along with this program. If not, see
+.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+.. * #L%
+.. -
======================================
Générer son modèle métier vers Wikitty
======================================
Modified: trunk/wikitty-api/src/it/generation/src/test/java/org/nuiton/wikitty/test/entities/TestEntities.java
===================================================================
--- trunk/wikitty-api/src/it/generation/src/test/java/org/nuiton/wikitty/test/entities/TestEntities.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-api/src/it/generation/src/test/java/org/nuiton/wikitty/test/entities/TestEntities.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * Wikitty :: api
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.test.entities;
import org.junit.Test;
Modified: trunk/wikitty-api/src/it/generation/src/test/java/org/nuiton/wikitty/test/entities2/TestEntities.java
===================================================================
--- trunk/wikitty-api/src/it/generation/src/test/java/org/nuiton/wikitty/test/entities2/TestEntities.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-api/src/it/generation/src/test/java/org/nuiton/wikitty/test/entities2/TestEntities.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * Wikitty :: api
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.test.entities2;
import org.junit.Test;
Modified: trunk/wikitty-api/src/it/generation/src/test/java/org/nuiton/wikitty/test/entities3/TestEntities.java
===================================================================
--- trunk/wikitty-api/src/it/generation/src/test/java/org/nuiton/wikitty/test/entities3/TestEntities.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-api/src/it/generation/src/test/java/org/nuiton/wikitty/test/entities3/TestEntities.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * Wikitty :: api
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.test.entities3;
import org.junit.Test;
Modified: trunk/wikitty-api/src/it/generation/src/test/java/org/nuiton/wikitty/test/entities4/TestEntities.java
===================================================================
--- trunk/wikitty-api/src/it/generation/src/test/java/org/nuiton/wikitty/test/entities4/TestEntities.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-api/src/it/generation/src/test/java/org/nuiton/wikitty/test/entities4/TestEntities.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * Wikitty :: api
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.test.entities4;
import org.junit.Test;
Modified: trunk/wikitty-api/src/it/generation/src/test/java/org/nuiton/wikitty/test/entities5/TestEntities.java
===================================================================
--- trunk/wikitty-api/src/it/generation/src/test/java/org/nuiton/wikitty/test/entities5/TestEntities.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-api/src/it/generation/src/test/java/org/nuiton/wikitty/test/entities5/TestEntities.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * Wikitty :: api
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.test.entities4;
import org.junit.Test;
Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/WikittyProxy.java
===================================================================
--- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/WikittyProxy.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/WikittyProxy.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -25,14 +25,22 @@
package org.nuiton.wikitty;
-import org.nuiton.wikitty.entities.Wikitty;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.util.ApplicationConfig;
+import org.nuiton.util.TimeTrace;
import org.nuiton.wikitty.entities.BusinessEntity;
import org.nuiton.wikitty.entities.BusinessEntityImpl;
+import org.nuiton.wikitty.entities.Wikitty;
import org.nuiton.wikitty.entities.WikittyExtension;
+import org.nuiton.wikitty.entities.WikittyTreeNode;
+import org.nuiton.wikitty.search.Criteria;
import org.nuiton.wikitty.search.PagedResult;
-import org.nuiton.wikitty.search.Criteria;
+import org.nuiton.wikitty.search.Search;
+import org.nuiton.wikitty.search.operators.Element;
+import org.nuiton.wikitty.services.WikittyEvent;
import org.nuiton.wikitty.services.WikittyServiceEnhanced;
-import org.nuiton.wikitty.services.WikittyEvent;
+
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@@ -49,9 +57,6 @@
import org.nuiton.util.TimeTrace;
import org.nuiton.wikitty.entities.WikittyTreeNode;
-import org.nuiton.wikitty.search.operators.Element;
-import org.nuiton.wikitty.search.Search;
-
/**
* Wikitty proxy is used to transform wikitty object used by {@link WikittyService}
* into business objects used by applications.
Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyCache.java
===================================================================
--- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyCache.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyCache.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * Wikitty :: api
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 CodeLutin, Benjamin Poussin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.services;
import org.nuiton.wikitty.entities.Wikitty;
Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceAccessStat.java
===================================================================
--- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceAccessStat.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceAccessStat.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,16 +1,30 @@
+/*
+ * #%L
+ * Wikitty :: api
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 CodeLutin, Benjamin Poussin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.services;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.util.ApplicationConfig;
@@ -25,6 +39,17 @@
import org.nuiton.wikitty.entities.WikittyTreeNode;
import org.nuiton.wikitty.search.Criteria;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
/**
*
* @author poussin
Modified: trunk/wikitty-api/src/test/java/org/nuiton/wikitty/addons/WikittyLabelUtilTest.java
===================================================================
--- trunk/wikitty-api/src/test/java/org/nuiton/wikitty/addons/WikittyLabelUtilTest.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-api/src/test/java/org/nuiton/wikitty/addons/WikittyLabelUtilTest.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,6 +1,29 @@
+/*
+ * #%L
+ * Wikitty :: api
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 CodeLutin, Benjamin Poussin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.addons;
-import static org.junit.Assert.*;
import org.junit.Test;
import org.nuiton.wikitty.WikittyConfig;
import org.nuiton.wikitty.WikittyProxy;
@@ -13,6 +36,8 @@
import org.nuiton.wikitty.entities.WikittyImpl;
import org.nuiton.wikitty.search.PagedResult;
+import static org.junit.Assert.assertEquals;
+
public class WikittyLabelUtilTest {
@Test
Modified: trunk/wikitty-api/src/test/java/org/nuiton/wikitty/entities/BusinessEntityImplTest.java
===================================================================
--- trunk/wikitty-api/src/test/java/org/nuiton/wikitty/entities/BusinessEntityImplTest.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-api/src/test/java/org/nuiton/wikitty/entities/BusinessEntityImplTest.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * Wikitty :: api
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 CodeLutin, Benjamin Poussin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.entities;
import org.apache.commons.logging.Log;
Modified: trunk/wikitty-api/src/test/java/org/nuiton/wikitty/entities/WikittyCopyOnWriteTest.java
===================================================================
--- trunk/wikitty-api/src/test/java/org/nuiton/wikitty/entities/WikittyCopyOnWriteTest.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-api/src/test/java/org/nuiton/wikitty/entities/WikittyCopyOnWriteTest.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,13 +1,37 @@
+/*
+ * #%L
+ * Wikitty :: api
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 CodeLutin, Benjamin Poussin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.entities;
-import java.util.Collection;
-import java.util.Collections;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Assert;
import org.junit.Test;
+import java.util.Collections;
+
/**
*
* @author poussin
Modified: trunk/wikitty-api/src/test/java/org/nuiton/wikitty/entities/WikittyExtensionTest.java
===================================================================
--- trunk/wikitty-api/src/test/java/org/nuiton/wikitty/entities/WikittyExtensionTest.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-api/src/test/java/org/nuiton/wikitty/entities/WikittyExtensionTest.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * Wikitty :: api
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 CodeLutin, Benjamin Poussin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.entities;
Modified: trunk/wikitty-api/src/test/java/org/nuiton/wikitty/services/WikittyServiceCachedTest.java
===================================================================
--- trunk/wikitty-api/src/test/java/org/nuiton/wikitty/services/WikittyServiceCachedTest.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-api/src/test/java/org/nuiton/wikitty/services/WikittyServiceCachedTest.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,8 +1,30 @@
+/*
+ * #%L
+ * Wikitty :: api
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 CodeLutin, Benjamin Poussin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.services;
-import java.util.ArrayList;
-import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Test;
@@ -13,6 +35,9 @@
import org.nuiton.wikitty.entities.WikittyUser;
import org.nuiton.wikitty.entities.WikittyUserImpl;
+import java.util.ArrayList;
+import java.util.List;
+
/**
*
* @author poussin
Modified: trunk/wikitty-dto/src/main/java/org/nuiton/wikitty/dto/DTOHelper.java
===================================================================
--- trunk/wikitty-dto/src/main/java/org/nuiton/wikitty/dto/DTOHelper.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-dto/src/main/java/org/nuiton/wikitty/dto/DTOHelper.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2010 CodeLutin
+ * Copyright (C) 2010 CodeLutin, Benjamin Poussin
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/wikitty-jdbc-impl/src/test/java/org/nuiton/wikitty/services/ProxyTest.java
===================================================================
--- trunk/wikitty-jdbc-impl/src/test/java/org/nuiton/wikitty/services/ProxyTest.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-jdbc-impl/src/test/java/org/nuiton/wikitty/services/ProxyTest.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * Wikitty :: wikitty-jdbc-impl
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 CodeLutin, Benjamin Poussin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.services;
@@ -3,6 +27,4 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-
-import java.util.Collections;
import org.junit.Assert;
import org.junit.Test;
@@ -17,6 +39,8 @@
import org.nuiton.wikitty.entities.WikittyTreeNode;
import org.nuiton.wikitty.entities.WikittyTreeNodeImpl;
+import java.util.Collections;
+
/**
*
* @author poussin
Modified: trunk/wikitty-jdbc-impl/src/test/resources/log4j.properties
===================================================================
--- trunk/wikitty-jdbc-impl/src/test/resources/log4j.properties 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-jdbc-impl/src/test/resources/log4j.properties 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,23 +1,23 @@
###
# #%L
# Wikitty :: wikitty-jdbc-impl
-#
+#
# $Id$
# $HeadURL$
# %%
# Copyright (C) 2010 CodeLutin, Benjamin Poussin
# %%
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License as
-# published by the Free Software Foundation, either version 3 of the
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Lesser Public License for more details.
-#
-# You should have received a copy of the GNU General Lesser Public
+#
+# You should have received a copy of the GNU General Lesser Public
# License along with this program. If not, see
# <http://www.gnu.org/licenses/lgpl-3.0.html>.
# #L%
Modified: trunk/wikitty-jdbc-impl/src/test/resources/postrges-wikitty-config.properties
===================================================================
--- trunk/wikitty-jdbc-impl/src/test/resources/postrges-wikitty-config.properties 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-jdbc-impl/src/test/resources/postrges-wikitty-config.properties 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,3 +1,27 @@
+###
+# #%L
+# Wikitty :: wikitty-jdbc-impl
+#
+# $Id$
+# $HeadURL$
+# %%
+# Copyright (C) 2009 - 2010 CodeLutin, Benjamin Poussin
+# %%
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Lesser Public License for more details.
+#
+# You should have received a copy of the GNU General Lesser Public
+# License along with this program. If not, see
+# <http://www.gnu.org/licenses/lgpl-3.0.html>.
+# #L%
+###
wikitty.storage.jdbc.driver=org.postgresql.Driver
wikitty.storage.jdbc.host=jdbc:postgresql://localhost/test
wikitty.storage.jdbc.password=password
Modified: trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/AbstractAction.java
===================================================================
--- trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/AbstractAction.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/AbstractAction.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * Wikitty :: publication
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 CodeLutin, Benjamin Poussin, Benjamin Poussin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.publication;
Modified: trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/AbstractActionOnWikitty.java
===================================================================
--- trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/AbstractActionOnWikitty.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/AbstractActionOnWikitty.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,7 +1,30 @@
+/*
+ * #%L
+ * Wikitty :: publication
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 CodeLutin, Benjamin Poussin, Benjamin Poussin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.publication;
-import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.wikitty.WikittyUtil;
@@ -14,6 +37,8 @@
import org.nuiton.wikitty.search.Criteria;
import org.nuiton.wikitty.search.Search;
+import java.util.List;
+
/**
*
* @author poussin
Modified: trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/ActionEdit.java
===================================================================
--- trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/ActionEdit.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/ActionEdit.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,7 +1,29 @@
+/*
+ * #%L
+ * Wikitty :: publication
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 CodeLutin, Benjamin Poussin, Benjamin Poussin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.publication;
-import java.util.HashMap;
-import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.util.ApplicationConfig;
@@ -16,6 +38,9 @@
import org.nuiton.wikitty.search.Criteria;
import org.nuiton.wikitty.search.operators.Element;
+import java.util.HashMap;
+import java.util.Map;
+
/**
*
* @author poussin
Modified: trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/ActionError.java
===================================================================
--- trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/ActionError.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/ActionError.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * Wikitty :: publication
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 CodeLutin, Benjamin Poussin, Benjamin Poussin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.publication;
Modified: trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/ActionEval.java
===================================================================
--- trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/ActionEval.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/ActionEval.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * Wikitty :: publication
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 CodeLutin, Benjamin Poussin, Benjamin Poussin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.publication;
import java.util.ArrayList;
Modified: trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/ActionRaw.java
===================================================================
--- trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/ActionRaw.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/ActionRaw.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * Wikitty :: publication
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 CodeLutin, Benjamin Poussin, Benjamin Poussin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.publication;
import org.apache.commons.logging.Log;
Modified: trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/ActionView.java
===================================================================
--- trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/ActionView.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/ActionView.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * Wikitty :: publication
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 CodeLutin, Benjamin Poussin, Benjamin Poussin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.publication;
import org.apache.commons.logging.Log;
Modified: trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/WikittyPublicationAction.java
===================================================================
--- trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/WikittyPublicationAction.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/WikittyPublicationAction.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * Wikitty :: publication
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 CodeLutin, Benjamin Poussin, Benjamin Poussin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.publication;
/**
Modified: trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/WikittyPublicationContext.java
===================================================================
--- trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/WikittyPublicationContext.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/WikittyPublicationContext.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * Wikitty :: publication
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 CodeLutin, Benjamin Poussin, Benjamin Poussin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.publication;
import java.io.File;
Modified: trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/WikittyPublicationServlet.java
===================================================================
--- trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/WikittyPublicationServlet.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-publication/src/main/java/org/nuiton/wikitty/publication/WikittyPublicationServlet.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * Wikitty :: publication
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 CodeLutin, Benjamin Poussin, Benjamin Poussin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.publication;
Modified: trunk/wikitty-publication/src/main/resources/wikitty-publication-ws-codelutin.properties
===================================================================
--- trunk/wikitty-publication/src/main/resources/wikitty-publication-ws-codelutin.properties 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-publication/src/main/resources/wikitty-publication-ws-codelutin.properties 2010-12-21 15:34:09 UTC (rev 641)
@@ -1 +1,25 @@
+###
+# #%L
+# Wikitty :: publication
+#
+# $Id$
+# $HeadURL$
+# %%
+# Copyright (C) 2010 CodeLutin, Benjamin Poussin
+# %%
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Lesser Public License for more details.
+#
+# You should have received a copy of the GNU General Lesser Public
+# License along with this program. If not, see
+# <http://www.gnu.org/licenses/lgpl-3.0.html>.
+# #L%
+###
wikitty.data.directory=/var/lib/wikitty-publication/codelutin
Modified: trunk/wikitty-publication/src/main/webapp/WEB-INF/jsp/edit.jsp
===================================================================
--- trunk/wikitty-publication/src/main/webapp/WEB-INF/jsp/edit.jsp 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-publication/src/main/webapp/WEB-INF/jsp/edit.jsp 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,6 +1,30 @@
+<!--
+ #%L
+ Wikitty :: publication
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2010 CodeLutin, Benjamin Poussin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
<%--
Document : edit
- Created on : 6 d�c. 2010, 18:32:18
+ Created on : 6 d�c. 2010, 18:32:18
Author : poussin
--%>
Modified: trunk/wikitty-publication/src/main/webapp/WEB-INF/jsp/footer.jsp
===================================================================
--- trunk/wikitty-publication/src/main/webapp/WEB-INF/jsp/footer.jsp 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-publication/src/main/webapp/WEB-INF/jsp/footer.jsp 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,6 +1,30 @@
+<!--
+ #%L
+ Wikitty :: publication
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2010 CodeLutin, Benjamin Poussin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
<%--
Document : footer
- Created on : 6 d�c. 2010, 19:21:22
+ Created on : 6 d�c. 2010, 19:21:22
Author : poussin
--%>
Modified: trunk/wikitty-publication/src/main/webapp/WEB-INF/jsp/header.jsp
===================================================================
--- trunk/wikitty-publication/src/main/webapp/WEB-INF/jsp/header.jsp 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-publication/src/main/webapp/WEB-INF/jsp/header.jsp 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,3 +1,27 @@
+<!--
+ #%L
+ Wikitty :: publication
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2010 CodeLutin, Benjamin Poussin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
<%--
Document : header
Created on : 6 déc. 2010, 19:21:06
Modified: trunk/wikitty-publication/src/main/webapp/WEB-INF/jsp/view.jsp
===================================================================
--- trunk/wikitty-publication/src/main/webapp/WEB-INF/jsp/view.jsp 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-publication/src/main/webapp/WEB-INF/jsp/view.jsp 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,6 +1,30 @@
+<!--
+ #%L
+ Wikitty :: publication
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2010 CodeLutin, Benjamin Poussin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
<%--
Document : view
- Created on : 7 d�c. 2010, 04:18:13
+ Created on : 7 d�c. 2010, 04:18:13
Author : poussin
--%>
Modified: trunk/wikitty-publication/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/wikitty-publication/src/main/webapp/WEB-INF/web.xml 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-publication/src/main/webapp/WEB-INF/web.xml 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,4 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ Wikitty :: publication
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2010 CodeLutin, Benjamin Poussin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
+
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http:/java.sun.com/dtd/web-app_2_3.dtd">
<!-- SERVLET -->
<display-name>Wikitty Publication</display-name>
Modified: trunk/wikitty-publication/src/main/webapp/css/wikitty-publication.css
===================================================================
--- trunk/wikitty-publication/src/main/webapp/css/wikitty-publication.css 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-publication/src/main/webapp/css/wikitty-publication.css 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * Wikitty :: publication
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 CodeLutin, Benjamin Poussin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
.edit label {
float : left;
width : 200px;
Modified: trunk/wikitty-publication/src/site/rst/wp-analyse.rst
===================================================================
--- trunk/wikitty-publication/src/site/rst/wp-analyse.rst 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-publication/src/site/rst/wp-analyse.rst 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,3 +1,27 @@
+.. -
+.. * #%L
+.. * Wikitty :: publication
+.. *
+.. * $Id$
+.. * $HeadURL$
+.. * %%
+.. * Copyright (C) 2010 CodeLutin, Benjamin Poussin
+.. * %%
+.. * This program is free software: you can redistribute it and/or modify
+.. * it under the terms of the GNU Lesser General Public License as
+.. * published by the Free Software Foundation, either version 3 of the
+.. * License, or (at your option) any later version.
+.. *
+.. * This program is distributed in the hope that it will be useful,
+.. * but WITHOUT ANY WARRANTY; without even the implied warranty of
+.. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+.. * GNU General Lesser Public License for more details.
+.. *
+.. * You should have received a copy of the GNU General Lesser Public
+.. * License along with this program. If not, see
+.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+.. * #L%
+.. -
===================
wikitty-publication
===================
Modified: trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/FieldModifier.java
===================================================================
--- trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/FieldModifier.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/FieldModifier.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * Wikitty :: wikitty-solr-impl
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 CodeLutin, Benjamin Poussin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.storage.solr;
import org.nuiton.wikitty.services.WikittyTransaction;
Modified: trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/SolrResource.java
===================================================================
--- trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/SolrResource.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/SolrResource.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * Wikitty :: wikitty-solr-impl
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 CodeLutin, Benjamin Poussin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.storage.solr;
@@ -7,16 +31,17 @@
import com.arjuna.ats.arjuna.state.InputObjectState;
import com.arjuna.ats.arjuna.state.OutputObjectState;
import com.arjuna.ats.internal.arjuna.abstractrecords.LastResourceRecord;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.solr.client.solrj.SolrServer;
+import org.apache.solr.common.SolrInputDocument;
+
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.solr.client.solrj.SolrServer;
-import org.apache.solr.common.SolrInputDocument;
/**
* Use to plug solr indexation in JTA transaction.
Modified: trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/SolrUtil.java
===================================================================
--- trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/SolrUtil.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/SolrUtil.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,10 +1,29 @@
+/*
+ * #%L
+ * Wikitty :: wikitty-solr-impl
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 CodeLutin, Benjamin Poussin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.storage.solr;
-import static org.nuiton.wikitty.storage.solr.WikittySolrConstant.*;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.solr.client.solrj.SolrQuery;
@@ -17,6 +36,18 @@
import org.nuiton.wikitty.WikittyException;
import org.nuiton.wikitty.entities.FieldType.TYPE;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+import static org.nuiton.wikitty.storage.solr.WikittySolrConstant.SOLR_ID;
+import static org.nuiton.wikitty.storage.solr.WikittySolrConstant.SUFFIX_BINARY;
+import static org.nuiton.wikitty.storage.solr.WikittySolrConstant.SUFFIX_BOOLEAN;
+import static org.nuiton.wikitty.storage.solr.WikittySolrConstant.SUFFIX_DATE;
+import static org.nuiton.wikitty.storage.solr.WikittySolrConstant.SUFFIX_NUMERIC;
+import static org.nuiton.wikitty.storage.solr.WikittySolrConstant.SUFFIX_STRING;
+import static org.nuiton.wikitty.storage.solr.WikittySolrConstant.SUFFIX_WIKITTY;
+
/**
*
* @author poussin
Modified: trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/TypeFieldModifier.java
===================================================================
--- trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/TypeFieldModifier.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/TypeFieldModifier.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,7 +1,29 @@
+/*
+ * #%L
+ * Wikitty :: wikitty-solr-impl
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 CodeLutin, Benjamin Poussin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.storage.solr;
-import static org.nuiton.wikitty.storage.solr.WikittySolrConstant.*;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.wikitty.WikittyUtil;
@@ -13,6 +35,16 @@
import org.nuiton.wikitty.services.WikittyTransaction;
import org.nuiton.wikitty.storage.WikittyExtensionStorage;
+import static org.nuiton.wikitty.storage.solr.WikittySolrConstant.SOLR_ALL_EXTENSIONS;
+import static org.nuiton.wikitty.storage.solr.WikittySolrConstant.SOLR_EXTENSIONS;
+import static org.nuiton.wikitty.storage.solr.WikittySolrConstant.SOLR_ID;
+import static org.nuiton.wikitty.storage.solr.WikittySolrConstant.SUFFIX_BINARY;
+import static org.nuiton.wikitty.storage.solr.WikittySolrConstant.SUFFIX_BOOLEAN;
+import static org.nuiton.wikitty.storage.solr.WikittySolrConstant.SUFFIX_DATE;
+import static org.nuiton.wikitty.storage.solr.WikittySolrConstant.SUFFIX_NUMERIC;
+import static org.nuiton.wikitty.storage.solr.WikittySolrConstant.SUFFIX_STRING;
+import static org.nuiton.wikitty.storage.solr.WikittySolrConstant.SUFFIX_WIKITTY;
+
/**
*
* @author poussin
Modified: trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/WikittySolrConstant.java
===================================================================
--- trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/WikittySolrConstant.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/WikittySolrConstant.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * Wikitty :: wikitty-solr-impl
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 CodeLutin, Benjamin Poussin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.storage.solr;
/**
Modified: trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/package-info.java
===================================================================
--- trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/package-info.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/package-info.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * Wikitty :: wikitty-solr-impl
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 CodeLutin, Benjamin Poussin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
/**
* <h1>Indexation</h1>
*
Modified: trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/WikittySearchEngineSolrTest.java
===================================================================
--- trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/WikittySearchEngineSolrTest.java 2010-12-21 15:33:48 UTC (rev 640)
+++ trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/WikittySearchEngineSolrTest.java 2010-12-21 15:34:09 UTC (rev 641)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * Wikitty :: wikitty-solr-impl
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.storage.solr;
1
0
r640 - in trunk/wikitty-perf-test: . src/main src/main/java/org/nuiton/wikitty/perftest src/main/resources
by sletellier@users.nuiton.org 21 Dec '10
by sletellier@users.nuiton.org 21 Dec '10
21 Dec '10
Author: sletellier
Date: 2010-12-21 16:33:48 +0100 (Tue, 21 Dec 2010)
New Revision: 640
Url: http://nuiton.org/repositories/revision/wikitty/640
Log:
- Reformat code
- Update headers
- Add log4j dependency
- Use log4j
Added:
trunk/wikitty-perf-test/src/main/resources/
trunk/wikitty-perf-test/src/main/resources/log4j.properties
Modified:
trunk/wikitty-perf-test/pom.xml
trunk/wikitty-perf-test/src/main/java/org/nuiton/wikitty/perftest/PerfTest.java
trunk/wikitty-perf-test/src/main/java/org/nuiton/wikitty/perftest/PerfTestLabelAdd.java
trunk/wikitty-perf-test/src/main/java/org/nuiton/wikitty/perftest/PerfTestLabelSearch.java
trunk/wikitty-perf-test/src/main/java/org/nuiton/wikitty/perftest/PerfTestSearch.java
trunk/wikitty-perf-test/src/main/java/org/nuiton/wikitty/perftest/PerfTestUtils.java
Modified: trunk/wikitty-perf-test/pom.xml
===================================================================
--- trunk/wikitty-perf-test/pom.xml 2010-12-21 15:32:36 UTC (rev 639)
+++ trunk/wikitty-perf-test/pom.xml 2010-12-21 15:33:48 UTC (rev 640)
@@ -48,6 +48,10 @@
<artifactId>commons-logging</artifactId>
</dependency>
<dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+ <dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
</dependency>
@@ -87,4 +91,17 @@
<name>Wikitty :: wikitty-perf-test</name>
<description>Wikitty performance tests</description>
<inceptionYear>2010</inceptionYear>
+
+ <build>
+
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </build>
</project>
\ No newline at end of file
Modified: trunk/wikitty-perf-test/src/main/java/org/nuiton/wikitty/perftest/PerfTest.java
===================================================================
--- trunk/wikitty-perf-test/src/main/java/org/nuiton/wikitty/perftest/PerfTest.java 2010-12-21 15:32:36 UTC (rev 639)
+++ trunk/wikitty-perf-test/src/main/java/org/nuiton/wikitty/perftest/PerfTest.java 2010-12-21 15:33:48 UTC (rev 640)
@@ -1,100 +1,129 @@
+/*
+ * #%L
+ * Wikitty :: wikitty-perf-test
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 CodeLutin, Benjamin Poussin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.perftest;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Random;
-
import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.wikitty.WikittyConfig;
import org.nuiton.wikitty.WikittyProxy;
-import org.nuiton.wikitty.WikittyConfig;
import org.nuiton.wikitty.WikittyService;
import org.nuiton.wikitty.WikittyServiceFactory;
-
+import org.nuiton.wikitty.entities.ExtensionFactory;
+import org.nuiton.wikitty.entities.FieldType.TYPE;
import org.nuiton.wikitty.entities.Wikitty;
+import org.nuiton.wikitty.entities.WikittyExtension;
import org.nuiton.wikitty.entities.WikittyImpl;
-import org.nuiton.wikitty.entities.FieldType.TYPE;
-import org.nuiton.wikitty.entities.ExtensionFactory;
-import org.nuiton.wikitty.entities.WikittyExtension;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+
public class PerfTest {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(PerfTest.class);
+
public static void main(String[] args) {
- WikittyConfig config = new WikittyConfig(args);
- int threadsNb = 20;
- int researches = 2001;
- int loopsToAvg = 5;
- int wikittiesToCreate = 70;
- if (threadsNb > researches)
- threadsNb = researches;
- boolean skipSearchesTests = false;
- boolean skipLabelsTests = false;
+ WikittyConfig config = new WikittyConfig(args);
+ int threadsNb = 20;
+ int researches = 2001;
+ int loopsToAvg = 5;
+ int wikittiesToCreate = 70;
+ if (threadsNb > researches) {
+ threadsNb = researches;
+ }
+ boolean skipSearchesTests = false;
+ boolean skipLabelsTests = false;
- WikittyService ws = WikittyServiceFactory.buildWikittyService(config);
- WikittyProxy proxy = new WikittyProxy(ws);
- WikittyExtension ext = ExtensionFactory.create("perfTest", "1")
- .addField("name", TYPE.STRING).addField("surname", TYPE.STRING)
- .addField("age", TYPE.NUMERIC).addField("height", TYPE.NUMERIC)
- .addField("birth", TYPE.DATE).addField("wedding", TYPE.DATE)
- .addField("isTrue", TYPE.BOOLEAN).addField("isFalse", TYPE.BOOLEAN)
- .addField("wiki1", TYPE.WIKITTY).addField("wiki2", TYPE.WIKITTY).extension();
+ WikittyService ws = WikittyServiceFactory.buildWikittyService(config);
+ WikittyProxy proxy = new WikittyProxy(ws);
+ WikittyExtension ext = ExtensionFactory.create("perfTest", "1")
+ .addField("name", TYPE.STRING).addField("surname", TYPE.STRING)
+ .addField("age", TYPE.NUMERIC).addField("height", TYPE.NUMERIC)
+ .addField("birth", TYPE.DATE).addField("wedding", TYPE.DATE)
+ .addField("isTrue", TYPE.BOOLEAN).addField("isFalse", TYPE.BOOLEAN)
+ .addField("wiki1", TYPE.WIKITTY).addField("wiki2", TYPE.WIKITTY).extension();
- Wikitty w = new WikittyImpl();
- Random rand = new Random();
- List<String> ids = new ArrayList<String>();
- for (int i = 0; i < wikittiesToCreate; i++) {
- w = new WikittyImpl();
- ids.add(w.getId());
- w.addExtension(ext);
- w.setField(ext.getName(), "name", RandomStringUtils.randomAscii(15));
- w.setField(ext.getName(), "surname", RandomStringUtils.randomAscii(20));
- w.setField(ext.getName(), "age", rand.nextInt(110));
- w.setField(ext.getName(), "height", rand.nextInt(230));
- w.setField(ext.getName(), "isTrue", rand.nextInt(1) == 0 ? true : false);
- w.setField(ext.getName(), "isFalse", rand.nextInt(1) == 1 ? true : false);
- w.setField(ext.getName(), "birth", "01/01/" + rand.nextInt(2010));
- w.setField(ext.getName(), "wiki1", w);
- proxy.store(w);
- }
+ Random rand = new Random();
+ List<String> ids = new ArrayList<String>();
+ for (int i = 0; i < wikittiesToCreate; i++) {
+ Wikitty w = new WikittyImpl();
+ ids.add(w.getId());
+ w.addExtension(ext);
+ w.setField(ext.getName(), "name", RandomStringUtils.randomAscii(15));
+ w.setField(ext.getName(), "surname", RandomStringUtils.randomAscii(20));
+ w.setField(ext.getName(), "age", rand.nextInt(110));
+ w.setField(ext.getName(), "height", rand.nextInt(230));
+ w.setField(ext.getName(), "isTrue", rand.nextInt(1) == 0);
+ w.setField(ext.getName(), "isFalse", rand.nextInt(1) == 1);
+ w.setField(ext.getName(), "birth", "01/01/" + rand.nextInt(2010));
+ w.setField(ext.getName(), "wiki1", w);
+ proxy.store(w);
+ }
- PerfTestUtils.out("Tests on searches :");
- if (!skipSearchesTests) {
- PerfTestUtils.out("== Tests on fields of type STRING ==");
- PerfTestSearch.search(ws, ext, loopsToAvg, researches, wikittiesToCreate, threadsNb, "name", "toto", true);
- PerfTestSearch.search(ws, ext, loopsToAvg, researches, wikittiesToCreate, threadsNb, "name", "toto", false);
+ PerfTestUtils.out("Tests on searches :");
+ if (!skipSearchesTests) {
+ PerfTestUtils.out("== Tests on fields of type STRING ==");
+ PerfTestSearch.search(ws, ext, loopsToAvg, researches, wikittiesToCreate, threadsNb, "name", "toto", true);
+ PerfTestSearch.search(ws, ext, loopsToAvg, researches, wikittiesToCreate, threadsNb, "name", "toto", false);
- PerfTestUtils.out("------------\n");
- PerfTestSearch.search(ws, ext, loopsToAvg, researches, wikittiesToCreate, threadsNb, "surname", "a", true);
- PerfTestSearch.search(ws, ext, loopsToAvg, researches, wikittiesToCreate, threadsNb, "surname", "a", false);
+ PerfTestUtils.out("------------\n");
+ PerfTestSearch.search(ws, ext, loopsToAvg, researches, wikittiesToCreate, threadsNb, "surname", "a", true);
+ PerfTestSearch.search(ws, ext, loopsToAvg, researches, wikittiesToCreate, threadsNb, "surname", "a", false);
- PerfTestUtils.out("== Tests on fields of type NUMERIC ==");
- PerfTestSearch.search(ws, ext, loopsToAvg, researches, wikittiesToCreate, threadsNb, "age", "40", true);
- PerfTestSearch.search(ws, ext, loopsToAvg, researches, wikittiesToCreate, threadsNb, "age", "40", false);
+ PerfTestUtils.out("== Tests on fields of type NUMERIC ==");
+ PerfTestSearch.search(ws, ext, loopsToAvg, researches, wikittiesToCreate, threadsNb, "age", "40", true);
+ PerfTestSearch.search(ws, ext, loopsToAvg, researches, wikittiesToCreate, threadsNb, "age", "40", false);
- PerfTestUtils.out("------------\n");
- PerfTestSearch.search(ws, ext, loopsToAvg, researches, wikittiesToCreate, threadsNb, "height", "100", true);
- PerfTestSearch.search(ws, ext, loopsToAvg, researches, wikittiesToCreate, threadsNb, "height", "100", false);
+ PerfTestUtils.out("------------\n");
+ PerfTestSearch.search(ws, ext, loopsToAvg, researches, wikittiesToCreate, threadsNb, "height", "100", true);
+ PerfTestSearch.search(ws, ext, loopsToAvg, researches, wikittiesToCreate, threadsNb, "height", "100", false);
- PerfTestUtils.out("== Tests on a field of type BOOLEAN ==");
- PerfTestSearch.search(ws, ext, loopsToAvg, researches, wikittiesToCreate, threadsNb, "isTrue", "true", true);
- PerfTestSearch.search(ws, ext, loopsToAvg, researches, wikittiesToCreate, threadsNb, "isTrue", "true", false);
+ PerfTestUtils.out("== Tests on a field of type BOOLEAN ==");
+ PerfTestSearch.search(ws, ext, loopsToAvg, researches, wikittiesToCreate, threadsNb, "isTrue", "true", true);
+ PerfTestSearch.search(ws, ext, loopsToAvg, researches, wikittiesToCreate, threadsNb, "isTrue", "true", false);
- PerfTestUtils.out("== Tests on a field of type DATE ==");
- PerfTestSearch.search(ws, ext, loopsToAvg, researches, wikittiesToCreate, threadsNb, "birth", "06/07/1720", true);
- PerfTestSearch.search(ws, ext, loopsToAvg, researches, wikittiesToCreate, threadsNb, "birth", "06/07/1720", false);
+ PerfTestUtils.out("== Tests on a field of type DATE ==");
+ PerfTestSearch.search(ws, ext, loopsToAvg, researches, wikittiesToCreate, threadsNb, "birth", "06/07/1720", true);
+ PerfTestSearch.search(ws, ext, loopsToAvg, researches, wikittiesToCreate, threadsNb, "birth", "06/07/1720", false);
- PerfTestUtils.out("== Tests on a field of type WIKITTY ==");
- String wikittySearched = proxy.restore(ids.get(rand.nextInt(wikittiesToCreate))).toString();
- PerfTestSearch.search(ws, ext, loopsToAvg, researches, wikittiesToCreate, threadsNb, "wiki1", wikittySearched, true);
- PerfTestSearch.search(ws, ext, loopsToAvg, researches, wikittiesToCreate, threadsNb, "wiki1", wikittySearched, false);
- } else {
- PerfTestUtils.out("Skipped");
- }
+ PerfTestUtils.out("== Tests on a field of type WIKITTY ==");
+ String wikittySearched = proxy.restore(ids.get(rand.nextInt(wikittiesToCreate))).toString();
+ PerfTestSearch.search(ws, ext, loopsToAvg, researches, wikittiesToCreate, threadsNb, "wiki1", wikittySearched, true);
+ PerfTestSearch.search(ws, ext, loopsToAvg, researches, wikittiesToCreate, threadsNb, "wiki1", wikittySearched, false);
+ } else {
+ PerfTestUtils.out("Skipped");
+ }
- PerfTestUtils.out("Tests on labels :");
- if (!skipLabelsTests) {
- PerfTestLabelAdd.addLabel(proxy, ids, loopsToAvg, threadsNb);
- PerfTestLabelSearch.searchLabel(proxy, ids, loopsToAvg, threadsNb);
- } else {
- PerfTestUtils.out("Skipped");
- }
+ PerfTestUtils.out("Tests on labels :");
+ if (!skipLabelsTests) {
+ PerfTestLabelAdd.addLabel(proxy, ids, loopsToAvg, threadsNb);
+ PerfTestLabelSearch.searchLabel(proxy, ids, loopsToAvg, threadsNb);
+ } else {
+ PerfTestUtils.out("Skipped");
+ }
}
}
Modified: trunk/wikitty-perf-test/src/main/java/org/nuiton/wikitty/perftest/PerfTestLabelAdd.java
===================================================================
--- trunk/wikitty-perf-test/src/main/java/org/nuiton/wikitty/perftest/PerfTestLabelAdd.java 2010-12-21 15:32:36 UTC (rev 639)
+++ trunk/wikitty-perf-test/src/main/java/org/nuiton/wikitty/perftest/PerfTestLabelAdd.java 2010-12-21 15:33:48 UTC (rev 640)
@@ -1,39 +1,70 @@
+/*
+ * #%L
+ * Wikitty :: wikitty-perf-test
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 CodeLutin, Benjamin Poussin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.perftest;
-import java.util.ArrayList;
-import java.util.List;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.nuiton.wikitty.WikittyProxy;
import org.nuiton.wikitty.addons.WikittyLabelUtil;
+import java.util.ArrayList;
+import java.util.List;
+
public class PerfTestLabelAdd {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(PerfTestLabelAdd.class);
+
private static class PerfTestLabelAddThread extends Thread {
- private int labelsToAdd;
- private WikittyProxy proxy;
- private List<String> ids;
- private int startAt;
+ private int labelsToAdd;
+ private WikittyProxy proxy;
+ private List<String> ids;
+ private int startAt;
- /**
- *
- * @param labelsToAdd
- * @param proxy
- * @param ids
- * @param startAt
- */
- PerfTestLabelAddThread(int labelsToAdd, WikittyProxy proxy, List<String> ids, int startAt) {
- this.labelsToAdd = labelsToAdd;
- this.proxy = proxy;
- this.ids = ids;
- this.startAt = startAt;
- }
+ /**
+ *
+ * @param labelsToAdd
+ * @param proxy
+ * @param ids
+ * @param startAt
+ */
+ PerfTestLabelAddThread(int labelsToAdd, WikittyProxy proxy, List<String> ids, int startAt) {
+ this.labelsToAdd = labelsToAdd;
+ this.proxy = proxy;
+ this.ids = ids;
+ this.startAt = startAt;
+ }
- @Override
- public void run() {
- long time = System.currentTimeMillis();
+ @Override
+ public void run() {
+ long time = System.currentTimeMillis();
- for (int i = startAt; i < (labelsToAdd + startAt); i++) {
- WikittyLabelUtil.addLabel(proxy, ids.get(i), ids.get(i) + time);
- }
- }
+ for (int i = startAt; i < (labelsToAdd + startAt); i++) {
+ WikittyLabelUtil.addLabel(proxy, ids.get(i), ids.get(i) + time);
+ }
+ }
}
/**
@@ -45,45 +76,47 @@
* @param threadsNb : the number of threads that will be created to add a part of the labels
*/
public static void addLabel(WikittyProxy proxy, List<String> ids, int loopsToAvg, int threadsNb) {
- long time = System.currentTimeMillis();
- int wikittiesToCreate = ids.size();
+ long time = System.currentTimeMillis();
+ int wikittiesToCreate = ids.size();
- for (int k = 0; k < loopsToAvg; k++) {
- for (String id : ids) {
- WikittyLabelUtil.addLabel(proxy, id, id + time);
- }
- }
- time = System.currentTimeMillis() - time;
- PerfTestUtils.out("1 thread took (average on " + loopsToAvg + " loops) " + (time / loopsToAvg) + " ms to add " + wikittiesToCreate +
- " labels on " + wikittiesToCreate + " wikitties\n");
+ for (int k = 0; k < loopsToAvg; k++) {
+ for (String id : ids) {
+ WikittyLabelUtil.addLabel(proxy, id, id + time);
+ }
+ }
+ time = System.currentTimeMillis() - time;
+ PerfTestUtils.out("1 thread took (average on " + loopsToAvg + " loops) " +
+ (time / loopsToAvg) + " ms to add " + wikittiesToCreate +
+ " labels on " + wikittiesToCreate + " wikitties\n");
- List<PerfTestLabelAddThread> threads = new ArrayList<PerfTestLabelAddThread>();
+ List<PerfTestLabelAddThread> threads = new ArrayList<PerfTestLabelAddThread>();
- time = System.currentTimeMillis();
- int threadMod = ((wikittiesToCreate % threadsNb) != 0 ? 1 : 0);
-
- for (int j = 0; j < loopsToAvg; j++) {
- for (int i = 0; i < threadsNb; i++) {
- threads.add(new PerfTestLabelAddThread(wikittiesToCreate / threadsNb, proxy, ids, i * (wikittiesToCreate / threadsNb)));
- }
- if (threadMod == 1) {
- threads.add(new PerfTestLabelAddThread(wikittiesToCreate % threadsNb, proxy, ids, threadsNb * (wikittiesToCreate / threadsNb)));
- }
- for (int i = 0; i < (threadsNb + threadMod); i++) {
- threads.get(i).start();
- }
- for (int i = 0; i < (threadsNb + threadMod); i++) {
- try {
- threads.get(i).join();
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- threads.clear();
- }
- time = System.currentTimeMillis() - time;
- PerfTestUtils.out(threadsNb + (threadMod == 1 ? "(+1)" : "") + " threads took (average on " + loopsToAvg + " loops) " + (time / loopsToAvg) +
- " ms to add " + (wikittiesToCreate / threadsNb) + " labels each " + (threadMod == 1 ? "(+" + (wikittiesToCreate % threadsNb) +
- " labels) " : "") + "on " + wikittiesToCreate + " wikitties\n");
+ time = System.currentTimeMillis();
+ int threadMod = ((wikittiesToCreate % threadsNb) != 0 ? 1 : 0);
+
+ for (int j = 0; j < loopsToAvg; j++) {
+ for (int i = 0; i < threadsNb; i++) {
+ threads.add(new PerfTestLabelAddThread(wikittiesToCreate / threadsNb, proxy, ids, i * (wikittiesToCreate / threadsNb)));
+ }
+ if (threadMod == 1) {
+ threads.add(new PerfTestLabelAddThread(wikittiesToCreate % threadsNb, proxy, ids, threadsNb * (wikittiesToCreate / threadsNb)));
+ }
+ for (int i = 0; i < (threadsNb + threadMod); i++) {
+ threads.get(i).start();
+ }
+ for (int i = 0; i < (threadsNb + threadMod); i++) {
+ try {
+ threads.get(i).join();
+ } catch (InterruptedException eee) {
+ // FIXME sletellier 21/12/10 : add some msg
+ log.error(eee);
+ }
+ }
+ threads.clear();
+ }
+ time = System.currentTimeMillis() - time;
+ PerfTestUtils.out(threadsNb + (threadMod == 1 ? "(+1)" : "") + " threads took (average on " + loopsToAvg + " loops) " + (time / loopsToAvg) +
+ " ms to add " + (wikittiesToCreate / threadsNb) + " labels each " + (threadMod == 1 ? "(+" + (wikittiesToCreate % threadsNb) +
+ " labels) " : "") + "on " + wikittiesToCreate + " wikitties\n");
}
}
Modified: trunk/wikitty-perf-test/src/main/java/org/nuiton/wikitty/perftest/PerfTestLabelSearch.java
===================================================================
--- trunk/wikitty-perf-test/src/main/java/org/nuiton/wikitty/perftest/PerfTestLabelSearch.java 2010-12-21 15:32:36 UTC (rev 639)
+++ trunk/wikitty-perf-test/src/main/java/org/nuiton/wikitty/perftest/PerfTestLabelSearch.java 2010-12-21 15:33:48 UTC (rev 640)
@@ -1,45 +1,75 @@
+/*
+ * #%L
+ * Wikitty :: wikitty-perf-test
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 CodeLutin, Benjamin Poussin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.perftest;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.wikitty.WikittyProxy;
+import org.nuiton.wikitty.addons.WikittyLabelUtil;
+
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import org.nuiton.wikitty.WikittyProxy;
-import org.nuiton.wikitty.addons.WikittyLabelUtil;
+public class PerfTestLabelSearch {
-public class PerfTestLabelSearch {
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(PerfTestLabelSearch.class);
+
private static class PerfTestLabelSearchThread extends Thread {
- private int labelsToSearch;
- private WikittyProxy proxy;
- private List<String> ids;
- private int startAt;
+ private int labelsToSearch;
+ private WikittyProxy proxy;
+ private List<String> ids;
+ private int startAt;
- /**
- *
- * @param labelsToSearch
- * @param proxy
- * @param ids
- * @param startAt
- */
- PerfTestLabelSearchThread(int labelsToSearch, WikittyProxy proxy, List<String> ids, int startAt) {
- this.labelsToSearch = labelsToSearch;
- this.proxy = proxy;
- this.ids = ids;
- this.startAt = startAt;
- }
+ /**
+ *
+ * @param labelsToSearch
+ * @param proxy
+ * @param ids
+ * @param startAt
+ */
+ PerfTestLabelSearchThread(int labelsToSearch, WikittyProxy proxy, List<String> ids, int startAt) {
+ this.labelsToSearch = labelsToSearch;
+ this.proxy = proxy;
+ this.ids = ids;
+ this.startAt = startAt;
+ }
- @Override
- public void run() {
- Set<String> labels = new HashSet<String>();
+ @Override
+ public void run() {
+ Set<String> labels = new HashSet<String>();
- for (int i = startAt; i < (labelsToSearch + startAt); i++) {
- labels.addAll(WikittyLabelUtil.findAllAppliedLabels(proxy, ids.get(i)));
- }
- for (String label : labels) {
- WikittyLabelUtil.findAllByLabel(proxy, label, startAt, labelsToSearch + startAt);
- }
- }
+ for (int i = startAt; i < (labelsToSearch + startAt); i++) {
+ labels.addAll(WikittyLabelUtil.findAllAppliedLabels(proxy, ids.get(i)));
+ }
+ for (String label : labels) {
+ WikittyLabelUtil.findAllByLabel(proxy, label, startAt, labelsToSearch + startAt);
+ }
+ }
}
/**
@@ -51,51 +81,52 @@
* @param threadsNb : the number of threads that will be created to do a part of the search
*/
public static void searchLabel(WikittyProxy proxy, List<String> ids, int loopsToAvg, int threadsNb) {
- long time = System.currentTimeMillis();
- int wikittiesCreated = ids.size();
- Set<String> labels = new HashSet<String>();
+ long time = System.currentTimeMillis();
+ int wikittiesCreated = ids.size();
+ Set<String> labels = new HashSet<String>();
- for (int k = 0; k < loopsToAvg; k++) {
- for (String id : ids) {
- labels.addAll(WikittyLabelUtil.findAllAppliedLabels(proxy, id));
- }
- int size = labels.size();
+ for (int k = 0; k < loopsToAvg; k++) {
+ for (String id : ids) {
+ labels.addAll(WikittyLabelUtil.findAllAppliedLabels(proxy, id));
+ }
+ int size = labels.size();
- for (String label : labels) {
- WikittyLabelUtil.findAllByLabel(proxy, label, 0, size);
- }
- }
- time = System.currentTimeMillis() - time;
- PerfTestUtils.out("1 thread took (average on " + loopsToAvg + " loops) " + (time / loopsToAvg) + " ms to find " + labels.size() +
- " labels on " + wikittiesCreated + " wikitties\n");
+ for (String label : labels) {
+ WikittyLabelUtil.findAllByLabel(proxy, label, 0, size);
+ }
+ }
+ time = System.currentTimeMillis() - time;
+ PerfTestUtils.out("1 thread took (average on " + loopsToAvg + " loops) " +
+ (time / loopsToAvg) + " ms to find " + labels.size() +
+ " labels on " + wikittiesCreated + " wikitties\n");
- List<PerfTestLabelSearchThread> threads = new ArrayList<PerfTestLabelSearchThread>();
+ List<PerfTestLabelSearchThread> threads = new ArrayList<PerfTestLabelSearchThread>();
- time = System.currentTimeMillis();
- int threadMod = ((labels.size() % threadsNb) != 0 ? 1 : 0);
-
- for (int j = 0; j < loopsToAvg; j++) {
- for (int i = 0; i < threadsNb; i++) {
- threads.add(new PerfTestLabelSearchThread(wikittiesCreated / threadsNb, proxy, ids, i * (wikittiesCreated / threadsNb)));
- }
- if (threadMod == 1) {
- threads.add(new PerfTestLabelSearchThread(wikittiesCreated % threadsNb, proxy, ids, threadsNb * (wikittiesCreated / threadsNb)));
- }
- for (int i = 0; i < (threadsNb + threadMod); i++) {
- threads.get(i).start();
- }
- for (int i = 0; i < (threadsNb + threadMod); i++) {
- try {
- threads.get(i).join();
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- threads.clear();
- }
- time = System.currentTimeMillis() - time;
- PerfTestUtils.out(threadsNb + (threadMod == 1 ? "(+1)" : "") + " threads took (average on " + loopsToAvg + " loops) " +
- (time / loopsToAvg) + " ms to find " + (labels.size() / threadsNb) + " labels each " +
- (threadMod == 1 ? "(+" + (labels.size() % threadsNb) + " labels)" : "") + " on " + wikittiesCreated + " wikitties\n");
+ time = System.currentTimeMillis();
+ int threadMod = ((labels.size() % threadsNb) != 0 ? 1 : 0);
+
+ for (int j = 0; j < loopsToAvg; j++) {
+ for (int i = 0; i < threadsNb; i++) {
+ threads.add(new PerfTestLabelSearchThread(wikittiesCreated / threadsNb, proxy, ids, i * (wikittiesCreated / threadsNb)));
+ }
+ if (threadMod == 1) {
+ threads.add(new PerfTestLabelSearchThread(wikittiesCreated % threadsNb, proxy, ids, threadsNb * (wikittiesCreated / threadsNb)));
+ }
+ for (int i = 0; i < (threadsNb + threadMod); i++) {
+ threads.get(i).start();
+ }
+ for (int i = 0; i < (threadsNb + threadMod); i++) {
+ try {
+ threads.get(i).join();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ threads.clear();
+ }
+ time = System.currentTimeMillis() - time;
+ PerfTestUtils.out(threadsNb + (threadMod == 1 ? "(+1)" : "") + " threads took (average on " + loopsToAvg + " loops) " +
+ (time / loopsToAvg) + " ms to find " + (labels.size() / threadsNb) + " labels each " +
+ (threadMod == 1 ? "(+" + (labels.size() % threadsNb) + " labels)" : "") + " on " + wikittiesCreated + " wikitties\n");
}
}
Modified: trunk/wikitty-perf-test/src/main/java/org/nuiton/wikitty/perftest/PerfTestSearch.java
===================================================================
--- trunk/wikitty-perf-test/src/main/java/org/nuiton/wikitty/perftest/PerfTestSearch.java 2010-12-21 15:32:36 UTC (rev 639)
+++ trunk/wikitty-perf-test/src/main/java/org/nuiton/wikitty/perftest/PerfTestSearch.java 2010-12-21 15:33:48 UTC (rev 640)
@@ -1,8 +1,31 @@
+/*
+ * #%L
+ * Wikitty :: wikitty-perf-test
+ * *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 CodeLutin, Benjamin Poussin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.perftest;
-import java.util.ArrayList;
-import java.util.List;
-
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.nuiton.wikitty.WikittyService;
import org.nuiton.wikitty.entities.Wikitty;
import org.nuiton.wikitty.entities.WikittyExtension;
@@ -11,28 +34,36 @@
import org.nuiton.wikitty.search.Search;
import org.nuiton.wikitty.services.WikittyServiceEnhanced;
+import java.util.ArrayList;
+import java.util.List;
+
public class PerfTestSearch {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(PerfTestSearch.class);
+
private static class PerfTestSearchThread extends Thread {
- private int researches;
- private WikittyService ws;
- private WikittyExtension ext;
- private boolean withRestore;
- private String searchIn;
- private String searched;
- PerfTestSearchThread(int researches, WikittyService ws, WikittyExtension ext, boolean withRestore, String searchIn, String searched) {
- this.researches = researches;
- this.ws = ws;
- this.ext = ext;
- this.withRestore = withRestore;
- this.searchIn = searchIn;
- this.searched = searched;
- }
+ private int researches;
+ private WikittyService ws;
+ private WikittyExtension ext;
+ private boolean withRestore;
+ private String searchIn;
+ private String searched;
- @Override
- public void run() {
- searchGt(researches, ws, ext, searchIn, searched, withRestore);
- }
+ PerfTestSearchThread(int researches, WikittyService ws, WikittyExtension ext, boolean withRestore, String searchIn, String searched) {
+ this.researches = researches;
+ this.ws = ws;
+ this.ext = ext;
+ this.withRestore = withRestore;
+ this.searchIn = searchIn;
+ this.searched = searched;
+ }
+
+ @Override
+ public void run() {
+ searchGt(researches, ws, ext, searchIn, searched, withRestore);
+ }
}
/**
@@ -46,17 +77,17 @@
* @param withRestore : if the wikitty will be restored after the search
*/
private static void searchGt(int researches, WikittyService ws, WikittyExtension ext, String searchIn, String searched, boolean withRestore) {
- for (int i = 0; i < researches; i++) {
- Criteria criteria = Search.query().gt(ext.getName() + "." + searchIn, searched).criteria();
- PagedResult<String> result = ws.findAllByCriteria(null, criteria);
- List<String> found = result.getAll();
- for (int j = 0; j < found.size(); j++) {
- if (withRestore) {
- Wikitty wikittyFound = WikittyServiceEnhanced.restore(ws, null, found.get(j));
- wikittyFound.getFieldAsString(ext.getName(), searchIn);
- }
- }
- }
+ for (int i = 0; i < researches; i++) {
+ Criteria criteria = Search.query().gt(ext.getName() + "." + searchIn, searched).criteria();
+ PagedResult<String> result = ws.findAllByCriteria(null, criteria);
+ List<String> found = result.getAll();
+ for (String aFound : found) {
+ if (withRestore) {
+ Wikitty wikittyFound = WikittyServiceEnhanced.restore(ws, null, aFound);
+ wikittyFound.getFieldAsString(ext.getName(), searchIn);
+ }
+ }
+ }
}
/**
@@ -73,18 +104,20 @@
*/
public static void oneThreadSearch(WikittyService ws, WikittyExtension ext, int loopsToAvg, int researches,
int wikittiesCreated, String searchIn, String searched, boolean withRestore) {
- long time = System.currentTimeMillis();
- for (int i = 0; i < loopsToAvg; i++) {
- searchGt(researches, ws, ext, searchIn, searched, withRestore);
- }
- time = System.currentTimeMillis() - time;
- if (withRestore)
- PerfTestUtils.out("With WikittyServiceEnhanced.restore : ");
- else
- PerfTestUtils.out("Without WikittyServiceEnhanced.restore : ");
- PerfTestUtils.out("1 thread took (average on " + loopsToAvg + " loops) " + (time / loopsToAvg) + " ms to do " + researches +
- " researches on field " + searchIn + " in " + wikittiesCreated + " wikitties\n");
+ long time = System.currentTimeMillis();
+
+ for (int i = 0; i < loopsToAvg; i++) {
+ searchGt(researches, ws, ext, searchIn, searched, withRestore);
+ }
+ time = System.currentTimeMillis() - time;
+ if (withRestore) {
+ PerfTestUtils.out("With WikittyServiceEnhanced.restore : ");
+ } else {
+ PerfTestUtils.out("Without WikittyServiceEnhanced.restore : ");
+ }
+ PerfTestUtils.out("1 thread took (average on " + loopsToAvg + " loops) " + (time / loopsToAvg) + " ms to do " + researches +
+ " researches on field " + searchIn + " in " + wikittiesCreated + " wikitties\n");
}
/**
@@ -102,37 +135,39 @@
*/
public static void nThreadsSearch(WikittyService ws, WikittyExtension ext, int loopsToAvg, int researches,
int wikittiesCreated, int threadsNb, String searchIn, String searched, boolean withRestore) {
- List<PerfTestSearchThread> threads = new ArrayList<PerfTestSearchThread>();
- long time = System.currentTimeMillis();
- int threadMod = ((researches % threadsNb) != 0 ? 1 : 0);
-
- for (int j = 0; j < loopsToAvg; j++) {
- for (int i = 0; i < threadsNb; i++) {
- threads.add(new PerfTestSearchThread(researches / threadsNb, ws, ext, withRestore, searchIn, searched));
- }
- if (threadMod == 1) {
- threads.add(new PerfTestSearchThread(researches % threadsNb, ws, ext, withRestore, searchIn, searched));
- }
- for (int i = 0; i < (threadsNb + threadMod); i++) {
- threads.get(i).start();
- }
- for (int i = 0; i < (threadsNb + threadMod); i++) {
- try {
- threads.get(i).join();
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- threads.clear();
- }
- time = System.currentTimeMillis() - time;
- if (withRestore)
- PerfTestUtils.out("With WikittyServiceEnhanced.restore : ");
- else
- PerfTestUtils.out("Without WikittyServiceEnhanced.restore : ");
- PerfTestUtils.out(threadsNb + (threadMod == 1 ? "(+1)" : "") + " threads took (average on " + loopsToAvg + " loops) " + (time / loopsToAvg) +
- " ms to do " + (researches / threadsNb) + " researches each " + (threadMod == 1 ? "(+" + (researches % threadsNb) + " researches) " : "") +
- "on field " + searchIn + " in " + wikittiesCreated + " wikitties\n");
+
+ List<PerfTestSearchThread> threads = new ArrayList<PerfTestSearchThread>();
+ long time = System.currentTimeMillis();
+ int threadMod = ((researches % threadsNb) != 0 ? 1 : 0);
+
+ for (int j = 0; j < loopsToAvg; j++) {
+ for (int i = 0; i < threadsNb; i++) {
+ threads.add(new PerfTestSearchThread(researches / threadsNb, ws, ext, withRestore, searchIn, searched));
+ }
+ if (threadMod == 1) {
+ threads.add(new PerfTestSearchThread(researches % threadsNb, ws, ext, withRestore, searchIn, searched));
+ }
+ for (int i = 0; i < (threadsNb + threadMod); i++) {
+ threads.get(i).start();
+ }
+ for (int i = 0; i < (threadsNb + threadMod); i++) {
+ try {
+ threads.get(i).join();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ threads.clear();
+ }
+ time = System.currentTimeMillis() - time;
+ if (withRestore) {
+ PerfTestUtils.out("With WikittyServiceEnhanced.restore : ");
+ } else {
+ PerfTestUtils.out("Without WikittyServiceEnhanced.restore : ");
+ }
+ PerfTestUtils.out(threadsNb + (threadMod == 1 ? "(+1)" : "") + " threads took (average on " + loopsToAvg + " loops) " + (time / loopsToAvg) +
+ " ms to do " + (researches / threadsNb) + " researches each " + (threadMod == 1 ? "(+" + (researches % threadsNb) + " researches) " : "") +
+ "on field " + searchIn + " in " + wikittiesCreated + " wikitties\n");
}
/**
@@ -150,7 +185,8 @@
*/
public static void search(WikittyService ws, WikittyExtension ext, int loopsToAvg, int researches,
int wikittiesCreated, int threadsNb, String searchIn, String searched, boolean withRestore) {
- oneThreadSearch(ws, ext, loopsToAvg, researches, wikittiesCreated, searchIn, searched, withRestore);
- nThreadsSearch(ws, ext, loopsToAvg, researches, wikittiesCreated, threadsNb, searchIn, searched, withRestore);
+
+ oneThreadSearch(ws, ext, loopsToAvg, researches, wikittiesCreated, searchIn, searched, withRestore);
+ nThreadsSearch(ws, ext, loopsToAvg, researches, wikittiesCreated, threadsNb, searchIn, searched, withRestore);
}
}
Modified: trunk/wikitty-perf-test/src/main/java/org/nuiton/wikitty/perftest/PerfTestUtils.java
===================================================================
--- trunk/wikitty-perf-test/src/main/java/org/nuiton/wikitty/perftest/PerfTestUtils.java 2010-12-21 15:32:36 UTC (rev 639)
+++ trunk/wikitty-perf-test/src/main/java/org/nuiton/wikitty/perftest/PerfTestUtils.java 2010-12-21 15:33:48 UTC (rev 640)
@@ -1,7 +1,41 @@
+/*
+ * #%L
+ * Wikitty :: wikitty-perf-test
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.wikitty.perftest;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
public class PerfTestUtils {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(PerfTestUtils.class);
+
+ // FIXME sletellier 21/12/10 : with not using directly log.info ?
public static void out(Object msg) {
- System.out.println(msg);
+ if (log.isInfoEnabled()) {
+ log.info(msg);
+ }
}
}
Added: trunk/wikitty-perf-test/src/main/resources/log4j.properties
===================================================================
--- trunk/wikitty-perf-test/src/main/resources/log4j.properties (rev 0)
+++ trunk/wikitty-perf-test/src/main/resources/log4j.properties 2010-12-21 15:33:48 UTC (rev 640)
@@ -0,0 +1,40 @@
+###
+# #%L
+# Wikitty :: wikitty-jdbc-impl
+#
+# $Id$
+# $HeadURL$
+# %%
+# Copyright (C) 2010 CodeLutin, Benjamin Poussin
+# %%
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Lesser Public License for more details.
+#
+# You should have received a copy of the GNU General Lesser Public
+# License along with this program. If not, see
+# <http://www.gnu.org/licenses/lgpl-3.0.html>.
+# #L%
+###
+# Global logging configuration
+log4j.rootLogger=ERROR, stdout, file
+
+# Console output
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
+
+log4j.appender.file=org.apache.log4j.RollingFileAppender
+log4j.appender.file.file=vradi.log
+log4j.appender.file.MaxFileSize=10MB
+log4j.appender.file.MaxBackupIndex=4
+log4j.appender.file.layout=org.apache.log4j.PatternLayout
+log4j.appender.file.layout.ConversionPattern=%d{ISO8601} %5p [%t] %c - %m%n
+
+log4j.logger.org.nuiton.wikitty.perftest=INFO
1
0
r639 - trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services
by sletellier@users.nuiton.org 21 Dec '10
by sletellier@users.nuiton.org 21 Dec '10
21 Dec '10
Author: sletellier
Date: 2010-12-21 16:32:36 +0100 (Tue, 21 Dec 2010)
New Revision: 639
Url: http://nuiton.org/repositories/revision/wikitty/639
Log:
Optimize restore method
Modified:
trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceCached.java
Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceCached.java
===================================================================
--- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceCached.java 2010-12-21 14:04:26 UTC (rev 638)
+++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceCached.java 2010-12-21 15:32:36 UTC (rev 639)
@@ -284,7 +284,7 @@
protected Wikitty cacheGetWikitty(String id) {
Wikitty result = cache.getWikitty(id);
- // all time wrap, inly WikittyImpl are in cache
+ // all time wrap, only WikittyImpl are in cache
result = wrapWikitty(result);
return result;
}
@@ -393,28 +393,34 @@
}
// retrieve missing object
- List<Wikitty> missingInCache = ws.restore(securityToken, notInCache);
+ if (!notInCache.isEmpty()) {
+ List<Wikitty> missingInCache = ws.restore(securityToken, notInCache);
- cachePutWikitty(missingInCache);
+ cachePutWikitty(missingInCache);
- for (Wikitty w : missingInCache) {
- // add missing object
- if (w != null) {
- fromCache.put(w.getId(), w);
+ for (Wikitty w : missingInCache) {
+ // add missing object
+ if (w != null) {
+
+ // Always wrap wikitties
+ w = wrapWikitty(w);
+ fromCache.put(w.getId(), w);
+ }
}
}
- Collection<Wikitty> tmp = fromCache.values();
-
- // wrap the resulting wikitties to prevent cache conflicts
- ArrayList<Wikitty> result = new ArrayList<Wikitty>();
- for (Wikitty w : tmp) {
- result.add(wrapWikitty(w));
- }
+ // FIXME sletellier 21/12/10 : Its already done in #cacheGetWikitty, so, remove it ?
+// Collection<Wikitty> tmp = fromCache.values();
+//
+// // wrap the resulting wikitties to prevent cache conflicts
+// ArrayList<Wikitty> result = new ArrayList<Wikitty>();
+// for (Wikitty w : tmp) {
+// result.add(wrapWikitty(w));
+// }
statAdd(ids.size(), notInCache.size());
- return result;
+ return new ArrayList<Wikitty>(fromCache.values());
}
/**
1
0
21 Dec '10
Author: jcouteau
Date: 2010-12-21 15:04:26 +0100 (Tue, 21 Dec 2010)
New Revision: 638
Url: http://nuiton.org/repositories/revision/wikitty/638
Log:
Use Static method instead of instance one
Modified:
trunk/wikitty-api/src/main/java/org/nuiton/wikitty/WikittyProxy.java
Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/WikittyProxy.java
===================================================================
--- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/WikittyProxy.java 2010-12-21 13:06:19 UTC (rev 637)
+++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/WikittyProxy.java 2010-12-21 14:04:26 UTC (rev 638)
@@ -35,7 +35,6 @@
import org.nuiton.wikitty.services.WikittyEvent;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -44,7 +43,6 @@
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
-import org.apache.commons.lang.time.DurationFormatUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.util.ApplicationConfig;
@@ -58,7 +56,7 @@
* Wikitty proxy is used to transform wikitty object used by {@link WikittyService}
* into business objects used by applications.
*
- * It also manage {@link #securityToken} for {@link WikittyServiceSecurity}.
+ * It also manage {@link #securityToken} for {@link org.nuiton.wikitty.services.WikittyServiceSecurity}.
*
* @author poussin
* @version $Revision$
@@ -79,7 +77,7 @@
/**
* Security token.
*
- * @see WikittyServiceSecurity#login(String, String)
+ * @see org.nuiton.wikitty.services.WikittyServiceSecurity#login(String, String)
*/
protected String securityToken;
@@ -124,7 +122,7 @@
}
public String login(String login, String password) {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
String result = wikittyService.login(login, password);
setSecurityToken(result);
@@ -133,7 +131,7 @@
}
public void logout() {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
wikittyService.logout(securityToken);
timeTrace.add(start, "logout");
@@ -164,7 +162,7 @@
* @return new instance of object wanted
*/
public <E extends BusinessEntity> E cast(BusinessEntity source, Class<E> target) {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
E result = WikittyUtil.newInstance(
securityToken, wikittyService, target, ((BusinessEntityImpl)source).getWikitty());
@@ -179,7 +177,7 @@
}
public Wikitty store(Wikitty w) {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
WikittyEvent resp = wikittyService.store(securityToken, w);
// update object
resp.update(w);
@@ -197,7 +195,7 @@
* @return updated objects list
*/
public <E extends BusinessEntity> List<E> store(List<E> objets) {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
// prepare data to send to service
List<Wikitty> wikitties = new ArrayList<Wikitty>(objets.size());
for (E e : objets) {
@@ -218,7 +216,7 @@
}
public List<Wikitty> storeWikitty(List<Wikitty> wikitties) {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
// call the service with Wikitty
WikittyEvent resp = wikittyService.store(securityToken, wikitties);
@@ -244,7 +242,7 @@
*/
public <E extends BusinessEntity> E restore(Class<E> clazz, String id, boolean checkExtension) {
try {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
E result = null;
if (id != null) {
HashSet<String> extNames = null;
@@ -291,7 +289,7 @@
* @return wikitty entity with specified id or {@code null} if entity can't be found
*/
public Wikitty restore(String id) {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
Wikitty result = null;
if (id != null) {
result = wikittyService.restore(securityToken, id);
@@ -321,7 +319,7 @@
* @return wikitty entity with specified id or {@code null} if entity can't be found
*/
public List<Wikitty> restore(List<String> id) {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
List<Wikitty> result = wikittyService.restore(securityToken, id);
@@ -340,7 +338,7 @@
*/
public <E extends BusinessEntity> List<E> restore(
Class<E> clazz, List<String> id, boolean checkExtension) {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
List<Wikitty> wikitties = wikittyService.restore(securityToken, id);
List<E> result = new ArrayList<E>();
@@ -384,14 +382,14 @@
}
public void delete(String id) {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
wikittyService.delete(securityToken, id);
timeTrace.add(start, "delete");
}
public void delete(Collection<String> ids) {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
wikittyService.delete(securityToken, ids);
timeTrace.add(start, "delete<list>");
@@ -408,7 +406,7 @@
*/
public <E extends BusinessEntityImpl> PagedResult<E> findAllByExample(E e,
int firstIndex, int endIndex, String ... fieldFacet ) {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
Criteria criteria = Search.query(e.getWikitty()).criteria()
.setFirstIndex(firstIndex).setEndIndex(endIndex)
@@ -432,7 +430,7 @@
* @return
*/
public <E extends BusinessEntityImpl> E findByExample(E e) {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
Criteria criteria = Search.query(e.getWikitty()).criteria();
Wikitty w = wikittyService.findByCriteria(securityToken, criteria);
@@ -458,7 +456,7 @@
*/
public <E extends BusinessEntity> PagedResult<E> findAllByCriteria(
Class<E> clazz, Criteria criteria) {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
// newInstance only return BusinessEntityWikittyImpl
BusinessEntityImpl sample =
@@ -519,7 +517,7 @@
}
public PagedResult<Wikitty> findAllByCriteria(Criteria criteria) {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
PagedResult<String> resultId = wikittyService.findAllByCriteria(securityToken, criteria);
PagedResult<Wikitty> result = resultId.cast(securityToken, wikittyService);
@@ -528,7 +526,7 @@
}
public PagedResult<String> findAllIdByCriteria(Criteria criteria) {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
PagedResult<String> result = wikittyService.findAllByCriteria(securityToken, criteria);
timeTrace.add(start, "findAllByCriteria");
@@ -536,7 +534,7 @@
}
public <E extends BusinessEntity> E findByCriteria(Class<E> clazz, Criteria criteria) {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
BusinessEntityImpl sample =
(BusinessEntityImpl)WikittyUtil.newInstance(clazz);
@@ -556,7 +554,7 @@
}
public Wikitty findByCriteria(Criteria criteria) {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
Wikitty wikitty = wikittyService.findByCriteria(securityToken, criteria);
timeTrace.add(start, "findByCriteria");
@@ -564,7 +562,7 @@
}
public WikittyTree restoreTree(String wikittyId) {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
WikittyTree result = wikittyService.restoreTree(securityToken, wikittyId);
timeTrace.add(start, "restoreTree");
@@ -578,7 +576,7 @@
* @return {@true} if at least one node has been deleted
*/
public WikittyEvent deleteTree(String treeNodeId) {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
WikittyEvent result = wikittyService.deleteTree(securityToken,treeNodeId);
timeTrace.add(start, "deleteTree");
@@ -593,7 +591,7 @@
public <E extends BusinessEntity> Map.Entry<E, Integer> restoreNode(
Class<E> clazz, String wikittyId, Criteria filter, boolean checkExtension) {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
Map.Entry<E, Integer> result = null;
Map.Entry<WikittyTreeNode, Integer> node = wikittyService.restoreNode(
@@ -617,7 +615,7 @@
public <E extends BusinessEntity> Map<E, Integer> restoreChildren(
Class<E> clazz, String wikittyId, Criteria filter, boolean checkExtension) {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
Map<E, Integer> convertedResult = null;
@@ -634,7 +632,7 @@
//TODO EC-20100420 was : String nodeId = node.getId();
String nodeId = node.getWikittyId();
- E businessEntity = null;
+ E businessEntity;
HashSet<String> extNames = null;
try {
Wikitty wikitty = wikittyService.restore(securityToken, nodeId);
@@ -681,7 +679,7 @@
}
public Wikitty restoreVersion(String wikittyId, String version) {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
Wikitty result = wikittyService.restoreVersion(
securityToken, wikittyId, version);
@@ -691,12 +689,12 @@
public <E extends BusinessEntity> boolean hasType(Class<E> clazz, String wikittyId) {
try {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
boolean result = true;
- E businessObject = null;
- HashSet<String> extNames = null;
+ E businessObject;
+ HashSet<String> extNames;
Wikitty wikitty = wikittyService.restore(securityToken, wikittyId);
if (wikitty == null) {
result = false;
@@ -734,7 +732,7 @@
* @return update response
*/
public WikittyEvent storeExtension(WikittyExtension ext) {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
WikittyEvent response =
wikittyService.storeExtension(securityToken, ext);
@@ -749,7 +747,7 @@
* @return update response
*/
public WikittyEvent storeExtension(Collection<WikittyExtension> exts) {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
WikittyEvent response =
wikittyService.storeExtension(securityToken, exts);
@@ -764,7 +762,7 @@
* @return the corresponding object, exception if no such object found.
*/
public WikittyExtension restoreExtension(String extensionId) {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
WikittyExtension extension = wikittyService.restoreExtension(securityToken, extensionId);
timeTrace.add(start, "restoreExtension");
@@ -778,7 +776,7 @@
* @return the corresponding object, exception if no such object found.
*/
public WikittyExtension restoreExtensionLastVersion(String extensionName) {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
WikittyExtension extension = wikittyService.restoreExtensionLastVersion(securityToken, extensionName);
timeTrace.add(start, "restoreExtensionLastVersion");
@@ -786,14 +784,14 @@
}
public void deleteExtension(String extName) {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
wikittyService.deleteExtension(securityToken, extName);
timeTrace.add(start, "deleteExtension");
}
public void deleteExtension(Collection<String> extNames) {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
wikittyService.deleteExtension(securityToken, extNames);
timeTrace.add(start, "deleteExtension<list>");
@@ -805,7 +803,7 @@
* @return extension id list
*/
public List<String> getAllExtensionIds() {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
List<String> result = wikittyService.getAllExtensionIds(securityToken);
timeTrace.add(start, "getAllExtensionIds");
@@ -820,7 +818,7 @@
* @return extensions
*/
public List<String> getAllExtensionsRequires(String extensionName) {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
List<String> result = wikittyService.getAllExtensionsRequires(securityToken, extensionName);
timeTrace.add(start, "getAllExtensionsRequires");
@@ -832,7 +830,7 @@
* This operation should be disabled in production environment.
*/
public WikittyEvent clear() {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
WikittyEvent result = wikittyService.clear(securityToken);
timeTrace.add(start, "clear");
@@ -842,11 +840,9 @@
/**
* Synchronize search engine with wikitty storage engine, i.e. clear and
* reindex all wikitties.
- *
- * @return update response
*/
public void syncSearchEngine() {
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
wikittyService.syncSearchEngine(securityToken);
timeTrace.add(start, "syncSearchEngine");
@@ -858,7 +854,7 @@
* @return the wikitty encapsulated
*/
public Wikitty getWikitty(BusinessEntity entity){
- long start = timeTrace.getTime();
+ long start = TimeTrace.getTime();
Wikitty result = WikittyUtil.getWikitty(wikittyService, securityToken, entity);
timeTrace.add(start, "getWikitty");
1
0
Author: jcouteau
Date: 2010-12-21 14:06:19 +0100 (Tue, 21 Dec 2010)
New Revision: 637
Url: http://nuiton.org/repositories/revision/wikitty/637
Log:
Use org.apache.jcs:jcs instead of jcs:jcs (less useless dependencies)
Modified:
trunk/pom.xml
trunk/wikitty-api/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-12-20 18:21:26 UTC (rev 636)
+++ trunk/pom.xml 2010-12-21 13:06:19 UTC (rev 637)
@@ -39,44 +39,9 @@
<dependencies>
<!-- cache implementation -->
<dependency>
- <groupId>jcs</groupId>
+ <groupId>org.apache.jcs</groupId>
<artifactId>jcs</artifactId>
<version>1.3</version>
- <exclusions>
- <exclusion>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>tomcat</groupId>
- <artifactId>tomcat-util</artifactId>
- </exclusion>
- <exclusion>
- <groupId>berkeleydb</groupId>
- <artifactId>berkeleydb</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xmlrpc</groupId>
- <artifactId>xmlrpc</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- </exclusion>
- <exclusion>
- <groupId>velocity</groupId>
- <artifactId>velocity</artifactId>
- </exclusion>
- <exclusion>
- <groupId>hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- </exclusion>
- </exclusions>
-
</dependency>
<!-- base64 encoder/decoder used for binary type -->
Modified: trunk/wikitty-api/pom.xml
===================================================================
--- trunk/wikitty-api/pom.xml 2010-12-20 18:21:26 UTC (rev 636)
+++ trunk/wikitty-api/pom.xml 2010-12-21 13:06:19 UTC (rev 637)
@@ -49,7 +49,7 @@
<!-- COMPILE -->
<!-- cache implementation -->
<dependency>
- <groupId>jcs</groupId>
+ <groupId>org.apache.jcs</groupId>
<artifactId>jcs</artifactId>
</dependency>
1
0
r636 - in trunk/wikitty-solr-impl/src: main/java/org/nuiton/wikitty/storage/solr main/resources test/java/org/nuiton/wikitty/storage/solr
by bpoussin@users.nuiton.org 20 Dec '10
by bpoussin@users.nuiton.org 20 Dec '10
20 Dec '10
Author: bpoussin
Date: 2010-12-20 19:21:26 +0100 (Mon, 20 Dec 2010)
New Revision: 636
Url: http://nuiton.org/repositories/revision/wikitty/636
Log:
- change maxBooleanClauses to Integer.MAX_VALUE
- cahnge copyField position after fields declaration (view in documentation)
- change restoreNode restoreChild to restrict filter resultat to attachment id
- add test (that faild :() on word indexation with accent :(
Modified:
trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/Restriction2Solr.java
trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/WikittySearchEngineSolrIndexInTreeNode.java
trunk/wikitty-solr-impl/src/main/resources/schema.xml
trunk/wikitty-solr-impl/src/main/resources/solrconfig.xml
trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/SolrSearchTest.java
trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/TreeTest.java
trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/WikittyServiceSolr.java
Modified: trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/Restriction2Solr.java
===================================================================
--- trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/Restriction2Solr.java 2010-12-20 18:18:00 UTC (rev 635)
+++ trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/Restriction2Solr.java 2010-12-20 18:21:26 UTC (rev 636)
@@ -172,6 +172,8 @@
}
}
+ // FIXME poussin 20101220 i think this method return bad lucene syntaxe query
+ // I think the syntaxe must be the same as contains
private String in2solr(In in) {
boolean first = true;
String result = in.getElement().getName() + ":[";
@@ -381,11 +383,11 @@
String operand = "";
StringBuffer result = new StringBuffer();
+ result.append(element2solr(contains.getElement())).append(":");
result.append("(");
for (String value : contains.getValue()) {
result.append(operand);
- result.append(element2solr(contains.getElement()))
- .append(":").append(value2solr(value));
+ result.append(value2solr(value));
operand = " OR ";
}
result.append(")");
Modified: trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/WikittySearchEngineSolrIndexInTreeNode.java
===================================================================
--- trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/WikittySearchEngineSolrIndexInTreeNode.java 2010-12-20 18:18:00 UTC (rev 635)
+++ trunk/wikitty-solr-impl/src/main/java/org/nuiton/wikitty/storage/solr/WikittySearchEngineSolrIndexInTreeNode.java 2010-12-20 18:21:26 UTC (rev 636)
@@ -65,9 +65,12 @@
import java.util.LinkedHashSet;
import java.util.LinkedList;
import org.nuiton.util.ApplicationConfig;
+import org.nuiton.util.CollectionUtil;
+import org.nuiton.util.StringUtil;
import org.nuiton.wikitty.WikittyConfig;
import org.nuiton.wikitty.WikittyUtil;
import org.nuiton.wikitty.entities.WikittyTreeNodeHelper;
+import org.nuiton.wikitty.search.Search;
/**
*
@@ -514,6 +517,10 @@
}
}
if (filter != null) {
+ Search search = Search.query(filter);
+ Search and = search.and().contains(SOLR_ID, allAttachments);
+ Criteria criteria = search.criteria();
+
PagedResult<String> criteriaResult = findAllByCriteria(transaction, filter);
allAttachments.retainAll(criteriaResult.getAll());
}
@@ -588,13 +595,38 @@
// creation des id repondants au filtre si besoin
Collection<String> filteredId = Collections.EMPTY_LIST;
if (filter != null) {
- PagedResult<String> criteriaResult = findAllByCriteria(transaction, filter);
- filteredId = criteriaResult.getAll();
+
+ // stocke toutes les ids des attachments du sous arbres
+ Collection<String> attachmentIds = new LinkedList<String>();
+ // 1ere passe, on ne garde que les fils directs.
+ // comme ca se sera deja fait pour la construction du result
+ // moins de chose a reparcourir
+ for (Iterator<Map.Entry<String, Collection>> i = allAttachments.entrySet().iterator(); i.hasNext();) {
+ Map.Entry<String, Collection> e = i.next();
+ // on ne garde que les fils directs
+ if (child.contains(e.getKey())) {
+ attachmentIds.addAll(e.getValue());
+ } else {
+ i.remove();
+ }
+ }
+
+ // ca ne sert a rien de faire la requete si au final, il n'y a
+ // aucun attachment
+ if (attachmentIds.size() > 0) {
+ Search search = Search.query(filter);
+ Search and = search.and().contains(SOLR_ID, attachmentIds);
+ Criteria criteria = search.criteria();
+
+ PagedResult<String> criteriaResult = findAllByCriteria(transaction, criteria);
+ filteredId = criteriaResult.getAll();
+ }
}
// Construction du resultat
for (Map.Entry<String, Collection> e : allAttachments.entrySet()) {
// on ne garde que les fils directs
+ // c'est peut-etre fait si filter est non null, mais pas sinon
if (child.contains(e.getKey())) {
Collection attachments = e.getValue();
// on ne garde dans le comptage des attachments que les id
Modified: trunk/wikitty-solr-impl/src/main/resources/schema.xml
===================================================================
--- trunk/wikitty-solr-impl/src/main/resources/schema.xml 2010-12-20 18:18:00 UTC (rev 635)
+++ trunk/wikitty-solr-impl/src/main/resources/schema.xml 2010-12-20 18:21:26 UTC (rev 636)
@@ -48,12 +48,16 @@
<fieldType name="date" class="solr.DateField" sortMissingLast="true" omitNorms="true"/>
<!-- STRING type: The StrField type is not analyzed, but indexed/stored verbatim. -->
- <fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
+ <fieldType name="string" class="solr.StrField"
+ compressed="true" compressThreshold="1000"
+ sortMissingLast="true" omitNorms="true"/>
<!-- STRING type copy: type to string all text is lower cased -->
- <fieldType name="string_lc" class="solr.StrField" sortMissingLast="true" omitNorms="true">
+ <fieldType name="string_lc" class="solr.StrField"
+ compressed="true" compressThreshold="1000"
+ sortMissingLast="true">
<analyzer> <!-- no type to indicated that used it for both type: index and query -->
- <tokenizer class="solr.StandardTokenizerFactory"/> <!-- ou ? WhitespaceTokenizerFactory -->
+ <tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
@@ -66,7 +70,9 @@
Duplicate tokens at the same position (which may result from Stemmed Synonyms or
WordDelim parts) are removed.
-->
- <fieldType name="text" class="solr.TextField" positionIncrementGap="100">
+ <fieldType name="text" class="solr.TextField"
+ compressed="true" compressThreshold="1000"
+ positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.StopFilterFactory"
@@ -119,21 +125,10 @@
<dynamicfield name="#tree*" type="string" indexed="true" stored="false" multiValued="true"/>
<!-- copy all field (except binary) in '#fulltext' field for fulltext search -->
- <field name="#fulltext" type="text" indexed="true" stored="false" multiValued="true"/>
- <copyField source="*_b" dest="#fulltext"/>
- <copyField source="*_d" dest="#fulltext"/>
- <copyField source="*_dt" dest="#fulltext"/>
- <copyField source="*_s" dest="#fulltext"/>
- <copyField source="*_w" dest="#fulltext"/>
-
- <!-- copy String field for to lower case version -->
- <copyField source="*_s" dest="*_s_c"/>
- <!-- copy String field for text indexed format version -->
- <copyField source="*_s" dest="*_s_t"/>
-
+ <field name="#fulltext" type="text" indexed="true" stored="true" multiValued="true"/>
<!-- copied field not stored -->
- <dynamicField name="*_s_c" type="string_lc" indexed="true" stored="false" multiValued="true"/>
- <dynamicField name="*_s_t" type="text" indexed="true" stored="false" multiValued="true"/>
+ <dynamicField name="*_s_c" type="string_lc" indexed="true" stored="true" multiValued="true"/>
+ <dynamicField name="*_s_t" type="text" indexed="true" stored="true" multiValued="true"/>
<!-- on indexe pas les binary field -->
<dynamicField name="*_bi" type="binary" indexed="false" stored="false" multiValued="true"/>
@@ -160,4 +155,17 @@
<!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
<solrQueryParser defaultOperator="AND"/>
+
+ <copyField source="*_b" dest="#fulltext"/>
+ <copyField source="*_d" dest="#fulltext"/>
+ <copyField source="*_dt" dest="#fulltext"/>
+ <copyField source="*_s" dest="#fulltext"/>
+ <copyField source="*_w" dest="#fulltext"/>
+
+ <!-- copy String field for to lower case version -->
+ <copyField source="*_s" dest="*_s_c"/>
+ <!-- copy String field for text indexed format version -->
+ <copyField source="*_s" dest="*_s_t"/>
+
+
</schema>
Modified: trunk/wikitty-solr-impl/src/main/resources/solrconfig.xml
===================================================================
--- trunk/wikitty-solr-impl/src/main/resources/solrconfig.xml 2010-12-20 18:18:00 UTC (rev 635)
+++ trunk/wikitty-solr-impl/src/main/resources/solrconfig.xml 2010-12-20 18:21:26 UTC (rev 636)
@@ -124,10 +124,10 @@
<query>
- <!-- Maximum number of clauses in a boolean query... can affect
+ <!-- Maximum number of clauses in a boolean query (default: 1024). can affect
range or prefix queries that expand to big boolean
queries. An exception is thrown if exceeded. -->
- <maxBooleanClauses>1024</maxBooleanClauses>
+ <maxBooleanClauses>2147483647</maxBooleanClauses>
<!-- Cache used by SolrIndexSearcher for filters (DocSets),
Modified: trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/SolrSearchTest.java
===================================================================
--- trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/SolrSearchTest.java 2010-12-20 18:18:00 UTC (rev 635)
+++ trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/SolrSearchTest.java 2010-12-20 18:21:26 UTC (rev 636)
@@ -30,6 +30,7 @@
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
+import junit.framework.Assert;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -45,6 +46,8 @@
import org.nuiton.wikitty.WikittyUtil;
import org.nuiton.wikitty.conform.AbstractTestConformance;
import org.nuiton.wikitty.conform.StorageTest;
+import org.nuiton.wikitty.entities.WikittyGroup;
+import org.nuiton.wikitty.entities.WikittyGroupImpl;
import org.nuiton.wikitty.search.operators.Element;
import org.nuiton.wikitty.search.operators.Like;
import org.nuiton.wikitty.search.operators.Like.SearchAs;
@@ -504,4 +507,42 @@
list = result.getAll();
assertEquals(2, list.size());
}
+
+ @Test
+ public void testAccent() throws Exception {
+ WikittyGroupImpl group = new WikittyGroupImpl();
+ group.setName("coucou");
+ WikittyGroupImpl groupAccent = new WikittyGroupImpl();
+ groupAccent.setName("çéçà");
+
+ ws.store(null, group.getWikitty());
+ ws.store(null, groupAccent.getWikitty());
+
+ {
+ // sans accent
+ Criteria criteria = Search.query().keyword("coucou").criteria();
+ PagedResult<String> result = ws.findAllByCriteria(null, criteria);
+ Assert.assertEquals(1, result.size());
+ }
+ {
+ // avec accent
+ Criteria criteria = Search.query().keyword("çéçà").criteria();
+ PagedResult<String> result = ws.findAllByCriteria(null, criteria);
+ Assert.assertEquals(1, result.size());
+ }
+ {
+ // avec accent specifiquement sur le champs name
+ Criteria criteria = Search.query().eq(
+ WikittyGroup.FQ_FIELD_WIKITTYGROUP_NAME,"çéçà").criteria();
+ PagedResult<String> result = ws.findAllByCriteria(null, criteria);
+ Assert.assertEquals(1, result.size());
+ }
+ {
+ // avec accent specifiquement sur le champs name mais sans accent pour la recherche
+ Criteria criteria = Search.query().eq(
+ WikittyGroup.FQ_FIELD_WIKITTYGROUP_NAME,"ceca").criteria();
+ PagedResult<String> result = ws.findAllByCriteria(null, criteria);
+ Assert.assertEquals(1, result.size());
+ }
+ }
}
Modified: trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/TreeTest.java
===================================================================
--- trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/TreeTest.java 2010-12-20 18:18:00 UTC (rev 635)
+++ trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/TreeTest.java 2010-12-20 18:21:26 UTC (rev 636)
@@ -30,6 +30,7 @@
import static junit.framework.Assert.assertNotNull;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
@@ -265,6 +266,11 @@
@Test
public void testFilterRestoreChildren() {
+ Map<String, Integer> result = new HashMap<String, Integer>();
+ result.put("node11", 1);
+ result.put("node13", 0);
+ result.put("node12", 0);
+
Wikitty node1 = findNode("node1");
String node1Id = node1.getId();
@@ -272,6 +278,9 @@
Map<WikittyTreeNode, Integer> children = ws.restoreChildren(null, node1Id, filter);
System.out.println(children);
assertEquals(3, children.size());
+ for (Map.Entry<WikittyTreeNode, Integer> e : children.entrySet()) {
+ assertEquals(result.get(e.getKey().getName()), e.getValue());
+ }
}
@Test
Modified: trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/WikittyServiceSolr.java
===================================================================
--- trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/WikittyServiceSolr.java 2010-12-20 18:18:00 UTC (rev 635)
+++ trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/WikittyServiceSolr.java 2010-12-20 18:21:26 UTC (rev 636)
@@ -39,7 +39,6 @@
* by : $Author$
*/
public class WikittyServiceSolr extends WikittyServiceStorage {
-
public WikittyServiceSolr(ApplicationConfig config) {
extensionStorage = new WikittyExtensionStorageInMemory();
wikittyStorage = new WikittyStorageInMemory();
1
0
r635 - trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/operators
by bpoussin@users.nuiton.org 20 Dec '10
by bpoussin@users.nuiton.org 20 Dec '10
20 Dec '10
Author: bpoussin
Date: 2010-12-20 19:18:00 +0100 (Mon, 20 Dec 2010)
New Revision: 635
Url: http://nuiton.org/repositories/revision/wikitty/635
Log:
mark as deprecated
Modified:
trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/operators/SearchOperand.java
Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/operators/SearchOperand.java
===================================================================
--- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/operators/SearchOperand.java 2010-12-20 15:57:47 UTC (rev 634)
+++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/search/operators/SearchOperand.java 2010-12-20 18:18:00 UTC (rev 635)
@@ -27,6 +27,7 @@
/**
* Represents the possible operands for client search. The supported type of
* each AttributeSearchDto depends of its type.
+ * @deprecated ne semble pas utilise, interet ???
*/
public enum SearchOperand {
EQUALS, NOT_EQUALS, LESS, LESS_OR_EQUALS, GREATER, GREATER_OR_EQUALS,
1
0