Skip to content

Commit

Permalink
Added philippemerle's FraSCAti wrapper for Nuxeo
Browse files Browse the repository at this point in the history
  • Loading branch information
mkalam-alami committed Jul 28, 2011
1 parent aab393e commit 920cabb
Show file tree
Hide file tree
Showing 7 changed files with 299 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugins/easysoa-frascati-nuxeo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# FraSCAti wrapper for Nuxeo

This bundle is an experiment at trying to launch FraSCAti by wrapping it in a Nuxeo bundle.
Currently by for the demo, but could later be used to improve the EasySOA packaging.
132 changes: 132 additions & 0 deletions plugins/easysoa-frascati-nuxeo/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
<?xml version="1.0"?>
<!--
* EasySOA: OW2 FraSCAti in Nuxeo
*
* Copyright (c) 2011 INRIA, University of Lille 1
*
* This library 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 2 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* Contact: frascati@ow2.org
*
* Author: Philippe Merle
*
* Contributor(s):
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.easysoa</groupId>
<artifactId>easysoa-model-demo-parent</artifactId>
<version>0.1.2-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
<artifactId>easysoa-frascati-nuxeo</artifactId>
<name>EasySOA: OW2 FraSCAti in Nuxeo</name>

<dependencies>
<!-- Nuxeo Core API. -->
<dependency>
<groupId>org.nuxeo.ecm.core</groupId>
<artifactId>nuxeo-core-api</artifactId>
<scope>compile</scope>
</dependency>

<!-- Minimal OW2 FraSCAti + JDT. -->
<dependency>
<groupId>org.ow2.frascati</groupId>
<artifactId>frascati-runtime-factory</artifactId>
<version>1.4</version>
<scope>compile</scope>
</dependency>
<!-- Force to use the following JDT else an older is used. -->
<dependency>
<groupId>org.eclipse.jdt</groupId>
<artifactId>core</artifactId>
<version>3.3.0.771</version>
<scope>compile</scope>
</dependency>

<!-- Here other OW2 FraSCAti plugins could be added. -->
<!-- List available at http://frascati.ow2.org/doc/1.4/ch12s03.html -->

<!-- For test framework -->
<dependency>
<groupId>org.ow2.frascati.examples</groupId>
<artifactId>helloworld-pojo</artifactId>
<version>1.4</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<type>jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.nuxeo.ecm.core</groupId>
<artifactId>nuxeo-core-test</artifactId>
<type>jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.nuxeo.runtime</groupId>
<artifactId>nuxeo-runtime-test</artifactId>
<scope>test</scope>
</dependency>
<!-- TODO eclipse m2 -->
</dependencies>

<build>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-nuxeo-plugin
</artifactId>
<versionRange>
[1.0.14,)
</versionRange>
<goals>
<goal>eclipse-version</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/**
* EasySOA: OW2 FraSCAti in Nuxeo
* Copyright (C) 2011 INRIA, University of Lille 1
*
* This library 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 2 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* Contact: frascati@ow2.org
*
* Author: Philippe Merle
*
* Contributor(s):
*
*/
package org.easysoa.frascati.nuxeo;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuxeo.runtime.model.ComponentName;
import org.nuxeo.runtime.model.DefaultComponent;

import org.ow2.frascati.FraSCAti;
import org.ow2.frascati.util.FrascatiException;

public class FraSCAtiService extends DefaultComponent
{
public static final ComponentName NAME = new ComponentName(
"org.easysoa.frascati.nuxeo.FraSCAtiServiceComponent");

private static final Log log = LogFactory.getLog(FraSCAtiService.class);

private FraSCAti frascati;

public FraSCAtiService() throws FrascatiException
{
// Instantiate OW2 FraSCAti.
frascati = FraSCAti.newFraSCAti();
}

/**
* Get an SCA composite.
* @param composite the composite to get.
* @return the composite.
*/
public Object getComposite(String composite) throws FrascatiException
{
return frascati.getComposite(composite);
}

//
// Here add other methods according to your needs.
//
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: Philippe Merle
Build-Jdk: 1.6.0_24
Bundle-ManifestVersion: 1
Bundle-Version: 0.0.1
Bundle-Name: easysoa-frascati-nuxeo
Bundle-SymbolicName: org.easysoa.frascati.nuxeo;singleton:=true
Bundle-Vendor: INRIA
Nuxeo-Require: org.nuxeo.ecm.core.api,
org.nuxeo.ecm.core
Nuxeo-Component: OSGI-INF/frascati-service.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<component name="org.easysoa.frascati.nuxeo">

<implementation class="org.easysoa.frascati.nuxeo.FraSCAtiService" />

<service>
<provide interface="org.easysoa.frascati.nuxeo.FraSCAtiService" />
</service>

</component>
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/**
* EasySOA: OW2 FraSCAti in Nuxeo
* Copyright (C) 2011 INRIA, University of Lille 1
*
* This library 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 2 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* Contact: frascati@ow2.org
*
* Author: Philippe Merle
*
* Contributor(s):
*
*/

package org.easysoa.frascati.nuxeo;

import static org.junit.Assert.assertNotNull;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.nuxeo.runtime.test.runner.FeaturesRunner;

import com.google.inject.Inject;

/**
* Tests FraSCAti service.
* @author Philippe Merle - INRIA
*
*/

@RunWith(FeaturesRunner.class)
public class FraSCAtiServiceTest
{

static final Log log = LogFactory.getLog(FraSCAtiServiceTest.class);

@Inject FraSCAtiService frascatiService;

@Before
public void setUp() throws Exception
{
assertNotNull("Cannot get FraSCAti service component", frascatiService);
}

/**
* Test load SCA composite
* @throws Exception
*/
@Test
public void testGetComposite() throws Exception
{
frascatiService.getComposite("helloworld-pojo");
}

}
4 changes: 4 additions & 0 deletions plugins/nuxeo-ecm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Fake parent POM for EasySOA bundles

This project is only used for Eclipse Indigo users, in order to solve M2E errors that may happen while developing on Nuxeo.
Use it by keeping this project open in your workspace, so that the other EasySOA bundles consider this POM as the parent (you might have to update the other projects' configurations/dependencies)

0 comments on commit 920cabb

Please sign in to comment.