Wikitty-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- 1653 discussions
r646 - in trunk: wikitty-api/src/main/java/org/nuiton/wikitty wikitty-api/src/main/java/org/nuiton/wikitty/addons/importexport wikitty-api/src/main/java/org/nuiton/wikitty/services wikitty-api/src/test/java/org/nuiton/wikitty/layers wikitty-api/src/test/java/org/nuiton/wikitty/services 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 18:50:50 +0100 (Wed, 22 Dec 2010)
New Revision: 646
Url: http://nuiton.org/repositories/revision/wikitty/646
Log:
- Evolution #1156: Change WikittyService API, only restore restore Wikitty other method restore id
- WikittyProxy.login return void
Modified:
trunk/wikitty-api/src/main/java/org/nuiton/wikitty/WikittyProxy.java
trunk/wikitty-api/src/main/java/org/nuiton/wikitty/WikittyService.java
trunk/wikitty-api/src/main/java/org/nuiton/wikitty/addons/importexport/ImportExportCSV.java
trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyCacheJCS.java
trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceAccessStat.java
trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceCached.java
trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceDelegator.java
trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceNotifier.java
trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceSecurity.java
trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceStorage.java
trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceTransaction.java
trunk/wikitty-api/src/test/java/org/nuiton/wikitty/layers/WikittyServiceSecurityTest.java
trunk/wikitty-api/src/test/java/org/nuiton/wikitty/services/WikittyServiceHelperTest.java
trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/AbstractTestSolr.java
trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/TreeTest.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-22 15:04:09 UTC (rev 645)
+++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/WikittyProxy.java 2010-12-22 17:50:50 UTC (rev 646)
@@ -126,13 +126,12 @@
return timeTrace.getCallCount();
}
- public String login(String login, String password) {
+ public void login(String login, String password) {
long start = TimeTrace.getTime();
String result = wikittyService.login(login, password);
setSecurityToken(result);
timeTrace.add(start, "login");
- return result;
}
public void logout() {
@@ -438,9 +437,10 @@
long start = TimeTrace.getTime();
Criteria criteria = Search.query(e.getWikitty()).criteria();
- Wikitty w = wikittyService.findByCriteria(securityToken, criteria);
+ String id = wikittyService.findByCriteria(securityToken, criteria);
E result = null;
- if (w != null) {
+ if (id != null) {
+ Wikitty w = wikittyService.restore(securityToken, id);
result = (E) WikittyUtil.newInstance(
securityToken, wikittyService, e.getClass(), w);
}
@@ -550,7 +550,8 @@
criteria = search.criteria(criteria.getName());
- Wikitty w = wikittyService.findByCriteria(securityToken, criteria);
+ String id = wikittyService.findByCriteria(securityToken, criteria);
+ Wikitty w = wikittyService.restore(securityToken, id);
E result = WikittyUtil.newInstance(
securityToken, wikittyService, clazz, w);
@@ -560,8 +561,8 @@
public Wikitty findByCriteria(Criteria criteria) {
long start = TimeTrace.getTime();
- Wikitty wikitty = wikittyService.findByCriteria(securityToken, criteria);
-
+ String id = wikittyService.findByCriteria(securityToken, criteria);
+ Wikitty wikitty = wikittyService.restore(securityToken, id);
timeTrace.add(start, "findByCriteria");
return wikitty;
}
@@ -599,7 +600,7 @@
long start = TimeTrace.getTime();
Map.Entry<E, Integer> result = null;
- Map.Entry<WikittyTreeNode, Integer> node = wikittyService.restoreNode(
+ Map.Entry<String, Integer> node = wikittyService.restoreNode(
securityToken, wikittyId, filter);
if (node != null) {
E bean = restore(clazz, wikittyId, checkExtension);
@@ -624,58 +625,17 @@
Map<E, Integer> convertedResult = null;
- Map<WikittyTreeNode, Integer> result = wikittyService.restoreChildren(
+ Map<String, Integer> result = wikittyService.restoreChildren(
securityToken, wikittyId, filter);
if(result != null) {
- convertedResult = new LinkedHashMap<E, Integer>();
- Set<Entry<WikittyTreeNode, Integer>> entries = result.entrySet();
- for (Entry<WikittyTreeNode, Integer> entry : entries) {
+ List<String> ids = new ArrayList<String>(result.keySet());
+ List<E> keys = restore(clazz, ids, checkExtension);
- WikittyTreeNode node = entry.getKey();
-
- //TODO EC-20100420 was : String nodeId = node.getId();
- String nodeId = node.getWikittyId();
-
- E businessEntity;
- HashSet<String> extNames = null;
- try {
- Wikitty wikitty = wikittyService.restore(securityToken, nodeId);
- if (checkExtension) {
- extNames = new HashSet<String>(wikitty.getExtensionNames());
- }
- businessEntity = WikittyUtil.newInstance(
- securityToken, wikittyService, clazz, wikitty);
- } catch (SecurityException eee) {
- throw eee;
- } catch (Exception eee) {
- throw new WikittyException("Can't restore children", eee);
- }
-
- boolean goodType = true;
- if (checkExtension) {
- // WikittyUtil.newInstance instanciate only BusinessEntityWikittyImpl
- BusinessEntityImpl businessEntityImpl =
- (BusinessEntityImpl) businessEntity;
- Collection<WikittyExtension> staticExtensions =
- businessEntityImpl.getStaticExtensions();
-
- for (Iterator<WikittyExtension> iterator =
- staticExtensions.iterator(); iterator.hasNext() && goodType;) {
- WikittyExtension ext = iterator.next();
- if (!extNames.contains(ext.getName())) {
- // extension wanted by BusinessEntity (clazz)
- // is not in wikitty, then wikitty is not good type
- // for business
- goodType = false;
- }
- }
- }
-
- if (goodType) {
- Integer nodeCount = entry.getValue();
- convertedResult.put(businessEntity, nodeCount);
- }
+ convertedResult = new LinkedHashMap<E, Integer>();
+ for (E e : keys) {
+ Integer size = result.get(e.getWikittyId());
+ convertedResult.put(e, size);
}
}
Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/WikittyService.java
===================================================================
--- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/WikittyService.java 2010-12-22 15:04:09 UTC (rev 645)
+++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/WikittyService.java 2010-12-22 17:50:50 UTC (rev 646)
@@ -308,9 +308,9 @@
*
* @param securityToken security token
* @param criteria
- * @return wikitty object or null
+ * @return wikitty id object or null
*/
- public Wikitty findByCriteria(String securityToken, Criteria criteria);
+ public String findByCriteria(String securityToken, Criteria criteria);
/*
* Classification
@@ -348,7 +348,7 @@
* @param filter
* @return
*/
- public Map.Entry<WikittyTreeNode, Integer> restoreNode(
+ public Map.Entry<String, Integer> restoreNode(
String securityToken, String wikittyId, Criteria filter);
/**
@@ -363,7 +363,7 @@
* @param filter
* @return
*/
- public Map<WikittyTreeNode, Integer> restoreChildren(
+ public Map<String, Integer> restoreChildren(
String securityToken, String wikittyId, Criteria filter);
Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/addons/importexport/ImportExportCSV.java
===================================================================
--- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/addons/importexport/ImportExportCSV.java 2010-12-22 15:04:09 UTC (rev 645)
+++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/addons/importexport/ImportExportCSV.java 2010-12-22 17:50:50 UTC (rev 646)
@@ -53,6 +53,7 @@
import au.com.bytecode.opencsv.CSVReader;
import au.com.bytecode.opencsv.CSVWriter;
+import org.nuiton.wikitty.services.WikittyServiceEnhanced;
/**
*
@@ -265,7 +266,9 @@
fValue = m.group(6);
}
Criteria criteria = Search.query().eq(fqField, fValue).criteria();
- Wikitty wikitty = ws.findByCriteria(securityToken, criteria);
+ String id = ws.findByCriteria(securityToken, criteria);
+ Wikitty wikitty = WikittyServiceEnhanced.restore(
+ ws, securityToken, id);
if (wikitty == null) {
correctQueries = false;
}
Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyCacheJCS.java
===================================================================
--- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyCacheJCS.java 2010-12-22 15:04:09 UTC (rev 645)
+++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyCacheJCS.java 2010-12-22 17:50:50 UTC (rev 646)
@@ -80,7 +80,7 @@
try {
List<String> priorityExtensions = config.getOptionAsList(
WikittyConfig.WikittyOption.WIKITTY_CACHE_PRIORITY_EXTENSIONS.getKey()).getOption();
- this.priorityExtensions.addAll(priorityExtensions);
+ getPriorityExtensions().addAll(priorityExtensions);
CompositeCacheManager cacheMgr = CompositeCacheManager.getUnconfiguredInstance();
cacheMgr.configure(config.getFlatOptions());
@@ -96,6 +96,13 @@
}
}
+ /**
+ * Liste des extensions a conserver prioritairement
+ * @return
+ */
+ public Set<String> getPriorityExtensions() {
+ return priorityExtensions;
+ }
@Override
public boolean existsWikitty(String id) {
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-22 15:04:09 UTC (rev 645)
+++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceAccessStat.java 2010-12-22 17:50:50 UTC (rev 646)
@@ -216,14 +216,6 @@
}
@Override
- public Wikitty findByCriteria(String securityToken, Criteria criteria) {
- Wikitty result = super.findByCriteria(securityToken, criteria);
- addStat(securityToken, Collections.singleton(result));
- return result;
- }
-
-
- @Override
public List<Wikitty> restore(String securityToken, List<String> id) {
List<Wikitty> result = super.restore(securityToken, id);
addStat(securityToken, result);
@@ -231,22 +223,6 @@
}
@Override
- public Map<WikittyTreeNode, Integer> restoreChildren(String securityToken, String wikittyId, Criteria filter) {
- Map<WikittyTreeNode, Integer> result =
- super.restoreChildren(securityToken, wikittyId, filter);
- addStat(securityToken, result.keySet());
- return result;
- }
-
- @Override
- public Entry<WikittyTreeNode, Integer> restoreNode(String securityToken, String wikittyId, Criteria filter) {
- Entry<WikittyTreeNode, Integer> result =
- super.restoreNode(securityToken, wikittyId, filter);
- addStat(securityToken, Collections.singleton(result.getKey()));
- return result;
- }
-
- @Override
public WikittyTree restoreTree(String securityToken, String wikittyId) {
WikittyTree result = super.restoreTree(securityToken, wikittyId);
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-22 15:04:09 UTC (rev 645)
+++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceCached.java 2010-12-22 17:50:50 UTC (rev 646)
@@ -29,20 +29,15 @@
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.util.ApplicationConfig;
import org.nuiton.util.StringUtil;
-import org.nuiton.wikitty.search.Criteria;
-import org.nuiton.wikitty.search.PagedResult;
import org.nuiton.wikitty.entities.Wikitty;
import org.nuiton.wikitty.WikittyConfig;
import org.nuiton.wikitty.entities.WikittyCopyOnWrite;
import org.nuiton.wikitty.entities.WikittyExtension;
-import org.nuiton.wikitty.entities.WikittyTreeNode;
import org.nuiton.wikitty.WikittyService;
import org.nuiton.wikitty.WikittyTree;
import org.nuiton.wikitty.WikittyUtil;
@@ -56,7 +51,7 @@
* Last update: $Date$
* by : $Author$
*/
-public class WikittyServiceCached implements WikittyService {
+public class WikittyServiceCached extends WikittyServiceDelegator {
/** to use log facility, just put in your code: log.info(\"...\"); */
static private Log log = LogFactory.getLog(WikittyServiceCached.class);
@@ -66,9 +61,6 @@
/** pour recevoir les events du serveur et synchroniser le cache */
protected RemoteWikittyListener remoteWikittyListener;
-
- /** Delegated wikitty service implementation. */
- protected WikittyService ws;
/** cache policy (configuration)
*
@@ -94,7 +86,8 @@
* @param props properties (can be null)
*/
public WikittyServiceCached(ApplicationConfig config, WikittyService ws, WikittyCache cache) {
- this.ws = ws;
+ super(ws);
+ // this.ws = ws;
this.cache = cache;
if (cache == null) {
@@ -300,7 +293,7 @@
@Override
public WikittyEvent clear(String securityToken) {
- WikittyEvent result = ws.clear(securityToken);
+ WikittyEvent result = getDelegate().clear(securityToken);
processEvent(result);
return result;
}
@@ -311,7 +304,7 @@
*/
@Override
public WikittyEvent delete(String securityToken, Collection<String> ids) {
- WikittyEvent result = ws.delete(securityToken, ids);
+ WikittyEvent result = getDelegate().delete(securityToken, ids);
processEvent(result);
return result;
}
@@ -319,43 +312,13 @@
/**
* just wrap service method
*
- * @param criteria
* @return
*/
@Override
- public PagedResult<String> findAllByCriteria(
- String securityToken, Criteria criteria) {
- // if we want to add cache for this method, we must clear cache when
- // addLabel, store, storeExtension are called
- return ws.findAllByCriteria(securityToken, criteria);
- }
-
- /**
- * just wrap service method
- *
- * @param securityToken
- * @param criteria
- * @param transaction
- *
- * @return
- */
- @Override
- public Wikitty findByCriteria(String securityToken, Criteria criteria) {
- // if we want to add cache for this method, we must clear cache when
- // addLabel, store, storeExtension are called
- return ws.findByCriteria(securityToken, criteria);
- }
-
- /**
- * just wrap service method
- *
- * @return
- */
- @Override
public List<String> getAllExtensionIds(String securityToken) {
// NOTE poussin 20101219: si on veut utiliser le cache il faut une
// methode specifique
- return ws.getAllExtensionIds(securityToken);
+ return getDelegate().getAllExtensionIds(securityToken);
}
/**
@@ -368,7 +331,7 @@
public List<String> getAllExtensionsRequires(
String securityToken, String extensionName) {
// TODO poussin 20100412: perhaps use cache for extension ?
- return ws.getAllExtensionsRequires(securityToken, extensionName);
+ return getDelegate().getAllExtensionsRequires(securityToken, extensionName);
}
/**
@@ -385,6 +348,7 @@
LinkedHashMap<String, Wikitty> fromCache =
new LinkedHashMap<String, Wikitty>();
for (String id : ids) {
+ // w is automaticaly wrapped
Wikitty w = cacheGetWikitty(id);
fromCache.put(id, w); // put all to maintains order
if (w == null) { // if not found on cache, ask the server
@@ -394,7 +358,7 @@
// retrieve missing object
if (!notInCache.isEmpty()) {
- List<Wikitty> missingInCache = ws.restore(securityToken, notInCache);
+ List<Wikitty> missingInCache = getDelegate().restore(securityToken, notInCache);
cachePutWikitty(missingInCache);
@@ -402,22 +366,13 @@
// add missing object
if (w != null) {
- // Always wrap wikitties
+ // wrap new new retrieved wikitties
w = wrapWikitty(w);
fromCache.put(w.getId(), 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 new ArrayList<Wikitty>(fromCache.values());
@@ -426,20 +381,6 @@
/**
* just wrap service method
*
- * @param wikittyId
- * @param filter
- * @return
- */
- @Override
- public Map<WikittyTreeNode, Integer> restoreChildren(
- String securityToken, String wikittyId, Criteria filter) {
- // TODO lookup in cache, and put in cache
- return ws.restoreChildren(securityToken, wikittyId, filter);
- }
-
- /**
- * just wrap service method
- *
* @param name
* @return
*/
@@ -453,7 +394,7 @@
// cette methode, mise en cache lors du 1er appel, et restitution du
// meme resultat pour les appels suivants tant que pas de modification
// de l'extension (ou de clear/remove)
- WikittyExtension result = ws.restoreExtensionLastVersion(securityToken, name);
+ WikittyExtension result = getDelegate().restoreExtensionLastVersion(securityToken, name);
cachePutExtension(result);
return result;
}
@@ -462,26 +403,12 @@
* just wrap service method
*
* @param wikittyId
- * @param filter
* @return
*/
@Override
- public Entry<WikittyTreeNode, Integer> restoreNode(
- String securityToken, String wikittyId, Criteria filter) {
- // TODO lookup in cache, and put in cache
- return ws.restoreNode(securityToken, wikittyId, filter);
- }
-
- /**
- * just wrap service method
- *
- * @param wikittyId
- * @return
- */
- @Override
public WikittyTree restoreTree(String securityToken, String wikittyId) {
// TODO lookup in cache, and put in cache
- return ws.restoreTree(securityToken, wikittyId);
+ return getDelegate().restoreTree(securityToken, wikittyId);
}
/**
@@ -492,7 +419,7 @@
*/
@Override
public WikittyEvent deleteTree(String securityToken, String wikittyId) {
- WikittyEvent result = ws.deleteTree(securityToken, wikittyId);
+ WikittyEvent result = getDelegate().deleteTree(securityToken, wikittyId);
processEvent(result);
return result;
}
@@ -508,7 +435,7 @@
@Override
public WikittyEvent store(String securityToken,
Collection<Wikitty> wikitties, boolean force) {
- WikittyEvent result = ws.store(securityToken, wikitties, force);
+ WikittyEvent result = getDelegate().store(securityToken, wikitties, force);
processEvent(result);
@@ -518,7 +445,7 @@
@Override
public WikittyEvent storeExtension(String securityToken,
Collection<WikittyExtension> exts) {
- WikittyEvent result = ws.storeExtension(securityToken, exts);
+ WikittyEvent result = getDelegate().storeExtension(securityToken, exts);
processEvent(result);
return result;
}
@@ -526,14 +453,14 @@
@Override
public WikittyEvent deleteExtension(
String securityToken, Collection<String> extNames) {
- WikittyEvent result = ws.deleteExtension(securityToken, extNames);
+ WikittyEvent result = getDelegate().deleteExtension(securityToken, extNames);
processEvent(result);
return result;
}
@Override
public WikittyExtension restoreExtension(String securityToken, String id) {
- WikittyExtension result = ws.restoreExtension(securityToken, id);
+ WikittyExtension result = getDelegate().restoreExtension(securityToken, id);
cachePutExtension(result);
return result;
}
@@ -541,72 +468,24 @@
@Override
public Wikitty restoreVersion(
String securityToken, String wikittyId, String version) {
- // not put it in cache
- return ws.restoreVersion(securityToken, wikittyId, version);
+ // not put it in cache ? cache doesn't support more than one version of wikitty
+ return getDelegate().restoreVersion(securityToken, wikittyId, version);
}
@Override
public WikittyEvent replay(
String securityToken, List<WikittyEvent> events, boolean force) {
- WikittyEvent result = ws.replay(securityToken, events, force);
+ WikittyEvent result = getDelegate().replay(securityToken, events, force);
processEvent(result);
return result;
}
- //
- // Just delegate method
- //
- @Override
- public String login(String login, String password) {
- return ws.login(login, password);
- }
-
- @Override
- public void logout(String securityToken) {
- ws.logout(securityToken);
- }
-
- @Override
- public boolean canWrite(String securityToken, Wikitty wikitty) {
- return ws.canWrite(securityToken, wikitty);
- }
-
- @Override
- public boolean canDelete(String securityToken, String wikittyId) {
- return ws.canDelete(securityToken, wikittyId);
- }
-
- @Override
- public boolean canRead(String securityToken, String wikittyId) {
- return ws.canRead(securityToken, wikittyId);
- }
-
- @Override
- public void addWikittyServiceListener(WikittyListener listener, ServiceListenerType type) {
- ws.addWikittyServiceListener(listener, type);
- }
-
- @Override
- public void removeWikittyServiceListener(WikittyListener listener, ServiceListenerType type) {
- ws.removeWikittyServiceListener(listener, type);
- }
-
- @Override
- public void syncSearchEngine(String securityToken) {
- ws.syncSearchEngine(securityToken);
- }
-
- @Override
- public boolean exists(String securityToken, String wikittyId) {
- return ws.exists(securityToken, wikittyId);
- }
-
- @Override
- public boolean isDeleted(String securityToken, String wikittyId) {
- return ws.isDeleted(securityToken, wikittyId);
- }
-
+ /**
+ * Process event to update cache with data in event
+ *
+ * @param e
+ */
protected void processEvent(WikittyEvent e) {
// check clear must be the first, if event have clear and other type
// clear is all time play first
@@ -631,6 +510,7 @@
}
}
}
+
/**
* Classe permettant de recevoir les events distants et mettre a jour le cache
*/
Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceDelegator.java
===================================================================
--- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceDelegator.java 2010-12-22 15:04:09 UTC (rev 645)
+++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceDelegator.java 2010-12-22 17:50:50 UTC (rev 646)
@@ -165,7 +165,7 @@
}
@Override
- public Wikitty findByCriteria(String securityToken, Criteria criteria) {
+ public String findByCriteria(String securityToken, Criteria criteria) {
return delegate.findByCriteria(securityToken, criteria);
}
@@ -180,13 +180,13 @@
}
@Override
- public Entry<WikittyTreeNode, Integer> restoreNode(String securityToken,
+ public Entry<String, Integer> restoreNode(String securityToken,
String wikittyId, Criteria filter) {
return delegate.restoreNode(securityToken, wikittyId, filter);
}
@Override
- public Map<WikittyTreeNode, Integer> restoreChildren(String securityToken,
+ public Map<String, Integer> restoreChildren(String securityToken,
String wikittyId, Criteria filter) {
return delegate.restoreChildren(securityToken, wikittyId, filter);
}
Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceNotifier.java
===================================================================
--- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceNotifier.java 2010-12-22 15:04:09 UTC (rev 645)
+++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceNotifier.java 2010-12-22 17:50:50 UTC (rev 646)
@@ -59,14 +59,11 @@
* Last update : $Date$
* By : $Author$
*/
-public class WikittyServiceNotifier implements WikittyService {
+public class WikittyServiceNotifier extends WikittyServiceDelegator {
/** to use log facility, just put in your code: log.info(\"...\"); */
static private Log log = LogFactory.getLog(WikittyServiceNotifier.class);
- /** Service to delegate. */
- protected WikittyService ws;
-
/** Wikitty service listener (all event). */
protected ListenerSet<WikittyListener> allWikittyServiceListeners;
@@ -92,24 +89,13 @@
*
* @param config config to use
* @param ws delegate service
- */
-// public WikittyServiceNotifier(ApplicationConfig config, WikittyService ws) {
-// this(config, ws, null);
-// }
-
- /**
- * Constructor with configuration.
- *
- * @param config config to use
- * @param ws delegate service
* @param transporter transporter to use for remote event (listen or propagate).
* this transporter can be null if we don't want propagate or listen remote
* event
*/
public WikittyServiceNotifier(ApplicationConfig config,
WikittyService ws, RemoteNotifierTransporter transporter) {
- // service
- this.ws = ws;
+ super(ws);
// listeners
allWikittyServiceListeners = new ListenerSet<WikittyListener>();
@@ -185,33 +171,8 @@
}
@Override
- public String login(String login, String password) {
- return ws.login(login, password);
- }
-
- @Override
- public void logout(String securityToken) {
- ws.logout(securityToken);
- }
-
- @Override
- public boolean canWrite(String securityToken, Wikitty wikitty) {
- return ws.canWrite(securityToken, wikitty);
- }
-
- @Override
- public boolean canDelete(String securityToken, String wikittyId) {
- return ws.canDelete(securityToken, wikittyId);
- }
-
- @Override
- public boolean canRead(String securityToken, String wikittyId) {
- return ws.canRead(securityToken, wikittyId);
- }
-
- @Override
public WikittyEvent clear(String securityToken) {
- WikittyEvent result = ws.clear(securityToken);
+ WikittyEvent result = getDelegate().clear(securityToken);
fireEvent(result);
return result;
}
@@ -219,7 +180,7 @@
@Override
public WikittyEvent store(String securityToken,
Collection<Wikitty> wikitties, boolean force) {
- WikittyEvent result = ws.store(securityToken, wikitties, force);
+ WikittyEvent result = getDelegate().store(securityToken, wikitties, force);
// notify listeners
fireEvent(result);
@@ -227,22 +188,9 @@
}
@Override
- public List<String> getAllExtensionIds(String securityToken) {
- // no notification
- return ws.getAllExtensionIds(securityToken);
- }
-
- @Override
- public List<String> getAllExtensionsRequires(
- String securityToken, String extensionName) {
- // no notification
- return ws.getAllExtensionsRequires(securityToken, extensionName);
- }
-
- @Override
public WikittyEvent storeExtension(String securityToken,
Collection<WikittyExtension> exts) {
- WikittyEvent result = ws.storeExtension(securityToken, exts);
+ WikittyEvent result = getDelegate().storeExtension(securityToken, exts);
fireEvent(result);
return result;
}
@@ -250,91 +198,35 @@
@Override
public WikittyEvent deleteExtension(
String securityToken, Collection<String> extNames) {
- WikittyEvent result = ws.deleteExtension(securityToken, extNames);
+ WikittyEvent result = getDelegate().deleteExtension(securityToken, extNames);
fireEvent(result);
return result;
}
@Override
- public WikittyExtension restoreExtension(String securityToken, String id) {
- // no notification
- return ws.restoreExtension(securityToken, id);
- }
-
- @Override
- public WikittyExtension restoreExtensionLastVersion(
- String securityToken, String name) {
- // no notification
- return ws.restoreExtensionLastVersion(securityToken, name);
- }
-
- @Override
- public List<Wikitty> restore(String securityToken, List<String> ids) {
- // no notification
- return ws.restore(securityToken, ids);
- }
-
- @Override
public WikittyEvent delete(String securityToken, Collection<String> ids) {
- WikittyEvent result = ws.delete(securityToken, ids);
+ WikittyEvent result = getDelegate().delete(securityToken, ids);
// notify listeners
fireEvent(result);
return result;
}
@Override
- public PagedResult<String> findAllByCriteria(String securityToken,
- Criteria criteria) {
- // no notification
- return ws.findAllByCriteria(securityToken, criteria);
- }
-
- @Override
- public Wikitty findByCriteria(String securityToken, Criteria criteria) {
- // no notification
- return ws.findByCriteria(securityToken, criteria);
- }
-
- @Override
- public WikittyTree restoreTree(String securityToken, String wikittyId) {
- // no notification
- return ws.restoreTree(securityToken, wikittyId);
- }
-
- @Override
public WikittyEvent deleteTree(String securityToken, String wikittyId) {
- WikittyEvent result = ws.deleteTree(securityToken, wikittyId);
+ WikittyEvent result = getDelegate().deleteTree(securityToken, wikittyId);
fireEvent(result);
return result;
}
@Override
- public Entry<WikittyTreeNode, Integer> restoreNode(String securityToken, String wikittyId,
- Criteria filter) {
- // no notification
- return ws.restoreNode(securityToken, wikittyId, filter);
+ public WikittyEvent replay(
+ String securityToken, List<WikittyEvent> events, boolean force) {
+ WikittyEvent result = getDelegate().replay(securityToken, events, force);
+ // notify listeners
+ fireEvent(result);
+ return result;
}
- @Override
- public Map<WikittyTreeNode, Integer> restoreChildren(String securityToken,
- String wikittyId, Criteria filter) {
- // no notification
- return ws.restoreChildren(securityToken, wikittyId, filter);
- }
-
- @Override
- public Wikitty restoreVersion(
- String securityToken, String wikittyId, String version) {
- // no notification
- return ws.restoreVersion(securityToken, wikittyId, version);
- }
-
- @Override
- public void syncSearchEngine(String securityToken) {
- // no notification
- ws.syncSearchEngine(securityToken);
- }
-
/**
* Fire event to all registred listener.
*
@@ -389,25 +281,6 @@
super.finalize();
}
- @Override
- public WikittyEvent replay(
- String securityToken, List<WikittyEvent> events, boolean force) {
- WikittyEvent result = ws.replay(securityToken, events, force);
- // notify listeners
- fireEvent(result);
- return result;
- }
-
- @Override
- public boolean exists(String securityToken, String wikittyId) {
- return ws.exists(securityToken, wikittyId);
- }
-
- @Override
- public boolean isDeleted(String securityToken, String wikittyId) {
- return ws.isDeleted(securityToken, wikittyId);
- }
-
/**
* Thread utilise pour envoyer les events. On rend accessible ce thread
* pour pouvoir y acceder depuis l'exterieur (pour l'instant pour les tests
Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceSecurity.java
===================================================================
--- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceSecurity.java 2010-12-22 15:04:09 UTC (rev 645)
+++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceSecurity.java 2010-12-22 17:50:50 UTC (rev 646)
@@ -29,6 +29,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
+import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -67,13 +68,11 @@
* Last update: $Date$
* by : $Author$
*/
-public class WikittyServiceSecurity implements WikittyService {
+public class WikittyServiceSecurity extends WikittyServiceDelegator {
/** to use log facility, just put in your code: log.info(\"...\"); */
static private Log log = LogFactory.getLog(WikittyServiceSecurity.class);
- protected WikittyServiceEnhanced ws;
-
/** cache de l'id du groupe AppAdmin */
transient protected String appAdminGroupId = null;
@@ -83,26 +82,29 @@
* @param ws
*/
public WikittyServiceSecurity(ApplicationConfig config, WikittyService ws) {
- this.ws = new WikittyServiceEnhanced(ws);
+ super(ws);
}
@Override
public void addWikittyServiceListener(WikittyListener listener, ServiceListenerType type) {
- ws.addWikittyServiceListener(listener, type);
+ getDelegate().addWikittyServiceListener(listener, type);
}
@Override
public void removeWikittyServiceListener(WikittyListener listener, ServiceListenerType type) {
- ws.addWikittyServiceListener(listener, type);
+ getDelegate().addWikittyServiceListener(listener, type);
}
@Override
public String login(String login, String password) {
- Wikitty user = ws.findByCriteria(null, Search.query().eq(
+ String userId = getDelegate().findByCriteria(null, Search.query().eq(
WikittyUser.FQ_FIELD_WIKITTYUSER_LOGIN, login).criteria());
- if (user == null) {
- throw new IllegalArgumentException(String.format("no such account '%s'", login));
+ if (userId == null) {
+ throw new IllegalArgumentException(String.format(
+ "no such account '%s'", login));
} else {
+ Wikitty user = WikittyServiceEnhanced.restore(
+ getDelegate(), null, userId);
// check password is valid
if (WikittyUserHelper.getPassword(user).equals(password)) {
String tokenId = WikittyUtil.genSecurityTokenId();
@@ -111,7 +113,7 @@
WikittyTokenHelper.addExtension(wikittyToken);
WikittyTokenHelper.setUser(wikittyToken, user.getId());
WikittyTokenHelper.setDate(wikittyToken, new Date());
- ws.store(null, Arrays.asList(wikittyToken), false);
+ getDelegate().store(null, Arrays.asList(wikittyToken), false);
log.debug(String.format("token '%s' is for login '%s'",
tokenId, login));
return tokenId;
@@ -123,11 +125,8 @@
@Override
public void logout(String securityToken) {
- if (securityToken == null) {
- throw new IllegalArgumentException("security token is null");
- } else {
- getUserId(securityToken); // will throw exception if token is not valid
- ws.delete(securityToken, Arrays.asList(securityToken));
+ if (securityToken != null) {
+ getDelegate().delete(securityToken, Arrays.asList(securityToken));
}
}
@@ -136,7 +135,7 @@
String userId = getUserId(securityToken);
if (isAppAdmin(securityToken, userId)) {
// seul les AppAdmin on le droit a cette method
- WikittyEvent result = ws.clear(securityToken);
+ WikittyEvent result = getDelegate().clear(securityToken);
return result;
} else {
throw new SecurityException(_("user %s can't clear data", userId));
@@ -174,7 +173,7 @@
checkDeleteExtension(securityToken, e.getDeletedExtensions());
}
}
- WikittyEvent result = ws.replay(securityToken, events, force);
+ WikittyEvent result = getDelegate().replay(securityToken, events, force);
return result;
}
@@ -205,7 +204,7 @@
public WikittyEvent store(String securityToken,
Collection<Wikitty> wikitties, boolean force) {
checkStore(securityToken, wikitties);
- WikittyEvent result = ws.store(securityToken, wikitties, force);
+ WikittyEvent result = getDelegate().store(securityToken, wikitties, force);
return result;
}
@@ -223,9 +222,11 @@
for (Wikitty wikitty : wikitties) {
// usual case, a user want to store a wikitty
- Wikitty oldVersion = ws.restore(securityToken, wikitty.getId());
+ Wikitty oldVersion = WikittyServiceEnhanced.restore(
+ getDelegate(), securityToken, wikitty.getId());
- Collection<String> newExtensions = new ArrayList<String>(wikitty.getExtensionNames());
+ Collection<String> newExtensions = new ArrayList<String>(
+ wikitty.getExtensionNames());
if (oldVersion != null) {
// we already checked the rights for those extension
// re-do the check has too much cost, avoid it
@@ -250,26 +251,32 @@
for (String fqFieldDirtyName : wikitty.getDirty()) {
- String concernedExtensionName = WikittyUtil.getExtensionNameFromFQFieldName(fqFieldDirtyName);
+ String concernedExtensionName = WikittyUtil
+ .getExtensionNameFromFQFieldName(fqFieldDirtyName);
if (log.isTraceEnabled()) {
- log.trace(String.format("will update field %s from extension %s",
- fqFieldDirtyName, concernedExtensionName));
+ log.trace(String.format(
+ "will update field %s from extension %s",
+ fqFieldDirtyName, concernedExtensionName));
}
boolean fieldRequireAdminRights = // true if field is a field of WikittyAuthorisation
- // concerned extension is "WikittyAuthorisation"
- WikittyAuthorisation.EXT_WIKITTYAUTHORISATION.equals(concernedExtensionName)
- // or concerned extension is something like "AnyExtension:WikittyAuthorisation"
- || WikittyAuthorisation.EXT_WIKITTYAUTHORISATION.equals(
- WikittyUtil.getMetaExtensionNameFromFQMetaExtensionName(concernedExtensionName));
+ // concerned extension is "WikittyAuthorisation"
+ WikittyAuthorisation.EXT_WIKITTYAUTHORISATION.equals(
+ concernedExtensionName)
+ // or concerned extension is something like "AnyExtension:WikittyAuthorisation"
+ || WikittyAuthorisation.EXT_WIKITTYAUTHORISATION.equals(
+ WikittyUtil.getMetaExtensionNameFromFQMetaExtensionName(
+ concernedExtensionName));
boolean canChange; // will be true if user can modify the value of this field
// according to his level of rights
if (fieldRequireAdminRights) {
- canChange = canAdmin(securityToken, userId, concernedExtensionName, wikitty);
+ canChange = canAdmin(securityToken,
+ userId, concernedExtensionName, wikitty);
} else {
- canChange = canWrite(securityToken, userId, concernedExtensionName, wikitty);
+ canChange = canWrite(securityToken,
+ userId, concernedExtensionName, wikitty);
}
// TODO poussin 20101208 quel est l'interet de faire cette copie ?
@@ -295,7 +302,7 @@
@Override
public List<Wikitty> restore(String securityToken, List<String> ids) {
String userId = getUserId(securityToken);
- List<Wikitty> wikitties = ws.restore(securityToken, ids);
+ List<Wikitty> wikitties = getDelegate().restore(securityToken, ids);
for (Wikitty wikitty : wikitties) {
if (wikitty != null) {
refuseUnauthorizedRead(securityToken, userId, wikitty);
@@ -311,8 +318,10 @@
if (wikitty != null) {
for (String extensionName : wikitty.getExtensionNames()) {
if ( ! canRead(securityToken, userId, extensionName, wikitty)) {
- throw new SecurityException(_("user %s can't read extension %s on wikitty %s, it may be due to a global policy on the wikitty",
- userId, extensionName, wikitty));
+ throw new SecurityException(_(
+ "user %s can't read extension %s on wikitty %s,"
+ + " it may be due to a global policy on the wikitty",
+ userId, extensionName, wikitty));
}
}
}
@@ -395,7 +404,7 @@
@Override
public WikittyEvent delete(String securityToken, Collection<String> ids) {
checkDelete(securityToken, ids);
- WikittyEvent result = ws.delete(securityToken, ids);
+ WikittyEvent result = getDelegate().delete(securityToken, ids);
return result;
}
@@ -407,7 +416,7 @@
public void checkDelete(String securityToken, Collection<String> ids) {
String userId = getUserId(securityToken);
List<String> idsAsList = new ArrayList<String>(ids);
- List<Wikitty> wikitties = ws.restore(securityToken, idsAsList);
+ List<Wikitty> wikitties = getDelegate().restore(securityToken, idsAsList);
for (Wikitty wikitty : wikitties) {
for (String extensionName : wikitty.getExtensionNames()) {
if ( ! canWrite(securityToken, userId, extensionName, wikitty)) {
@@ -435,7 +444,8 @@
@Override
public boolean canDelete(String securityToken, String wikittyId) {
boolean result = true;
- Wikitty wikitty = WikittyServiceEnhanced.restore(ws, securityToken, wikittyId);
+ Wikitty wikitty = WikittyServiceEnhanced.restore(
+ getDelegate(), securityToken, wikittyId);
if (wikitty != null) {
String userId = getUserId(securityToken);
for (String extName : wikitty.getExtensionNames()) {
@@ -452,7 +462,7 @@
public boolean canRead(String securityToken, String wikittyId) {
boolean result = true;
String userId = getUserId(securityToken);
- Wikitty wikitty = WikittyServiceEnhanced.restore(ws, securityToken, wikittyId);
+ Wikitty wikitty = WikittyServiceEnhanced.restore(getDelegate(), securityToken, wikittyId);
for (String extName : wikitty.getExtensionNames()) {
result = result && isReader(securityToken, userId, wikitty, extName);
if (!result) {
@@ -462,19 +472,6 @@
return result;
}
- @Override
- public List<String> getAllExtensionIds(String securityToken) {
- // All people can read extension
- return ws.getAllExtensionIds(securityToken);
- }
-
- @Override
- public List<String> getAllExtensionsRequires(
- String securityToken, String extensionName) {
- // All people can read extension
- return ws.getAllExtensionsRequires(securityToken, extensionName);
- }
-
/* *** storing and restoring extensions ***/
protected void checkStoreExtension(String securityToken,
@@ -502,41 +499,20 @@
public WikittyEvent storeExtension(String securityToken,
Collection<WikittyExtension> exts) {
checkStoreExtension(securityToken, exts);
- return ws.storeExtension(securityToken, exts);
+ return getDelegate().storeExtension(securityToken, exts);
}
@Override
public WikittyEvent deleteExtension(
String securityToken, Collection<String> extNames) {
checkDeleteExtension(securityToken, extNames);
- return ws.deleteExtension(securityToken, extNames);
+ return getDelegate().deleteExtension(securityToken, extNames);
}
-
- @Override
- public WikittyExtension restoreExtension(String securityToken, String id) {
- // All people can read extension
- return ws.restoreExtension(securityToken, id);
- }
@Override
- public WikittyExtension restoreExtensionLastVersion(
- String securityToken, String name) {
- // All people can read extension
- return ws.restoreExtensionLastVersion(securityToken, name);
- }
-
- @Override
- public PagedResult<String> findAllByCriteria(String securityToken,
- Criteria criteria) {
- // All people can read PagedResult that contains only id
- PagedResult<String> result = ws.findAllByCriteria(securityToken, criteria);
- return result;
- }
-
- @Override
public WikittyTree restoreTree(String securityToken, String wikittyId) {
String userId = getUserId(securityToken);
- WikittyTree restoredTree = ws.restoreTree(securityToken, wikittyId);
+ WikittyTree restoredTree = getDelegate().restoreTree(securityToken, wikittyId);
checkRestoreTree(securityToken, userId, restoredTree);
return restoredTree;
}
@@ -549,64 +525,37 @@
}
- protected void checkRestoreTreeNode(String securityToken, String userId, WikittyTreeNode treeNode) {
- Wikitty treeNodeWikitty = WikittyUtil.getWikitty(ws, securityToken, treeNode);
+ private void checkRestoreTreeNode(String securityToken, String userId, WikittyTreeNode treeNode) {
+ Wikitty treeNodeWikitty = WikittyUtil.getWikitty(getDelegate(), securityToken, treeNode);
refuseUnauthorizedRead(securityToken, userId, treeNodeWikitty);
}
@Override
- public Entry<WikittyTreeNode, Integer> restoreNode(String securityToken, String wikittyId, Criteria filter) {
- String userId = getUserId(securityToken);
- Entry<WikittyTreeNode, Integer> entry = ws.restoreNode(securityToken, wikittyId, filter);
- checkRestoreTreeNode(securityToken, userId, entry.getKey());
- return entry;
- }
-
- @Override
- public Map<WikittyTreeNode, Integer> restoreChildren(String securityToken,
- String wikittyId,
- Criteria filter) {
- String userId = getUserId(securityToken);
- Map<WikittyTreeNode, Integer> children = ws.restoreChildren(securityToken, wikittyId, filter);
- for (Map.Entry<WikittyTreeNode, Integer> child : children.entrySet()) {
- checkRestoreTreeNode(securityToken, userId, child.getKey());
- }
- return children;
- }
-
- @Override
public WikittyEvent deleteTree(String securityToken, String treeNodeId) {
- WikittyTreeNode treeNode = ws.restoreNode(securityToken, treeNodeId, null).getKey();
- Wikitty treeNodeWikitty = WikittyUtil.getWikitty(ws, securityToken, treeNode);
+ Wikitty treeNodeWikitty = WikittyServiceEnhanced.restore(
+ getDelegate(), securityToken, treeNodeId);
- Collection<Wikitty> wikitties = Arrays.asList(treeNodeWikitty);
+ Collection<Wikitty> wikitties = Collections.singletonList(treeNodeWikitty);
+ // TODO poussin 20101222 perhaps we must check deletion authorization
+ // for all children ?
checkStore(securityToken, wikitties);
- return ws.deleteTree(securityToken, treeNodeId);
+ return getDelegate().deleteTree(securityToken, treeNodeId);
}
@Override
public Wikitty restoreVersion(String securityToken, String wikittyId, String version) {
- Wikitty wikitty = ws.restoreVersion(securityToken, wikittyId, version);
+ Wikitty wikitty = getDelegate().restoreVersion(securityToken, wikittyId, version);
String userId = getUserId(securityToken);
refuseUnauthorizedRead(securityToken, userId, wikitty);
return wikitty;
}
@Override
- public Wikitty findByCriteria(String securityToken,
- Criteria criteria) {
- Wikitty wikitty = ws.findByCriteria(securityToken, criteria);
- String userId = getUserId(securityToken);
- refuseUnauthorizedRead(securityToken, userId, wikitty);
- return wikitty;
- }
-
- @Override
public void syncSearchEngine(String securityToken) {
String userId = getUserId(securityToken);
if (isAppAdmin(securityToken, userId)) {
// seul les AppAdmin on le droit a cette method
- ws.syncSearchEngine(securityToken);
+ getDelegate().syncSearchEngine(securityToken);
} else {
throw new SecurityException(_("user %s can't sync search engine",
getUserId(securityToken)));
@@ -626,7 +575,8 @@
// recuperation de l'utilisateur associe au securityToken
// le securityToken est aussi l'id de l'objet
if (securityToken != null) {
- Wikitty securityTokenWikitty = ws.restore(securityToken, securityToken);
+ Wikitty securityTokenWikitty = WikittyServiceEnhanced.restore(
+ getDelegate(), securityToken, securityToken);
if (securityTokenWikitty == null) {
throw new SecurityException("bad (obsolete ?) token");
} else {
@@ -756,7 +706,8 @@
// user don't have right on current object, check parent right
String parentId = WikittyAuthorisationHelper.getParent(extensionRights);
if (parentId != null) {
- Wikitty parent = ws.restore(securityToken, parentId);
+ Wikitty parent = WikittyServiceEnhanced.restore(
+ getDelegate(), securityToken, parentId);
isMember = isMember(securityToken, userId, parent, fqFieldName);
}
}
@@ -777,18 +728,18 @@
/** get the wikitty with extension WikittyGroup that contains all app-admin. */
protected Wikitty getAppAdminGroup(String securityToken) {
- Wikitty group;
- if (appAdminGroupId == null) {
+ // on a deja fait la recherche precedement, on essaie de reutilise
+ // le meme id
+ Wikitty group = WikittyServiceEnhanced.restore(
+ getDelegate(), securityToken, appAdminGroupId);
+ if (group == null) {
// 1er fois, on le recherche
- group = ws.findByCriteria(securityToken, Search.query().eq(
- WikittyGroup.FQ_FIELD_WIKITTYGROUP_NAME,
+ String groupId = getDelegate().findByCriteria(securityToken,
+ Search.query().eq(WikittyGroup.FQ_FIELD_WIKITTYGROUP_NAME,
WikittySecurityHelper.WIKITTY_APPADMIN_GROUP_NAME).criteria());
- // group peut-etre null s'il n'existe pas
- } else {
- // on a deja fait la recherche precedement, on essaie de reutilise
- // le meme id
- group = ws.restore(securityToken, appAdminGroupId);
- // group peut-etre null, si entre temps un admin a supprime le group
+ appAdminGroupId = groupId;
+ group = WikittyServiceEnhanced.restore(
+ getDelegate(), securityToken, appAdminGroupId);
}
return group;
@@ -809,9 +760,11 @@
if (id.equals(userId)) {
return true;
} else {
- Wikitty groupWikitty = ws.restore(securityToken, id);
+ Wikitty groupWikitty = WikittyServiceEnhanced.restore(
+ getDelegate(), securityToken, id);
if (WikittyGroupHelper.hasExtension(groupWikitty)) {
- Set<String> members = WikittyGroupHelper.getMembers(groupWikitty);
+ Set<String> members =
+ WikittyGroupHelper.getMembers(groupWikitty);
return isMember(securityToken, userId, members);
}
}
@@ -841,24 +794,12 @@
String extensionName) {
String wikittyAuthorisationId = WikittyMetaExtensionUtil.generateId(
WikittyAuthorisation.EXT_WIKITTYAUTHORISATION, extensionName);
- Wikitty wikittyAuthorisation = ws.restore(securityToken, wikittyAuthorisationId);
+ Wikitty wikittyAuthorisation = WikittyServiceEnhanced.restore(
+ getDelegate(), securityToken, wikittyAuthorisationId);
if (wikittyAuthorisation == null) {
log.debug(extensionName + " has no authorization attached");
}
return wikittyAuthorisation;
}
- @Override
- public boolean exists(String securityToken, String wikittyId) {
- // no need security check for this action
- return ws.exists(securityToken, wikittyId);
- }
-
- @Override
- public boolean isDeleted(String securityToken, String wikittyId) {
- // no need security check for this action
- return ws.isDeleted(securityToken, wikittyId);
- }
-
-
}
Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceStorage.java
===================================================================
--- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceStorage.java 2010-12-22 15:04:09 UTC (rev 645)
+++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceStorage.java 2010-12-22 17:50:50 UTC (rev 646)
@@ -786,7 +786,7 @@
}
@Override
- public Wikitty findByCriteria(String securityToken, Criteria criteria) {
+ public String findByCriteria(String securityToken, Criteria criteria) {
WikittyTransaction tx = WikittyTransaction.get();
boolean txBeginHere = false;
try {
@@ -795,14 +795,15 @@
txBeginHere = true;
}
+ // TODO poussin 20101222 perhaps we must do a copy of criteria
+ // before modify it with index, to prevent bad side effect ?
criteria.setFirstIndex(0).setEndIndex(1);
PagedResult<String> pages = findAllByCriteria(
securityToken, criteria);
- Wikitty result = null;
+ String result = null;
if (pages.size() > 0) {
- String id = pages.getFirst();
- result = restore(securityToken, id);
+ result = pages.getFirst();
}
if (txBeginHere) {
@@ -932,7 +933,7 @@
}
@Override
- public Map.Entry<WikittyTreeNode, Integer> restoreNode(String securityToken,
+ public Map.Entry<String, Integer> restoreNode(String securityToken,
String wikittyId, Criteria filter) {
WikittyTransaction tx = WikittyTransaction.get();
boolean txBeginHere = false;
@@ -942,26 +943,20 @@
txBeginHere = true;
}
+ HashMap.SimpleEntry<String, Integer> result = null;
Wikitty w = restore(securityToken, wikittyId);
- if(w == null) {
- if (txBeginHere) {
- tx.commit();
+ if(w != null) {
+ if (!w.hasExtension(WikittyTreeNode.EXT_WIKITTYTREENODE)) {
+ throw new WikittyException(String.format(
+ "Wikitty '%s' do not handle extension %s",
+ wikittyId, WikittyTreeNode.EXT_WIKITTYTREENODE));
}
- return null;
- }
- if ( !w.hasExtension(WikittyTreeNode.EXT_WIKITTYTREENODE) ) {
- throw new WikittyException(String.format(
- "Wikitty '%s' do not handle extension %s",
- wikittyId, WikittyTreeNode.EXT_WIKITTYTREENODE ));
+ Integer count = getSearchEngine().findNodeCount(tx, w, filter);
+
+ result = new SimpleEntry<String, Integer>(wikittyId, count);
}
- WikittyTreeNode node = new WikittyTreeNodeImpl(w);
- Integer count = getSearchEngine().findNodeCount(tx, w, filter);
-
- HashMap.SimpleEntry<WikittyTreeNode, Integer> result =
- new SimpleEntry<WikittyTreeNode, Integer>(node, count);
-
if (txBeginHere) {
tx.commit();
}
@@ -980,7 +975,7 @@
}
@Override
- public Map<WikittyTreeNode, Integer> restoreChildren(String securityToken,
+ public Map<String, Integer> restoreChildren(String securityToken,
String wikittyId, Criteria filter) {
WikittyTransaction tx = WikittyTransaction.get();
boolean txBeginHere = false;
@@ -990,42 +985,18 @@
txBeginHere = true;
}
+ Map<String, Integer> result = null;
Wikitty w = restore(securityToken, wikittyId);
- if(w == null) {
- if (txBeginHere) {
- tx.commit();
+ if(w != null) {
+ if (!w.hasExtension(WikittyTreeNode.EXT_WIKITTYTREENODE)) {
+ throw new WikittyException(String.format(
+ "Wikitty '%s' do not handle extension %s",
+ wikittyId, WikittyTreeNode.EXT_WIKITTYTREENODE));
}
- return null;
- }
- if ( !w.hasExtension(WikittyTreeNode.EXT_WIKITTYTREENODE) ) {
- throw new WikittyException(String.format(
- "Wikitty '%s' do not handle extension %s",
- wikittyId, WikittyTreeNode.EXT_WIKITTYTREENODE ));
+ result = getSearchEngine().findAllChildrenCount(tx, w, filter);
}
- Map<WikittyTreeNode, Integer> result = new LinkedHashMap<WikittyTreeNode, Integer>();
-
- Map<String, Integer> search = getSearchEngine().findAllChildrenCount(
- tx, w, filter);
- Set<Entry<String, Integer>> children = search.entrySet();
- for (Entry<String, Integer> child : children) {
- Integer count = child.getValue();
-
- String id = child.getKey();
- Wikitty wikitty = restore(securityToken, id);
- if (!wikitty.hasExtension(WikittyTreeNode.EXT_WIKITTYTREENODE)) {
- // si cette exception est leve, c'est qu'il y a une mauvaise
- // implantation de l'api et une erreur d'interpretation
- // entre children et attachment voir l'implantation de la
- // methode getSearchEngine().findAllChildrenCount
- throw new WikittyException("API error, api restore tree node, but wikitty is not a tree node");
- }
- WikittyTreeNode node = new WikittyTreeNodeImpl(wikitty);
-
- result.put(node, count);
- }
-
if (txBeginHere) {
tx.commit();
}
Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceTransaction.java
===================================================================
--- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceTransaction.java 2010-12-22 15:04:09 UTC (rev 645)
+++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/WikittyServiceTransaction.java 2010-12-22 17:50:50 UTC (rev 646)
@@ -47,6 +47,7 @@
import org.nuiton.wikitty.WikittyServiceFactory;
import org.nuiton.wikitty.WikittyTree;
import org.nuiton.wikitty.entities.WikittyTreeNode;
+import org.nuiton.wikitty.search.Search;
/**
*
@@ -310,15 +311,13 @@
}
@Override
- public Wikitty findByCriteria(String securityToken, Criteria criteria) {
- Wikitty result = null;
- PagedResult<String> ids = findAllByCriteria(securityToken, criteria);
- List<String> results = ids.getAll();
- if (results.size() > 0) {
- String id = results.get(0);
- List<Wikitty> wikitties = restore(
- securityToken, Collections.singletonList(id));
- result = wikitties.get(0);
+ public String findByCriteria(String securityToken, Criteria criteria) {
+ String result = null;
+ Criteria criteriaLimit =
+ Search.query(criteria).criteria().setFirstIndex(0).setEndIndex(1);
+ PagedResult<String> ids = findAllByCriteria(securityToken, criteriaLimit);
+ if (ids.size() > 0) {
+ result = ids.getFirst();
}
return result;
}
@@ -334,12 +333,12 @@
}
@Override
- public Entry<WikittyTreeNode, Integer> restoreNode(String securityToken, String wikittyId, Criteria filter) {
+ public Entry<String, Integer> restoreNode(String securityToken, String wikittyId, Criteria filter) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
- public Map<WikittyTreeNode, Integer> restoreChildren(String securityToken, String wikittyId, Criteria filter) {
+ public Map<String, Integer> restoreChildren(String securityToken, String wikittyId, Criteria filter) {
throw new UnsupportedOperationException("Not supported yet.");
}
Modified: trunk/wikitty-api/src/test/java/org/nuiton/wikitty/layers/WikittyServiceSecurityTest.java
===================================================================
--- trunk/wikitty-api/src/test/java/org/nuiton/wikitty/layers/WikittyServiceSecurityTest.java 2010-12-22 15:04:09 UTC (rev 645)
+++ trunk/wikitty-api/src/test/java/org/nuiton/wikitty/layers/WikittyServiceSecurityTest.java 2010-12-22 17:50:50 UTC (rev 646)
@@ -170,8 +170,10 @@
try {
service.logout(invalidToken);
+ } catch (SecurityException e) {
+ // log out must be never faild
fail();
- } catch (SecurityException e) {}
+ }
// now try to make a valid token invalid
service.logout(readerToken);
Modified: trunk/wikitty-api/src/test/java/org/nuiton/wikitty/services/WikittyServiceHelperTest.java
===================================================================
--- trunk/wikitty-api/src/test/java/org/nuiton/wikitty/services/WikittyServiceHelperTest.java 2010-12-22 15:04:09 UTC (rev 645)
+++ trunk/wikitty-api/src/test/java/org/nuiton/wikitty/services/WikittyServiceHelperTest.java 2010-12-22 17:50:50 UTC (rev 646)
@@ -60,9 +60,9 @@
WikittyService ws = WikittyServiceFactory.buildWikittyService(config);
Assert.assertEquals(WikittyServiceCached.class, ws.getClass());
- ws = ((WikittyServiceCached)ws).ws;
+ ws = ((WikittyServiceCached)ws).getDelegate();
Assert.assertEquals(WikittyServiceNotifier.class, ws.getClass());
- ws = ((WikittyServiceNotifier)ws).ws;
+ ws = ((WikittyServiceNotifier)ws).getDelegate();
Assert.assertEquals(WikittyServiceInMemory.class, ws.getClass());
}
@@ -78,11 +78,11 @@
WikittyService ws = WikittyServiceFactory.buildWikittyService(config);
Assert.assertEquals(WikittyServiceSecurity.class, ws.getClass());
- ws = ((WikittyServiceEnhanced)((WikittyServiceSecurity) ws).ws).delegate;
+ ws = ((WikittyServiceSecurity) ws).getDelegate();
Assert.assertEquals(WikittyServiceCached.class, ws.getClass());
- ws = ((WikittyServiceCached) ws).ws;
+ ws = ((WikittyServiceCached) ws).getDelegate();
Assert.assertEquals(WikittyServiceNotifier.class, ws.getClass());
- ws = ((WikittyServiceNotifier) ws).ws;
+ ws = ((WikittyServiceNotifier) ws).getDelegate();
Assert.assertEquals(WikittyServiceStorage.class, ws.getClass());
}
}
Modified: trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/AbstractTestSolr.java
===================================================================
--- trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/AbstractTestSolr.java 2010-12-22 15:04:09 UTC (rev 645)
+++ trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/AbstractTestSolr.java 2010-12-22 17:50:50 UTC (rev 646)
@@ -26,13 +26,23 @@
import org.junit.Before;
import org.nuiton.wikitty.WikittyConfig;
+import org.nuiton.wikitty.WikittyProxy;
import org.nuiton.wikitty.services.WikittyServiceEnhanced;
public abstract class AbstractTestSolr {
+ protected WikittyProxy proxy = null;
+
protected WikittyServiceEnhanced ws =
new WikittyServiceEnhanced(new WikittyServiceSolr(new WikittyConfig()));
+ public WikittyProxy getProxy() {
+ if (proxy == null) {
+ proxy = new WikittyProxy(ws);
+ }
+ return proxy;
+ }
+
@Before
public void deleteAll() throws Exception {
ws.clear(null);
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-22 15:04:09 UTC (rev 645)
+++ trunk/wikitty-solr-impl/src/test/java/org/nuiton/wikitty/storage/solr/TreeTest.java 2010-12-22 17:50:50 UTC (rev 646)
@@ -156,7 +156,7 @@
protected Wikitty findNode(String nodeName) {
Criteria criteria = Search.query().eq(
WikittyTreeNode.FQ_FIELD_WIKITTYTREENODE_NAME, nodeName).criteria();
- Wikitty wikitty = ws.findByCriteria(null, criteria);
+ Wikitty wikitty = getProxy().findByCriteria(criteria);
return wikitty;
}
@@ -165,7 +165,7 @@
*/
protected Wikitty findValue(String value) {
Criteria criteria = Search.query().eq("test.name", value).criteria();
- Wikitty wikitty = ws.findByCriteria(null, criteria);
+ Wikitty wikitty = getProxy().findByCriteria(criteria);
return wikitty;
}
@@ -183,7 +183,8 @@
// Sum children node in node
String nodeId = node.getId();
- Map<WikittyTreeNode, Integer> children = ws.restoreChildren(null, nodeId, null);
+ Map<WikittyTreeNode, Integer> children = getProxy().restoreChildren(
+ WikittyTreeNode.class, nodeId, null);
/*
for (Integer count : children.values()) {
@@ -260,7 +261,8 @@
Wikitty node1 = findNode("node1");
String node1Id = node1.getId();
- Map<WikittyTreeNode, Integer> children = ws.restoreChildren(null, node1Id, null);
+ Map<WikittyTreeNode, Integer> children = getProxy().restoreChildren(
+ WikittyTreeNode.class, node1Id, null);
assertEquals(3, children.size());
}
@@ -275,7 +277,8 @@
String node1Id = node1.getId();
Criteria filter = Search.query().eq("test.name", "value 3").criteria();
- Map<WikittyTreeNode, Integer> children = ws.restoreChildren(null, node1Id, filter);
+ Map<WikittyTreeNode, Integer> children = getProxy().restoreChildren(
+ WikittyTreeNode.class, node1Id, filter);
System.out.println(children);
assertEquals(3, children.size());
for (Map.Entry<WikittyTreeNode, Integer> e : children.entrySet()) {
@@ -288,7 +291,8 @@
Wikitty node11 = findNode("node11");
String node11Id = node11.getId();
- Entry<WikittyTreeNode, Integer> count = ws.restoreNode(null, node11Id, null);
+ Entry<WikittyTreeNode, Integer> count = getProxy().restoreNode(
+ WikittyTreeNode.class, node11Id, null);
assertEquals(3, count.getValue().intValue());
}
@@ -298,7 +302,8 @@
String node11Id = node11.getId();
Criteria filter = Search.query().eq("test.name", "value 3").criteria();
- Entry<WikittyTreeNode, Integer> count = ws.restoreNode(null, node11Id, filter);
+ Entry<WikittyTreeNode, Integer> count = getProxy().restoreNode(
+ WikittyTreeNode.class, node11Id, filter);
System.out.println(count);
assertEquals(1, count.getValue().intValue());
}
@@ -308,7 +313,8 @@
// Check that node 2 it has any child
Wikitty node2 = findNode("node2");
String node2Id = node2.getId();
- Map<WikittyTreeNode, Integer> children = ws.restoreChildren(null, node2Id, null);
+ Map<WikittyTreeNode, Integer> children = getProxy().restoreChildren(
+ WikittyTreeNode.class, node2Id, null);
assertEquals(0, children.size());
// Create a new node, child of node 2
@@ -320,7 +326,8 @@
assertNotNull(found);
// Check that it was great added as node2 child
- children = ws.restoreChildren(null, node2Id, null);
+ children = getProxy().restoreChildren(
+ WikittyTreeNode.class, node2Id, null);
assertEquals(1, children.size());
}
@@ -418,8 +425,8 @@
WikittyEvent event = ws.store(null, child.getWikitty());
event.update(child.getWikitty());
- Map<WikittyTreeNode, Integer> children =
- ws.restoreChildren(null, parent.getWikittyId(), null);
+ Map<WikittyTreeNode, Integer> children = getProxy().restoreChildren(
+ WikittyTreeNode.class, parent.getWikittyId(), null);
assertEquals(1, children.size());
assertEquals(0, children.get(child).intValue());
@@ -428,7 +435,8 @@
ws.store(null, child.getWikitty());
- children = ws.restoreChildren(null, parent.getWikittyId(), null);
+ children = getProxy().restoreChildren(
+ WikittyTreeNode.class, parent.getWikittyId(), null);
assertEquals(0, children.size());
}
@@ -497,7 +505,8 @@
int sum = sum(node3);
assertEquals(2, sum);
- Entry<WikittyTreeNode, Integer> count = ws.restoreNode(null, node3.getId(), null);
+ Entry<WikittyTreeNode, Integer> count = getProxy().restoreNode(
+ WikittyTreeNode.class, node3.getId(), null);
assertEquals(1, count.getValue().intValue());
sum = sum(node31);
1
0
22 Dec '10
Author: bpoussin
Date: 2010-12-22 16:04:09 +0100 (Wed, 22 Dec 2010)
New Revision: 645
Url: http://nuiton.org/repositories/revision/wikitty/645
Log:
inverse time to proxy log time warn(3s) and log level (1s)
Modified:
trunk/wikitty-api/src/main/java/org/nuiton/wikitty/WikittyConfig.java
Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/WikittyConfig.java
===================================================================
--- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/WikittyConfig.java 2010-12-22 14:41:17 UTC (rev 644)
+++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/WikittyConfig.java 2010-12-22 15:04:09 UTC (rev 645)
@@ -328,11 +328,11 @@
WIKITTY_PROXY_TIME_TO_LOG_INFO(
"wikitty.proxy.timeToLog.info",
_("maximum time before send log info with time consumed"),
- "5000", Integer.class, false, false),
+ "1000", Integer.class, false, false),
WIKITTY_PROXY_TIME_TO_LOG_WARN(
"wikitty.proxy.timeToLog.warn",
_("maximum time before send log warn with time consumed"),
- "1000", Integer.class, false, false),
+ "3000", Integer.class, false, false),
JCS_DEFAULT(
"jcs.default",
1
0
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