Author: sletellier Date: 2011-10-11 15:01:38 +0200 (Tue, 11 Oct 2011) New Revision: 136 Url: http://chorem.org/repositories/revision/vradi/136 Log: Use cajo server Removed: trunk/vradi-services-web/src/main/java/org/chorem/vradi/services/VradiWikittyServiceDelegator.java trunk/vradi-services-web/src/test/java/org/chorem/vradi/services/VradiHessianStorageTest.java Modified: trunk/pom.xml trunk/vradi-services-web/pom.xml trunk/vradi-services-web/src/main/webapp/WEB-INF/web.xml trunk/vradi-services-web/src/test/java/org/chorem/vradi/services/util/ReindexService.java trunk/vradi-services/pom.xml trunk/vradi-services/src/main/java/org/chorem/vradi/services/VradiServiceFactory.java trunk/vradi-swing/pom.xml trunk/vradi-swing/src/main/java/org/chorem/vradi/services/VradiService.java trunk/vradi-web/pom.xml trunk/vradi-web/src/main/java/org/chorem/vradi/VradiProxy.java trunk/vradi-web/src/main/resources/struts.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2011-09-22 17:32:28 UTC (rev 135) +++ trunk/pom.xml 2011-10-11 13:01:38 UTC (rev 136) @@ -116,15 +116,17 @@ <!-- libraries version --> <jaxxVersion>2.4</jaxxVersion> + <eugenePluginVersion>2.3.5</eugenePluginVersion> + <nuitonWidgetVersion>1.1.1</nuitonWidgetVersion> <nuitonUtilsVersion>2.2</nuitonUtilsVersion> + <nuitonWebVersion>1.3</nuitonWebVersion> <nuitonI18nVersion>2.4</nuitonI18nVersion> - <nuitonWidgetVersion>1.1.1</nuitonWidgetVersion> - <generatorPluginVersion>2.3.5</generatorPluginVersion> - <wikittyVersion>3.2-SNAPSHOT</wikittyVersion> + <wikittyVersion>3.3-SNAPSHOT</wikittyVersion> + <slf4jVersion>1.6.1</slf4jVersion> + <h2Version>1.2.134</h2Version> <jrstVersion>1.4-SNAPSHOT</jrstVersion> <oooVersion>3.2.1</oooVersion> <javamailVersion>1.4.3</javamailVersion> - <slf4jVersion>1.6.1</slf4jVersion> <struts2Version>2.2.3</struts2Version> <struts2jqueryVersion>3.1.0</struts2jqueryVersion> <servletApiVersion>2.5</servletApiVersion> @@ -136,12 +138,12 @@ <!-- license to use --> <license.licenseName>agpl_v3</license.licenseName> - <!-- i18n configuration --> - <i18n.bundles>fr_FR,en_GB</i18n.bundles> - <i18n.silent>true</i18n.silent> + <!--<!– i18n configuration –>--> + <!--<i18n.bundles>fr_FR,en_GB</i18n.bundles>--> + <!--<i18n.silent>true</i18n.silent>--> - <!-- strust allow only iso :( --> - <i18n.bundleOutputEncoding>ISO-8859-1</i18n.bundleOutputEncoding> + <!--<!– strust allow only iso :( –>--> + <!--<i18n.bundleOutputEncoding>ISO-8859-1</i18n.bundleOutputEncoding>--> </properties> @@ -168,6 +170,12 @@ </dependency> <dependency> + <groupId>org.nuiton.web</groupId> + <artifactId>nuiton-struts2</artifactId> + <version>${nuitonWebVersion}</version> + </dependency> + + <dependency> <groupId>org.nuiton.i18n</groupId> <artifactId>nuiton-i18n</artifactId> <version>${nuitonI18nVersion}</version> @@ -283,12 +291,6 @@ <dependency> <groupId>org.nuiton.wikitty</groupId> - <artifactId>wikitty-hessian-client</artifactId> - <version>${wikittyVersion}</version> - </dependency> - - <dependency> - <groupId>org.nuiton.wikitty</groupId> <artifactId>wikitty-struts</artifactId> <version>${wikittyVersion}</version> </dependency> @@ -365,13 +367,6 @@ </dependency> <dependency> - <groupId>com.caucho</groupId> - <artifactId>hessian</artifactId> - <version>4.0.6</version> - <scope>compile</scope> - </dependency> - - <dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId> <version>1.2.2</version> @@ -519,7 +514,7 @@ <plugin> <groupId>org.nuiton.eugene</groupId> <artifactId>maven-eugene-plugin</artifactId> - <version>${generatorPluginVersion}</version> + <version>${eugenePluginVersion}</version> <dependencies> <dependency> <groupId>org.nuiton.wikitty</groupId> Modified: trunk/vradi-services/pom.xml =================================================================== --- trunk/vradi-services/pom.xml 2011-09-22 17:32:28 UTC (rev 135) +++ trunk/vradi-services/pom.xml 2011-10-11 13:01:38 UTC (rev 136) @@ -161,11 +161,6 @@ <artifactId>lucene-core</artifactId> </dependency> - <dependency> - <groupId>com.caucho</groupId> - <artifactId>hessian</artifactId> - </dependency> - </dependencies> <build> Modified: trunk/vradi-services/src/main/java/org/chorem/vradi/services/VradiServiceFactory.java =================================================================== --- trunk/vradi-services/src/main/java/org/chorem/vradi/services/VradiServiceFactory.java 2011-09-22 17:32:28 UTC (rev 135) +++ trunk/vradi-services/src/main/java/org/chorem/vradi/services/VradiServiceFactory.java 2011-10-11 13:01:38 UTC (rev 136) @@ -23,15 +23,13 @@ */ package org.chorem.vradi.services; -import com.caucho.hessian.client.HessianProxyFactory; +import gnu.cajo.utils.extra.TransparentItemProxy; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.vradi.VradiServiceConfiguration; import org.chorem.vradi.VradiServiceConfigurationHelper; import org.nuiton.util.ApplicationConfig; import org.nuiton.wikitty.WikittyProxy; import org.nuiton.wikitty.WikittyService; -import org.nuiton.wikitty.WikittyServiceFactory; /** * VradiServiceFactory. @@ -62,40 +60,38 @@ // check is it's valid url if (isValidUrl(serviceEndpoint)) { + if (log.isInfoEnabled()) { + log.info("Use remote mode with url : " + serviceEndpoint); + } + try { -// Cajo impl -// String cajoEndPoint = serviceEndpoint; -// // cajo url is not http or other protocol, url must start with // -// // example: //localhost:1198/ws -// // remove protocol -// int i = cajoEndPoint.indexOf("://"); -// if (i >= 0) { -// cajoEndPoint = serviceEndpoint.substring(i+1); -// } -// int servicePort = VradiServiceConfigurationHelper.getServicePort(config); -// serviceEndpoint = getServiceURL(cajoEndPoint, servicePort, VradiStorageService.VRADI_SERVICE); -// -// if (log.isInfoEnabled()) { -// log.info("Use remote mode with url : " + serviceEndpoint); -// } -// result = (VradiStorageService) TransparentItemProxy.getItem( -// serviceEndpoint, new Class[]{VradiStorageService.class}); - if (log.isInfoEnabled()) { - log.info("Use remote mode with url : " + serviceEndpoint); + String cajoEndPoint = serviceEndpoint; + // cajo url is not http or other protocol, url must start with // + // example: //localhost:1198/ws + // remove protocol + int i = cajoEndPoint.indexOf("://"); + if (i >= 0) { + cajoEndPoint = serviceEndpoint.substring(i+1); } + int servicePort = VradiServiceConfigurationHelper.getServicePort(config); + serviceEndpoint = getServiceURL(cajoEndPoint, servicePort, VradiStorageService.VRADI_SERVICE); - HessianProxyFactory factory = new HessianProxyFactory(); - // Fix : com.caucho.hessian.io.HessianProtocolException: '���' is an unknown code - factory.setHessian2Request(true); - // pour que les méthodes aux noms dupliquées fonctionnent (arguments different) - factory.setOverloadEnabled(true); + result = (VradiStorageService) TransparentItemProxy.getItem( + serviceEndpoint, new Class[]{VradiStorageService.class}); - // vradi service - result = (VradiStorageService) factory. - create(VradiStorageService.class, - getServiceURL(serviceEndpoint, VradiStorageService.VRADI_SERVICE)); +// HessianProxyFactory factory = new HessianProxyFactory(); +// // Fix : com.caucho.hessian.io.HessianProtocolException: '���' is an unknown code +// factory.setHessian2Request(true); +// // pour que les méthodes aux noms dupliquées fonctionnent (arguments different) +// factory.setOverloadEnabled(true); +// +// // vradi service +// result = (VradiStorageService) factory. +// create(VradiStorageService.class, +// getServiceURL(serviceEndpoint, VradiStorageService.VRADI_SERVICE)); + } catch (Exception eee) { if (log.isErrorEnabled()) { log.error("Can't init remote proxy", eee); @@ -120,10 +116,11 @@ /** * Get wikittyService instanciate by vradiService * + * @param vradiService of application * @return wikittyService instanciate */ - public static WikittyService getWikittyService(ApplicationConfig config) { - return WikittyServiceFactory.buildWikittyService(config); + public static WikittyService getWikittyService(VradiStorageService vradiService) { + return vradiService.getWikittyService(); } /** @@ -141,8 +138,9 @@ FileService fileService; String serviceEndpoint = VradiServiceConfigurationHelper.getRemoteEndpoint(config); if (isValidUrl(serviceEndpoint)) { + int servletPort = VradiServiceConfigurationHelper.getServletPort(config); // file service - String fileServiceUrl = getServiceURL(serviceEndpoint, "file"); + String fileServiceUrl = getServiceURL(serviceEndpoint, servletPort, "file"); log.info("File service url : " + fileServiceUrl); fileService = new FileServiceProxy(fileServiceUrl); } else { @@ -162,9 +160,14 @@ * @param serviceEndUrl service small name * @return service full url */ - protected static String getServiceURL(String serviceEndpoint, String serviceEndUrl) { + protected static String getServiceURL(String serviceEndpoint, int port, String serviceEndUrl) { String fullUrl = serviceEndpoint; + // Add port if != 0 + if (port != 0) { + fullUrl += ":" + port; + } + // Warn hessian won't work with double / if (!fullUrl.endsWith("/")) { fullUrl += "/"; Modified: trunk/vradi-services-web/pom.xml =================================================================== --- trunk/vradi-services-web/pom.xml 2011-09-22 17:32:28 UTC (rev 135) +++ trunk/vradi-services-web/pom.xml 2011-10-11 13:01:38 UTC (rev 136) @@ -47,11 +47,6 @@ </dependency> <dependency> - <groupId>com.caucho</groupId> - <artifactId>hessian</artifactId> - </dependency> - - <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <scope>provided</scope> Deleted: trunk/vradi-services-web/src/main/java/org/chorem/vradi/services/VradiWikittyServiceDelegator.java =================================================================== --- trunk/vradi-services-web/src/main/java/org/chorem/vradi/services/VradiWikittyServiceDelegator.java 2011-09-22 17:32:28 UTC (rev 135) +++ trunk/vradi-services-web/src/main/java/org/chorem/vradi/services/VradiWikittyServiceDelegator.java 2011-10-11 13:01:38 UTC (rev 136) @@ -1,48 +0,0 @@ -/* - * #%L - * Vradi :: Services Web - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2009 - 2010 Codelutin, Chatellier Eric - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ - -package org.chorem.vradi.services; - -import org.chorem.vradi.VradiServiceConfiguration; -import org.nuiton.wikitty.services.WikittyServiceDelegator; - -/** - * Wikitty proxy delegator. - * <p/> - * This delegator exist only because we cannot put instance as hessian service. - * <p/> - * This delegator just delegate everything to a static real wikitty service. - * - * @author chatellier - * @version $Revision$ - * <p/> - * Last update : $Date$ - * By : $Author$ - */ -public class VradiWikittyServiceDelegator extends WikittyServiceDelegator { - - public VradiWikittyServiceDelegator() { - super(VradiServiceFactory.getWikittyService(VradiServiceConfiguration.getConfig())); - } -} Modified: trunk/vradi-services-web/src/main/webapp/WEB-INF/web.xml =================================================================== --- trunk/vradi-services-web/src/main/webapp/WEB-INF/web.xml 2011-09-22 17:32:28 UTC (rev 135) +++ trunk/vradi-services-web/src/main/webapp/WEB-INF/web.xml 2011-10-11 13:01:38 UTC (rev 136) @@ -30,52 +30,54 @@ <display-name>Vradi</display-name> <servlet> - <servlet-name>vradiStorageServlet</servlet-name> - <servlet-class>com.caucho.hessian.server.HessianServlet</servlet-class> - <init-param> - <param-name>home-api</param-name> - <param-value>org.chorem.vradi.services.VradiStorageService</param-value> - </init-param> - <init-param> - <param-name>home-class</param-name> - <param-value>org.chorem.vradi.services.VradiStorageServiceImpl - </param-value> - </init-param> - <load-on-startup>1</load-on-startup> - </servlet> - <servlet> - <servlet-name>wikittyServiceServlet</servlet-name> - <servlet-class>com.caucho.hessian.server.HessianServlet</servlet-class> - <init-param> - <param-name>home-api</param-name> - <param-value>org.nuiton.wikitty.WikittyService</param-value> - </init-param> - <init-param> - <param-name>home-class</param-name> - <param-value>org.chorem.vradi.services.VradiWikittyServiceDelegator - </param-value> - </init-param> - <load-on-startup>2</load-on-startup> - </servlet> - <servlet> <servlet-name>fileServlet</servlet-name> <servlet-class>org.chorem.vradi.services.FileServlet</servlet-class> </servlet> - <servlet-mapping> - <servlet-name>vradiStorageServlet</servlet-name> - <url-pattern>/vradiservice</url-pattern> - </servlet-mapping> - <servlet-mapping> - <servlet-name>wikittyServiceServlet</servlet-name> - <url-pattern>/wikittyservice</url-pattern> - </servlet-mapping> + <!-- For hessian--> + <!--<servlet>--> + <!--<servlet-name>vradiStorageServlet</servlet-name>--> + <!--<servlet-class>com.caucho.hessian.server.HessianServlet</servlet-class>--> + <!--<init-param>--> + <!--<param-name>home-api</param-name>--> + <!--<param-value>org.chorem.vradi.services.VradiStorageService</param-value>--> + <!--</init-param>--> + <!--<init-param>--> + <!--<param-name>home-class</param-name>--> + <!--<param-value>org.chorem.vradi.services.VradiStorageServiceImpl--> + <!--</param-value>--> + <!--</init-param>--> + <!--<load-on-startup>1</load-on-startup>--> + <!--</servlet>--> + <!--<servlet>--> + <!--<servlet-name>wikittyServiceServlet</servlet-name>--> + <!--<servlet-class>com.caucho.hessian.server.HessianServlet</servlet-class>--> + <!--<init-param>--> + <!--<param-name>home-api</param-name>--> + <!--<param-value>org.nuiton.wikitty.WikittyService</param-value>--> + <!--</init-param>--> + <!--<init-param>--> + <!--<param-name>home-class</param-name>--> + <!--<param-value>org.chorem.vradi.services.VradiWikittyServiceDelegator--> + <!--</param-value>--> + <!--</init-param>--> + <!--<load-on-startup>2</load-on-startup>--> + <!--</servlet>--> + <!--<servlet-mapping>--> + <!--<servlet-name>vradiStorageServlet</servlet-name>--> + <!--<url-pattern>/vradiservice</url-pattern>--> + <!--</servlet-mapping>--> + <!--<servlet-mapping>--> + <!--<servlet-name>wikittyServiceServlet</servlet-name>--> + <!--<url-pattern>/wikittyservice</url-pattern>--> + <!--</servlet-mapping>--> + <!-- Used for cajo --> - <!--<listener>--> - <!--<description>Init</description>--> - <!--<listener-class>org.chorem.vradi.ApplicationListener</listener-class>--> - <!--</listener>--> + <listener> + <description>Init</description> + <listener-class>org.chorem.vradi.ApplicationListener</listener-class> + </listener> <servlet-mapping> <servlet-name>fileServlet</servlet-name> Deleted: trunk/vradi-services-web/src/test/java/org/chorem/vradi/services/VradiHessianStorageTest.java =================================================================== --- trunk/vradi-services-web/src/test/java/org/chorem/vradi/services/VradiHessianStorageTest.java 2011-09-22 17:32:28 UTC (rev 135) +++ trunk/vradi-services-web/src/test/java/org/chorem/vradi/services/VradiHessianStorageTest.java 2011-10-11 13:01:38 UTC (rev 136) @@ -1,204 +0,0 @@ -/* - * #%L - * Vradi :: Services Web - * - * $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 Affero 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 Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package org.chorem.vradi.services; - -import com.caucho.hessian.client.HessianProxyFactory; -import org.apache.commons.lang.time.DateUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.chorem.vradi.VradiConstants; -import org.chorem.vradi.beans.XmlStreamImportResult; -import org.chorem.vradi.entities.Session; -import org.chorem.vradi.entities.SessionImpl; -import org.chorem.vradi.entities.XmlFieldBinding; -import org.chorem.vradi.entities.XmlStream; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; -import org.mortbay.jetty.runner.Runner; -import org.nuiton.util.Resource; -import org.nuiton.wikitty.WikittyProxy; -import org.nuiton.wikitty.WikittyService; -import org.nuiton.wikitty.WikittyUtil; -import org.nuiton.wikitty.entities.WikittyExtension; - -import java.net.URL; -import java.util.Date; -import java.util.List; - -/** - * VradiHessianStorageTest. - * - * @author $Author$ - * @version $Revision$ $Date$ - * @since 21 févr. 2010 02:13:16 - * - * TODO echatellier 20110629 test desactivé car toujours en echec - * je pense que les wikitty service coté serveur ne s'initialise pas - * avec la bonne configuration, donc tous les tests qui utilisent - * l'index solr ne cherche pas là où il faut - */ -@Ignore -public class VradiHessianStorageTest extends VradiStorageServiceTest { - static final Log log = LogFactory.getLog(VradiHessianStorageTest.class); - - static final String port = "9000"; - - static final String clearUrl = "http://localhost:" + port + "/clearservice"; - - static final String storageUrl = "http://localhost:" + port + "/vradiservice"; - - static final String wikittyUrl = "http://localhost:" + port + "/wikittyservice"; - - static final String fileUrl = "http://localhost:" + port + "/file"; - - static VradiJettyRunner runner; - - public static class VradiJettyRunner extends Runner { - @Override - public void run() throws Exception { - _server.start(); - // Skip join - } - - public void stop() throws Exception { - _server.stop(); - } - } - - @BeforeClass - public static void startServer() throws Exception { - - runner = new VradiJettyRunner(); - - // This is the file to find to get the path of vradi-services-web module - String placeHolder = "/vradi_services_web.place_holder"; - - // Find the file - URL url = Resource.getURL(placeHolder); - - // Remove the file name and folder 'target/test-classes' - String contextPath = url.toString(); - String target = "/target/test-classes"; - contextPath = contextPath.substring(0, contextPath.length() - (placeHolder.length() + target.length())); - - // Add webapp context - contextPath += "/src/test/webapp"; - String[] args = {"--port", port, contextPath}; - runner.configure(args); - - runner.run(); - } - - @AfterClass - public static void stopServer() throws Exception { - runner.stop(); - } - - @Override - @Before - public void clear() throws Exception { - HessianProxyFactory factory = new HessianProxyFactory(); - factory.setHessian2Request(true); - factory.setOverloadEnabled(true); - - log.debug("--clear-----------------------------------------"); - ClearService clearService = (ClearService) factory.create(ClearService.class, clearUrl); - clearService.clear(); - storageService = (VradiStorageService) factory.create(VradiStorageService.class, storageUrl); - WikittyService wikittyService = (WikittyService) factory.create(WikittyService.class, wikittyUrl); - wikittyProxy = new WikittyProxy(wikittyService); - dataService = new VradiDataServiceImpl(config, wikittyProxy); - - // fait avec le proxy > servlet pour tester - fileService = new FileServiceProxy(fileUrl); - } - - @Override - protected XmlStreamImportResult initData(WikittyExtension extension) - throws Exception { - List<XmlFieldBinding> bindings = createXmlBindings(extension); - XmlStream xmlStream = createXmlStream(extension, bindings); - return storageService.importFormsFromXmlStream(xmlStream); - } - - /* - * TODO add doc about this test !!! - * - */ - @Test - public void testPropagation() throws Exception { - - Session session = new SessionImpl(); - - session.setNum(7); - wikittyProxy.getWikitty(session).addExtension( - new WikittyExtension("ouaf", "2.0", (String)null, - WikittyUtil.buildFieldMapExtension( - "Numeric a", - "Numeric b", - "String c"))); - session.setSessionDate(new Date()); - - session.setStatus(VradiConstants.SessionStatus.ACTIVE.getValue()); - - session = wikittyProxy.store(session); - - session.setField("ouaf", "a", 1); - session.setField("ouaf", "b", 1.0); - session.setField("ouaf", "c", "Ouaf"); - session.setNum(1); - session.setSessionDate(DateUtils.addMinutes(new Date(), 15)); - Session sessionService = wikittyProxy.store(session); - - if (session.getWikittyId().equals(sessionService.getWikittyId())) { - int scInt = wikittyProxy.getWikitty(sessionService).getFieldAsInt("ouaf", "a"); - int lcInt = wikittyProxy.getWikitty(session).getFieldAsInt("ouaf", "a"); - - Float scFloat = wikittyProxy.getWikitty(sessionService).getFieldAsFloat("ouaf", "b"); - Float lcFloat = wikittyProxy.getWikitty(session).getFieldAsFloat("ouaf", "b"); - - String scString = wikittyProxy.getWikitty(sessionService).getFieldAsString("ouaf", "c"); - String lcString = wikittyProxy.getWikitty(session).getFieldAsString("ouaf", "c"); - - log.info("testPropagation result, local : " + session.getNum() + " serveur : " + sessionService.getNum()); - log.info("testPropagation result as int, local : " + lcInt + " serveur : " + scInt); - log.info("testPropagation result as float, local : " + lcFloat + " serveur : " + scFloat); - log.info("testPropagation result as String, local : " + lcString + " serveur : " + scString); - log.info("testPropagation result, local : " + session.getSessionDate() + " serveur : " + sessionService.getSessionDate()); - - Assert.assertEquals(session.getNum(), sessionService.getNum()); - Assert.assertEquals(lcInt, scInt); - Assert.assertEquals(lcFloat, scFloat); - Assert.assertEquals(lcString, scString); - Assert.assertEquals(session.getSessionDate(), sessionService.getSessionDate()); - } - - wikittyProxy.delete(session.getWikittyId()); - } - -} Modified: trunk/vradi-services-web/src/test/java/org/chorem/vradi/services/util/ReindexService.java =================================================================== --- trunk/vradi-services-web/src/test/java/org/chorem/vradi/services/util/ReindexService.java 2011-09-22 17:32:28 UTC (rev 135) +++ trunk/vradi-services-web/src/test/java/org/chorem/vradi/services/util/ReindexService.java 2011-10-11 13:01:38 UTC (rev 136) @@ -24,10 +24,13 @@ package org.chorem.vradi.services.util; -import com.caucho.hessian.client.HessianProxyFactory; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.chorem.vradi.VradiServiceConfiguration; import org.chorem.vradi.entities.Thesaurus; +import org.chorem.vradi.services.VradiServiceFactory; +import org.chorem.vradi.services.VradiStorageService; +import org.nuiton.util.ApplicationConfig; import org.nuiton.util.StringUtil; import org.nuiton.wikitty.WikittyProxy; import org.nuiton.wikitty.WikittyService; @@ -57,13 +60,13 @@ public static void main(String... args) throws MalformedURLException { - HessianProxyFactory factory = new HessianProxyFactory(); - factory.setHessian2Request(true); - factory.setOverloadEnabled(true); + ApplicationConfig config = VradiServiceConfiguration.getConfig(); + VradiStorageService vradiStorageService = VradiServiceFactory.getVradiServiceStorage(config); - WikittyService wikittyService = (WikittyService) factory.create(WikittyService.class, wikittyUrl); - WikittyProxy wikittyProxy = new WikittyProxy(wikittyService); + WikittyService wikittyService = VradiServiceFactory.getWikittyService(vradiStorageService); + WikittyProxy wikittyProxy = VradiServiceFactory.getProxy(wikittyService); + //synEngin(wikittyProxy); //deleteObseleteThesaurus(wikittyProxy); } Modified: trunk/vradi-swing/pom.xml =================================================================== --- trunk/vradi-swing/pom.xml 2011-09-22 17:32:28 UTC (rev 135) +++ trunk/vradi-swing/pom.xml 2011-10-11 13:01:38 UTC (rev 136) @@ -86,12 +86,6 @@ </dependency> <dependency> - <groupId>org.nuiton.wikitty</groupId> - <artifactId>wikitty-hessian-client</artifactId> - <scope>runtime</scope> - </dependency> - - <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </dependency> @@ -112,11 +106,6 @@ </dependency> <dependency> - <groupId>com.caucho</groupId> - <artifactId>hessian</artifactId> - </dependency> - - <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-webapp</artifactId> <scope>runtime</scope> Modified: trunk/vradi-swing/src/main/java/org/chorem/vradi/services/VradiService.java =================================================================== --- trunk/vradi-swing/src/main/java/org/chorem/vradi/services/VradiService.java 2011-09-22 17:32:28 UTC (rev 135) +++ trunk/vradi-swing/src/main/java/org/chorem/vradi/services/VradiService.java 2011-10-11 13:01:38 UTC (rev 136) @@ -65,7 +65,7 @@ vradiStorageService = VradiServiceFactory.getVradiServiceStorage(configuration); - wikittyService = VradiServiceFactory.getWikittyService(configuration); + wikittyService = VradiServiceFactory.getWikittyService(vradiStorageService); fileService = VradiServiceFactory.getFileService(configuration); Modified: trunk/vradi-web/pom.xml =================================================================== --- trunk/vradi-web/pom.xml 2011-09-22 17:32:28 UTC (rev 135) +++ trunk/vradi-web/pom.xml 2011-10-11 13:01:38 UTC (rev 136) @@ -70,6 +70,11 @@ </dependency> <dependency> + <groupId>org.nuiton.web</groupId> + <artifactId>nuiton-struts2</artifactId> + </dependency> + + <dependency> <groupId>org.nuiton.wikitty</groupId> <artifactId>wikitty-api</artifactId> </dependency> @@ -189,12 +194,6 @@ </dependency> <dependency> - <groupId>org.nuiton.wikitty</groupId> - <artifactId>wikitty-hessian-client</artifactId> - <scope>runtime</scope> - </dependency> - - <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <scope>runtime</scope> Modified: trunk/vradi-web/src/main/java/org/chorem/vradi/VradiProxy.java =================================================================== --- trunk/vradi-web/src/main/java/org/chorem/vradi/VradiProxy.java 2011-09-22 17:32:28 UTC (rev 135) +++ trunk/vradi-web/src/main/java/org/chorem/vradi/VradiProxy.java 2011-10-11 13:01:38 UTC (rev 136) @@ -4,6 +4,8 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.vradi.entities.Attachment; +import org.chorem.vradi.services.VradiServiceFactory; +import org.chorem.vradi.services.VradiStorageService; import org.nuiton.util.ApplicationConfig; import org.nuiton.wikitty.WikittyProxy; import org.nuiton.wikitty.WikittyService; @@ -56,7 +58,8 @@ if (ws == null) { synchronized(VradiProxy.class) { if (ws == null) { - ws = WikittyServiceFactory.buildWikittyService(config); + VradiStorageService vradiServiceStorage = VradiServiceFactory.getVradiServiceStorage(config); + ws = VradiServiceFactory.getWikittyService(vradiServiceStorage); } } } Modified: trunk/vradi-web/src/main/resources/struts.xml =================================================================== --- trunk/vradi-web/src/main/resources/struts.xml 2011-09-22 17:32:28 UTC (rev 135) +++ trunk/vradi-web/src/main/resources/struts.xml 2011-10-11 13:01:38 UTC (rev 136) @@ -4,6 +4,11 @@ "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> + + <bean class="org.nuiton.web.struts2.I18nTextProvider" name="i18nTextProvider" + type="com.opensymphony.xwork2.TextProvider" /> + <constant name="struts.xworkTextProvider" value="i18nTextProvider" /> + <constant name="struts.enable.SlashesInActionNames" value="true"/> <constant name="struts.ognl.allowStaticMethodAccess" value="true"/>