You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Google Summer of Code

Summary

The aim of this page is to describe my work during the Google Summer of Code project on Fedora Repository. I have divided this page into x subcategories depending on into which part of "project's life cycle" it belongs. I have created the topic branch for this purpose in Git and all my changes are available from https://github.com/Jiri-Kremser/fcrepo/tree/fcrepo-452.



Changes to the build process

This section describes the changes within the build process scope such a dependencies and code generation from the WSDL files.

Dependencies

CXF can be attached by Maven to the fcrepo project in several ways:

1. two (three with embedded Jetty) Maven artifacts

<dependency>
  <groupId>org.apache.cxf</groupId>
  <artifactId>cxf-rt-frontend-jaxws</artifactId>
  <version>${cxf.version}</version>
</dependency>

<dependency>
  <groupId>org.apache.cxf</groupId>
  <artifactId>cxf-rt-transports-http</artifactId>
  <version>${cxf.version}</version>
</dependency>

<!-- Jetty is needed if you're using the CXFServlet -->
<dependency>
  <groupId>org.apache.cxf</groupId>
  <artifactId>cxf-rt-transports-http-jetty</artifactId>
  <version>${cxf.version}</version>
</dependency>

2. one Maven artifact with bundled CXF

<dependency>
  <groupId>org.apache.cxf</groupId>
  <artifactId>cxf-bundle</artifactId>
  <version>${cxf.version}</version>
  <exclusions>
    <exclusion>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
    </exclusion>
  </exclusions>
</dependency>

3. one Maven artifact with "minimal-bundled" CXF

<dependency>
  <groupId>org.apache.cxf</groupId>
  <artifactId>cxf-bundle-minimal</artifactId>
  <exclusions>
    <exclusion>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
    </exclusion>
  </exclusions>
  <version>${cxf.version}</version>
</dependency>

All the artifact are available in the Maven Central. Dependencies should be transitively distributed throughout the fcrepo project, but sometimes I had to add them again.

I have used the second variant, because it seems to be the simplest one, but if you find the size of the jar file of the CXF to be high, you can go with 1 or 3.

Because the CXF uses internally the Spring framework, I had to attach the Spring jars to the installed fedora client ($FEDORA_HOME/client) see Fedora home directory

WSDL to Java code generation

Since the Fedora follow the contract-first method, the SEIs (Service Endpoint Interfaces) have to be generated from the attached WSDLs as well as classes for types defined in the XML Schema attached to the WSDLs. WSDL file define a contract by means of XML language meanwhile SEI and type classes are annotated POJOs in Java doing the same thing. This process is done four times: API-A, API-A-MTOM, API-M, API-M-MTOM.

The old WS stack (Axis 1.3) used the org.codehaus.mojo:axistools-maven-plugin Maven plugin and my solution uses the org.apache.cxf:cxf-codegen-plugin as it was proposed on the homepage of the CXF, but the more general wsimport plugin for maven can be used as well (com.sun.xml.ws:jaxws-rt see http://mojo.codehaus.org/jaxws-maven-plugin/usage.html)

Here is the maven pom file with the "wsdl2java" configuration. I have removed all the references and tasks related to axis, but I am not sure whether the "cleaning" is still needed, so I have only commented the old plugin definition in the pom.

When generating the SEIs, the default package is taken from the WSDLs targetNamespace. Hence, there has to be said, that another package should be taken. This is done in the bindings directory. For the generated types (xmls with the "JAX-B" prefix) and for the SEIs (xmls with the "JAX-WS" prefix). These xml binding files are configured in the pom.

Changes to the installation process

The purpose of the Maven module fcrepo-installer is to install the repository and deploy it to the bundled tomcat. During this phase the $FEDORA_HOME directory is created and some config and other files are copied there. In this phase the Spring application configs are also modified depending on the values in the installation config, which is passed to the installation jar file as a parameter.

Fedora home directory

Because the CXF needs Spring in the runtime, I had to copy the spring jars, and of course the other jars which CXF needs, into the client/lib directory. This is done in fedora-home.xml config. In the same file the new (MTOMized) WSDLs are marked for copying.

The scripts for running the Swing client are copied to Fedora home directory. Unfortunately, the CFX bundled jar cannot be simply copied into the $FEDORA_HOME/client/lib whose content is all linked to the installation jar by the java.endorsed.dirs JVM param. It needs to be directly on classpath by using the -cp JVM option, therefore I have introduced the new variable in this config and its value is then written in the bash/bat script.

If the name of the CXF jar bundle is changed (it is imo not likely) or Fedora start to use dependency system as I proposed in 1 or 2, the value in this config has to be changed in order to allow the Swing client to run.

Changes to the deployment process including the Spring stuff

bla

Changes in the code

bla

WS implementations

Exceptions

fcrepo-client-admin

fcrepo-security-pep

  • No labels