Commit 5cd07e06 authored by Arnaud Saval's avatar Arnaud Saval
Browse files

WEBLAB-1000 use stable version of portlet and update processing chain logging with more information

git-svn-id: svn://svn.forge.objectweb.org/svnroot/weblab/trunk/WebLabApplications/bundle@3490 a803c184-d8de-4a0e-a52b-d3eef88212b6
parent 0e8590ca
......@@ -105,6 +105,16 @@
<source>conf/liferay/portal-ext.properties</source>
<outputDirectory>${liferay.tomcat.path}/webapps/ROOT/WEB-INF/classes/</outputDirectory>
</file>
<file>
<!-- update env config for linux/mac -->
<source>conf/liferay/setenv.sh</source>
<outputDirectory>${liferay.tomcat.path}/bin/</outputDirectory>
</file>
<file>
<!-- update env config for windows -->
<source>conf/liferay/setenv.bat</source>
<outputDirectory>${liferay.tomcat.path}/bin/</outputDirectory>
</file>
<file>
<!-- Copy sa in the Petals install dir -->
<source>chain/target/sa-weblab-chain-distribution.zip</source>
......@@ -137,6 +147,11 @@
<exclude>${liferay.path}/data/hsql/lportal.properties</exclude>
<exclude>${liferay.path}/data/lucene/</exclude>
<exclude>${liferay.path}/data/jackrabbit/</exclude>
<!-- Disable default env -->
<exclude>${liferay.tomcat.path}/bin/setenv.sh</exclude>
<exclude>${liferay.tomcat.path}/bin/setenv.bat</exclude>
<!-- Custom template -->
<exclude>${liferay.tomcat.path}/webapps/ROOT/html/common/themes/top_js-ext.jspf</exclude>
<exclude>${liferay.tomcat.path}/webapps/ROOT/html/themes/classic/css/main.css</exclude>
......
......@@ -191,6 +191,11 @@ public class Chain {
UnsupportedRequestException, InvalidParameterException {
return resource;
}
@Override
public void setCanFail(boolean canFail) {
// Do nothing
}
}
}
......@@ -42,4 +42,6 @@ public interface Chainable {
public Resource execute(final Resource resource, final String usageContext, final Logger logger) throws ContentNotAvailableException, UnexpectedException, EmptyQueueException, InsufficientResourcesException, AccessDeniedException, ServiceNotConfiguredException, UnsupportedRequestException, InvalidParameterException;
public void setCanFail(boolean canFail);
}
......@@ -71,4 +71,10 @@ public class Sequence implements Chainable{
return currentResource;
}
@Override
public void setCanFail(boolean canFail) {
for(Chainable chainable:services){
chainable.setCanFail(canFail);
}
}
}
......@@ -81,6 +81,12 @@ public class Service implements Chainable{
public WebLabService getWebLabService(){
return this.service;
}
@Override
public void setCanFail(boolean canFail) {
service.setCanFail(canFail);
}
/**
* init Services
* @param logger a logger
......
......@@ -61,6 +61,8 @@ public class Split implements Chainable{
public void init(Logger logger, ComponentContext ctx) throws Exception {
for(Chainable service:services){
service.init(logger, ctx);
// services in a split may fail
service.setCanFail(true);
}
}
......@@ -73,7 +75,7 @@ public class Split implements Chainable{
Resource currentResource = resource;
final Resource splitResource = resource;
logger.info("Running split...");
/*
* create the runnable managers and launch both thread
*/
......@@ -104,8 +106,10 @@ public class Split implements Chainable{
results.add(runnable.getFinalResource());
}
logger.info("Starting merge");
ResourcesMerger rm = ResourcesMerger.getInstance();
currentResource = rm.merge(splitResource, results);
logger.info("Merge done");
return currentResource;
}
......@@ -142,4 +146,11 @@ public class Split implements Chainable{
}
};
}
@Override
public void setCanFail(boolean canFail) {
for(Chainable chainable:services){
chainable.setCanFail(canFail);
}
}
}
......@@ -50,11 +50,19 @@ public abstract class WebLabService{
// allows to enable or disable a service
protected boolean enabled = true;
// allows the service to be disabled if it fails too much
private boolean canFail;
public WebLabService(String serviceNs, String serviceName) {
this.serviceName = "{"+serviceNs+"}"+serviceName;
this.canFail = false;
}
public void setCanFail(boolean canFail){
this.canFail = canFail;
}
public boolean isEnabled() {
return enabled;
}
......@@ -97,7 +105,7 @@ public abstract class WebLabService{
// reset failed counter.
this.failed = 0;
}finally{
if (result == resource && result != null){
if (canFail && result == resource && result != null){
// increment the "service does nothing"
this.failed++;
......
<thtml>
<body>
To expose data using WebLab, you can either add wayback machine or configure content-manager to expose content in WebDAV.
</body>
</thtml>
\ No newline at end of file
if exist "%CATALINA_HOME%/jre1.6.0_20/win" (
if not "%JAVA_HOME%" == "" (
set JAVA_HOME=
)
set "JRE_HOME=%CATALINA_HOME%/jre1.6.0_20/win"
)
set "JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding=UTF8 -Djava.net.preferIPv4Stack=true -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false -Duser.timezone=GMT "
JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF8 -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false -Duser.timezone=GMT "
......@@ -85,8 +85,8 @@
</constructor-arg>
</bean>
<!-- This will split a resource through several analyser and merge results -->
<bean id="split" class="org.ow2.weblab.bundle.server.Split">
<!-- This will split a resource through several analyzer and merge results -->
<bean id="split-analysers" class="org.ow2.weblab.bundle.server.Split">
<property name="services">
<set>
<ref bean="gazetteer-extractor"/>
......@@ -95,7 +95,7 @@
</property>
</bean>
<!-- This will process a resource a list of analyser in the given order -->
<!-- This will process a resource a list of analyzer in the given order -->
<bean id="gate-sequence" class="org.ow2.weblab.bundle.server.Sequence">
<property name="services">
<list>
......@@ -105,10 +105,21 @@
</property>
</bean>
<!-- All analyzers in sequence -->
<bean id="full-sequence" class="org.ow2.weblab.bundle.server.Sequence">
<property name="services">
<list>
<ref bean="gazetteer-extractor"/>
<ref bean="ngramj-extractor"/>
<ref bean="gate-extractor"/>
</list>
</property>
</bean>
<bean id="files" class="org.ow2.weblab.bundle.server.Chain">
<property name="queuemanager"><ref bean="folder-listener"/></property>
<property name="normalizers"><ref bean="tika-extractor"/></property>
<property name="analysers"><ref bean="split"/></property>
<property name="analysers"><ref bean="full-sequence"/></property>
<property name="repositories"><ref bean="simple-repository"/></property>
<property name="indexers"><ref bean="solr-indexer"/></property>
</bean>
......@@ -116,7 +127,7 @@
<bean id="warcs" class="org.ow2.weblab.bundle.server.Chain">
<property name="queuemanager"><ref bean="warc-listener"/></property>
<property name="normalizers"><ref bean="tika-extractor"/></property>
<property name="analysers"><ref bean="split"/></property>
<property name="analysers"><ref bean="split-analysers"/></property>
<property name="repositories"><ref bean="simple-repository"/></property>
<property name="indexers"><ref bean="solr-indexer"/></property>
</bean>
......
......@@ -153,7 +153,7 @@
<property name="defaultUsageContext" value="" />
<property name="oneShotCrawler" value="false" />
<property name="exposedAsPrefix" value="http://localhost:8080/wayback/" />
<property name="exposedAsPrefix" value="http://localhost:8181/exposed-configuration/exposed-data.html?" />
<property name="acceptedContentTypePattern" value="(.*html.*)|(.*postscript.*)|(.*octet-stream.*)|(.*excel.*)|(.*powerpoint.*)|(.*word.*)|(.*pdf.*)|(.*opendocument.*)|(.*star.*)" />
<property name="acceptedMessagePattern" value="(.*response.*)" />
<property name="acceptedHeaders" value=".*HTTP\S*\s*2\d{2}.*" />
......
......@@ -37,12 +37,12 @@
<version>${weblab.annotator.version}</version>
<type>jar</type>
</dependency>
<dependency>
<!-- <dependency>
<groupId>org.ow2.weblab.portlets</groupId>
<artifactId>weblab-portlet</artifactId>
<version>${weblab.weblab-portlet.version}</version>
<type>jar</type>
</dependency>
</dependency> -->
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
......
......@@ -228,7 +228,8 @@ public final class Constants {
/**
* Liferay JAVA_OPTS options
*/
public static final String LIFERAY_OPTS = " -Dweblab.client.url=http://localhost:8181/exposed-configuration/weblab-client.xml " +
public static final String LIFERAY_OPTS = " -Xmx1024m -XX:MaxPermSize=512m " +
" -Dweblab.client.url=http://localhost:8181/exposed-configuration/weblab-client.xml " +
" -Dweblab.portlet.filter.url=http://localhost:8181/exposed-configuration/weblab-portlet-filters.xml ";
/**
......
......@@ -395,7 +395,7 @@ public class ServerManager {
logger.log(Level.SEVERE, exception.getMessage(),exception);
}
logger.info("Tomcat servers splitting done.\nPlease update: \n\t=>registry.xml and \n\t=> weblab-client.xml \naccording to changes you made and reset Petals.");
logger.info("Tomcat servers splitting done.\nPlease update: \n\t=> registry.xml \n\t=> weblab-client.xml \n\t=> solr-engine cxf if you change solr position \naccording to changes you made and reset Petals.");
}
......
......@@ -69,11 +69,11 @@
<service.solr.version>4.2.1</service.solr.version>
<!-- Portlets versions -->
<portlet.launch-chain-portlet.version>1.6.1-SNAPSHOT</portlet.launch-chain-portlet.version>
<portlet.launch-chain-portlet.version>1.6.1</portlet.launch-chain-portlet.version>
<portlet.result-portlet.version>2.0.0-SNAPSHOT</portlet.result-portlet.version>
<portlet.document-viewer-portlet.version>1.7.0</portlet.document-viewer-portlet.version>
<portlet.search-portlet.version>1.6.1-SNAPSHOT</portlet.search-portlet.version>
<portlet.metadata-portlet.version>2.0.0-SNAPSHOT</portlet.metadata-portlet.version>
<portlet.metadata-portlet.version>2.0.0</portlet.metadata-portlet.version>
<portlet.facet-portlet.version>1.6.1-SNAPSHOT</portlet.facet-portlet.version>
<!-- Liferay common libraries -->
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment