You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@clerezza.apache.org by Reto Bachmann-Gmür <re...@apache.org> on 2012/12/19 18:12:11 UTC

Stanbol components in clerezza, check it out

Hello

I've just resolved CLEREZZA-722 meaning that stanbol web fragments can now
be run inside clerezza. The main difficulties was that many STANBOL
components do not use the OSGi service infrastructure but communicate to
each other via the ServletContext.

Give it a try. To launch the Stanbol Factore in clerezza enter (copy and
paste) the following to the clerezza console:

start("mvn:org.apache.stanbol/org.apache.stanbol.commons.web.home/0.10.0-SNAPSHOT")
import java.net._
val url = new URL("
https://svn.apache.org/repos/asf/stanbol/trunk/launchers/bundlelists/factstore/src/main/bundles/list.xml
")
val conn = url.openConnection
import xml._
val doc = XML.load(conn.getInputStream)
for (b <- doc\"startLevel"\"bundle") {
val groupId = (b\"groupId").text;
val artifactId = (b\"artifactId").text;
val version = (b\"version").text
val mvnUri = "mvn:"+groupId+"/"+artifactId+"/"+version;
println(mvnUri);
try {
val bundle = bundleContext.installBundle(mvnUri)
bundle.start()
} catch {
case ex => out.println("Exception installing bundle", ex)
}


You should now see the factstore on http://localhost:8080/factstore.

Cheers,
Reto

Re: Stanbol components in clerezza, check it out

Posted by Tommaso Teofili <to...@gmail.com>.
that's cool, thanks Reto :-)

Tommaso


2012/12/20 Reto Bachmann-Gmür <re...@apache.org>

> If you want to play with more popular stanbol components than the facstore,
> copy and paste the following to your shell:
>
> import java.net._
> import org.osgi.framework.Bundle
> def loadBundleList(uriString: String) {
> val url = new URL(uriString)
> val conn = url.openConnection
> import xml._
> val doc = XML.load(conn.getInputStream)
> (for (b <- doc\"startLevel"\"bundle";
> groupId = (b\"groupId").text;
> artifactId = (b\"artifactId").text.replace("\n","").replace(" ","");
> version = (b\"version").text;
> mvnUri = "mvn:"+groupId+"/"+artifactId+"/"+version;
> if (!groupId.startsWith("com.sun.jersey") &&
> !artifactId.contains("base.jersey"))) yield {
> println("start(\""+mvnUri+"\")");
> try {
> bundleContext.installBundle(mvnUri)
> } catch {
> case ex => out.println("Exception installing bundle", ex);
> null.asInstanceOf[Bundle];
> }
> }).withFilter(_ != null).foreach(_.start)
> }
>
> loadBundleList("
>
> https://svn.apache.org/repos/asf/stanbol/trunk/launchers/bundlelists/stanbolcommons/src/main/bundles/list.xml
> ")
> loadBundleList("
>
> https://svn.apache.org/repos/asf/stanbol/trunk/launchers/bundlelists/entityhub/src/main/bundles/list.xml
> ")
> loadBundleList("
>
> https://svn.apache.org/repos/asf/stanbol/trunk/launchers/bundlelists/enhancer/src/main/bundles/list.xml
> ")
>
> With that you should have a resource ast http://localhost:8080/enhancerand
> one at http://localhost:8080/entityhub
>
> Cheers,
> Reto
>
>
> On Wed, Dec 19, 2012 at 6:12 PM, Reto Bachmann-Gmür <re...@apache.org>
> wrote:
>
> > Hello
> >
> > I've just resolved CLEREZZA-722 meaning that stanbol web fragments can
> now
> > be run inside clerezza. The main difficulties was that many STANBOL
> > components do not use the OSGi service infrastructure but communicate to
> > each other via the ServletContext.
> >
> > Give it a try. To launch the Stanbol Factore in clerezza enter (copy and
> > paste) the following to the clerezza console:
> >
> >
> >
> start("mvn:org.apache.stanbol/org.apache.stanbol.commons.web.home/0.10.0-SNAPSHOT")
> > import java.net._
> > val url = new URL("
> >
> https://svn.apache.org/repos/asf/stanbol/trunk/launchers/bundlelists/factstore/src/main/bundles/list.xml
> > ")
> > val conn = url.openConnection
> > import xml._
> > val doc = XML.load(conn.getInputStream)
> > for (b <- doc\"startLevel"\"bundle") {
> > val groupId = (b\"groupId").text;
> > val artifactId = (b\"artifactId").text;
> > val version = (b\"version").text
> > val mvnUri = "mvn:"+groupId+"/"+artifactId+"/"+version;
> > println(mvnUri);
> > try {
> > val bundle = bundleContext.installBundle(mvnUri)
> > bundle.start()
> > } catch {
> > case ex => out.println("Exception installing bundle", ex)
> > }
> >
> >
> > You should now see the factstore on http://localhost:8080/factstore.
> >
> > Cheers,
> > Reto
> >
> >
>

Re: Stanbol components in clerezza, check it out

Posted by Reto Bachmann-Gmür <re...@apache.org>.
If you want to play with more popular stanbol components than the facstore,
copy and paste the following to your shell:

import java.net._
import org.osgi.framework.Bundle
def loadBundleList(uriString: String) {
val url = new URL(uriString)
val conn = url.openConnection
import xml._
val doc = XML.load(conn.getInputStream)
(for (b <- doc\"startLevel"\"bundle";
groupId = (b\"groupId").text;
artifactId = (b\"artifactId").text.replace("\n","").replace(" ","");
version = (b\"version").text;
mvnUri = "mvn:"+groupId+"/"+artifactId+"/"+version;
if (!groupId.startsWith("com.sun.jersey") &&
!artifactId.contains("base.jersey"))) yield {
println("start(\""+mvnUri+"\")");
try {
bundleContext.installBundle(mvnUri)
} catch {
case ex => out.println("Exception installing bundle", ex);
null.asInstanceOf[Bundle];
}
}).withFilter(_ != null).foreach(_.start)
}

loadBundleList("
https://svn.apache.org/repos/asf/stanbol/trunk/launchers/bundlelists/stanbolcommons/src/main/bundles/list.xml
")
loadBundleList("
https://svn.apache.org/repos/asf/stanbol/trunk/launchers/bundlelists/entityhub/src/main/bundles/list.xml
")
loadBundleList("
https://svn.apache.org/repos/asf/stanbol/trunk/launchers/bundlelists/enhancer/src/main/bundles/list.xml
")

With that you should have a resource ast http://localhost:8080/enhancer and
one at http://localhost:8080/entityhub

Cheers,
Reto


On Wed, Dec 19, 2012 at 6:12 PM, Reto Bachmann-Gmür <re...@apache.org> wrote:

> Hello
>
> I've just resolved CLEREZZA-722 meaning that stanbol web fragments can now
> be run inside clerezza. The main difficulties was that many STANBOL
> components do not use the OSGi service infrastructure but communicate to
> each other via the ServletContext.
>
> Give it a try. To launch the Stanbol Factore in clerezza enter (copy and
> paste) the following to the clerezza console:
>
>
> start("mvn:org.apache.stanbol/org.apache.stanbol.commons.web.home/0.10.0-SNAPSHOT")
> import java.net._
> val url = new URL("
> https://svn.apache.org/repos/asf/stanbol/trunk/launchers/bundlelists/factstore/src/main/bundles/list.xml
> ")
> val conn = url.openConnection
> import xml._
> val doc = XML.load(conn.getInputStream)
> for (b <- doc\"startLevel"\"bundle") {
> val groupId = (b\"groupId").text;
> val artifactId = (b\"artifactId").text;
> val version = (b\"version").text
> val mvnUri = "mvn:"+groupId+"/"+artifactId+"/"+version;
> println(mvnUri);
> try {
> val bundle = bundleContext.installBundle(mvnUri)
> bundle.start()
> } catch {
> case ex => out.println("Exception installing bundle", ex)
> }
>
>
> You should now see the factstore on http://localhost:8080/factstore.
>
> Cheers,
> Reto
>
>