Jorge Simões Nuno Martins luís marques

Tutorial

Development of extractors and converters for the TIMBUS Project.

Prequisites

===========


Deployment

Before deploying an extractor, it is necessary to have Virgo installed and running.

  • Managing applications/bundles
  • Browse to localhost:8080 (or another port if you have configured so before). You should now see the Virgo splash screen:
    virgo-main-screen
  • To manage applications/bundles, go to "Admin Console" (on the top-right corner of the Virgo splash screen)
    • (the default authentication is: user "admin" and password "springsource")
  • Applications are deployed in the "Artifacts" tab and displayed under the "bundle" tree node

  • Deploying Extractors and Context Populators:

  • Deploy the bundles Extractors Core and Converters Core first:
    • Download the extractors you wish to deploy, the extractors
    • On the Virgo admin console, select "Deployer", select .war files and hit Deploy.
      virgo-deploying

Development

To develop an extractor/converter, it is necessary to do the following steps.

  • Download the timbus-simple-bundle-archetype.tar.gz.
  • Extract the contents of the tar unto the local directory.
  • Go to extracted folder.
  • Inside this folder there should be a file called pom.xml.
  • Open a terminal and run this command: mvn install.

When the command is finished, the archtype should be installed in your local maven repository.

To create a project from the installed archtype, run the following command:
mvn archetype:generate -DarchetypeArtifactId=simple-bundle-archetype -DarchetypeGroupId=net.timbusproject.archetypes -DinteractiveMode=true -Darchetypeversion=1.0-SNAPSHOT

This command will guide you through the project's building by asking the following properties:

  • groupId : where the project belongs
  • artifactId : project's name
  • version : project's version
  • package : source directory

An example of a successful build
build

At the end it will ask you to confirm the project's properties
confirm

If those are the desired properities then press Enter to confirm.

Your project structure should look like this

.
├── META-INF
│   └── MANIFEST.MF
├── pom.xml
└── src
    └── main
        ├── java
        │   └── net
        │       └── timbusproject
        │           └── extractors
        │               └── modules
        │                   └── newextractor
        │                      └── Test.java
        └── resources
            └── META-INF
                └── spring
                    ├── bundle-context-osgi.xml
                    └── bundle-context.xml

POM.xml

In the file pom.xml go to the dependencies section, uncomment either one if you wish to develop an extractor or a converter:

      <!--Uncomment this if you're developing a converter-->
         <dependency>
             <groupId>net.timbusproject.populator</groupId>
             <artifactId>converters-core</artifactId>
            <version>1.0.0-RELEASE</version>
            <scope>provided</scope>
        </dependency>

:::xml
-->

net.timbusproject.extractors
extractors-core
1.0.0-RELEASE
provided

:::

Attachments
virgo-splash.png (78875 bytes)
virgo-deployer.png (47625 bytes)