WebLab FAQ

From WebLab Wiki
Jump to navigationJump to search

If your question is not answered here, then please ask for help in our [user@weblab-project.org mailing list].

Licensing model

What is the licence of the WebLab platform?

WebLab is distributed under the terms of the GNU LESSER GENERAL PUBLIC LICENSE or simply LGPL version 2.1 (as provided on the source repository).

It's open source but you still have mention of copyrights, isn't it a problem?

Not really. The copyright are just telling you who are the original author of the code. That's fully compatible with LGPL 2.1.

Are the tools used open source too?

The tools proposed in the WebLab (namely Apche Tomcat as an application server, Liferay as a web portal and either PEtALS as an ESB with Orchestra as a BPEL orchestrator or Apache Karaf as an OSGi container and Apache Camel as a routing and mediation engine) are indeed open source under their own licensing models. However these are just the recommended ones and you are free to use others that are compatible with the standards that we use (more information in technical pages). On top of that, we are using a lot of third party libraries, their licences are mentioned on a dedicated Wiki page WebLab_Third_Party_Licenses.

What about the components: are they all open sources?

Not all of them are. You can find the ones provided by the WebLab team on the source repository which are all under LGPL 2.1 too. Some of the components are developed during research Projects or for specific use of customers, either by the Core WebLab team, namely the CEA and Airbus Defence and Space, or by partners on these projects. In most of the cases these specific components stays in closed sources and remains the property of their coders. This is fully compliant with the terms of the LGPL that let you create and sell your own software based on LGPL libraries.

Is it mandatory to provide all new WebLab components as open source?

Among the multiple research projects in which the WebLab has been used, more than 100 services and or user interface component have been develop by our partners. However only them are the right person to decide whether they want to open their source or not. And it's the same for any new component.

Technical

How can I create WebLab Resources, Video, Annotation, Document?

You can use WebLab Factory, from the WebLab Model Extended project.

How can I annotate a WebLab Resource using my ontology?

The use of the WebLab Model Annotator to annotate Resource is really encourage. It provides easy means to read and write RDF based on common known ontologies.

    DublinCoreAnnotator dca = new DublinCoreAnnotator(document);
    //Set the title
    dca.writeTitle("My New Document");

You can also use the RDF Helpers that allow more control on RDF selection and writing. But this will be less and less maintained. You'd to focus on the Annotator instead.

    PoKHelper helper = new JenaPoKHelper(pok);
    // Set the creator
    helper.createLitStat(pok.getUri(), DublinCore.CREATOR_PROPERTY_NAME, "John Smith");

Can I get an Annotator from my ontology?

Yes you can ! See Annotator generation from an ontology.

Annotator and Helpers

The rational for the annotators creation is to simplify the process of adding and retrieving properties on WebLab resources. For example, WebLab users deserve an easy way to set and get title on a document.

For a long lime we had to use helper this way:

	// we create a WebLab Document
	Document document = WebLabResourceFactory.createResource("example_factory", "exampledoc", Document.class);

	// we create an annotation on the WebLab Document
	Annotation metadata = WebLabResourceFactory.createAndLinkAnnotation(document);

	// we create a helper to manage annotation
	PoKHelper metadataHelper = new JenaPoKHelper(metadata);

	// we write a rdf statement in the annotation
	metadataHelper.createLitStat(doc.getUri(), "http://purl.org/dc/elements/1.1/title","My New Document");

But we really encourage the use of the annotator which simplify the code and its maintenance:

	// we create a WebLab Document
	Document document = WebLabResourceFactory.createResource("example_factory", "exampledoc", Document.class);

	// we create a DublinCore annotator
	DublinCoreAnnotator annotator = new DublinCoreAnnotator(document);
		
	// we set the title
	annotator.writeTitle("My New Document");

How must I throw a Soap Fault inside a Web Service?

In Java, SoapFault are mapped automatically to Java Exceptions, so it seems to be easy to throw a correct SoapFault, but be careful:

  • the SoapFault detail element is not automatically generated
  • the SoapFault detail element is used to map the SoapFault to the correct exception type

So when you thow an exception in Java always use this (it's an EmpyQueueException, but it's true for any SoapFault mapped exception):

	throw new EmptyQueueException("Server error", "Detailed error");

and not

	throw new EmptyQueueException("Server error");

because it will generate (with no detail):

	 <soap:Fault>
           <faultcode>soap:Server</faultcode>
           <faultstring>Server error</faultstring>
         </soap:Fault>

instead of:

	 <soap:Fault>
           <faultcode>soap:Server</faultcode>
           <faultstring>Server error</faultstring>
           <detail>
             <ns5:emptyQueueMessage xsi:nil="true" xmlns:ns5="http://weblab.ow2.org/core/1.2/services/exception" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Detailed error</ns5:emptyQueueMessage>
           </detail>
         </soap:Fault>


In the extended package we also provide a factory for exception that can be used to ease the creation of the exceptions with typing twice the error message.

	throw ExceptionFactory.createEmptyQueueException("Server error");

Maven

Do I have to build the WebLab Core from sources to use the WebLab Model in my application?

No, we provide WebLab Core artifacts and packages available in various repositories:

To access WebLab repositories, you can add the following lines in your settings.xml:

 
<repository>
	<id>WebLab OW2 repository</id>
	<url>http://maven.ow2.org/maven2/</url>
	<releases>
		<enabled>true</enabled>
	</releases>
	<snapshots>
		<enabled>false</enabled>
	</snapshots>
</repository>
<repository>
	<id>WebLab OW2 Snapshot repository</id>
	<url>http://maven.ow2.org/maven2-snapshot/</url>
	<releases>
		<enabled>false</enabled>
	</releases>
	<snapshots>
		<enabled>true</enabled>
	</snapshots>
</repository> 
<repository>
	<id>WebLab repository</id>
	<url>http://maven.weblab-project.org/</url>
	<releases>
		<enabled>true</enabled>
	</releases>
	<snapshots>
		<enabled>false</enabled>
	</snapshots>
</repository> 
<repository>
	<id>WebLab SNAPSHOT repository</id>
	<url>http://maven-snapshot.weblab-project.org/</url>
	<releases>
		<enabled>false</enabled>
	</releases>
	<snapshots>
		<enabled>true</enabled>
	</snapshots>
</repository>

When compiling WebLab Exchange Model, why do I get an error?

When compiling WebLab sources, you can encounter the following error:

org.codehaus.classworlds.NoSuchRealmException: plexus.core
	at org.codehaus.classworlds.ClassWorld.getRealm(ClassWorld.java:128)
	at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:434)
	at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

This error appears when you try to generate Java classes from the WebLab Exchange Model. This process is a little bit memory consuming. To avoid this problem, you could allow a bigger PermSize for the JVM:

With your favorite terminal:

user@machine$ export MAVEN_OPTS=-XX:MaxPermSize=1024m

With your Windows prompt:

C:> SET MAVEN_OPTS=-XX:MaxPermSize=1024m

Liferay

Why results are not shown when I search for a document in the WebLab demonstration?

If you installed the WebLab demonstration with our own Liferay, then by default it uses a cache that could disturb some portlets. Indeed, the result portlet make heavy use of JavaScript (Ajax) and serveResource (from JSR) to dynamically fetch results. Thus sometime Liferay could send a page in cache instead of calling the serveResource method.

There is a solution: to disable cache within Liferay. To do this, you have to add some options in the properties file that defines root configurations:

liferay-portal-x.x.x/tomcat-x.x.x/webapps/ROOT/WEB-INF/classes/portal-ext.properties

#Developer options
theme.css.fast.load=false
theme.images.fast.load=false

javascript.fast.load=false
javascript.log.enabled=true

layout.template.cache.enabled=false

last.modified.check=false

velocity.engine.resource.manager.cache.enabled=false

com.liferay.portal.servlet.filters.cache.CacheFilter=false

Why portlets do not correctly work with my own Liferay installation?

WebLab portlets make heavy use of jQuery. Since version 6 of Liferay, jQuery is not installed with the default portal. If you do not use Liferay provided with the WebLab Bundle, WebLab portlets javascript script will not be able to execute.


To install jQuery in your own portal, please refers to your portal documentation: