View source | View content page | Page history | Printable version   
Toolbox
Main Page
Upload file
What links here
Recent changes
Help

PDF Books
Show collection (0 pages)
Collections help

Search

Projects:Modularity/Central Repository

Contents

Central Repository Services

Overview

The Central Repository is a system embedded in the Openbravo Forge to provide services related to Openbravo Modules for developers and users.

To decouple the Openbravo Forge development and the Modularity project services are designed to be operated from Openbravo ERP or from the Forge. The first group of services are architected as web services provided by the Central Repository –so the Forge- and consumed by Openbravo ERP components that are responsible to provide a user interface for them. The second group are services provided directly by the Forge without any dependency on Openbravo ERP.

Services provided by the Central Repository (there is a detailed description in the next section):


CentralRepository.svg


The integration between Openbravo Forge and the Central Repository is very light:

Detailed description for services to Developers

Services for Developers need to be secured since through them developers will administer their modules. This security need to be managed by the Forge through its standard capabilities (single sign-on, privileges, developers in a project, etc.). So developers need to be registered in the Openbravo Forge to use these services.


Register a module

A developer creates a new module in its Openbravo ERP instance and from the Module Window requests to register it. The request includes some module information. The Central Repository validates the information. If it is ok then it stores the information in the DB and returns a success message confirming the registration that will be managed by the Module Window to be shown to the developer. If it's wrong returns a failure message with a clear explanation of the error and suggestions on how to proceed.

Information provided in the request:

Validation before performing the registration:

If the validation fails the Service returns an error message with a clear explanation of the error and suggestions on how to solve it (eg. Similar package name or DB_prefix that are not registered yet).

Actions if the validation is successful:

Example of declaration of web service in Java:

public Module moduleRegister(Module module, String userName, String password);

WSDL technical detail:

<complexType name="Module">
 <sequence>
   <element name="author" nillable="true" type="xsd:string"/>
   <element name="dbPrefix" nillable="true" type="xsd:string"/>
   <element name="dependencies" nillable="true" type="impl:ArrayOf_tns1_ModuleDependency"/>
   <element name="description" nillable="true" type="xsd:string"/>
   <element name="help" nillable="true" type="xsd:string"/>
   <element name="includes" nillable="true" type="impl:ArrayOf_tns1_ModuleDependency"/>
   <element name="licenseAgreement" nillable="true" type="xsd:string"/>
   <element name="licenseType" nillable="true" type="xsd:string"/>
   <element name="moduleID" nillable="true" type="xsd:string"/>
   <element name="moduleVersionID" nillable="true" type="xsd:string"/>
   <element name="name" nillable="true" type="xsd:string"/>
   <element name="packageName" nillable="true" type="xsd:string"/>
   <element name="type" nillable="true" type="xsd:string"/>
   <element name="updateDescription" nillable="true" type="xsd:string"/>
   <element name="url" nillable="true" type="xsd:string"/>
   <element name="versionNo" nillable="true" type="xsd:string"/>
 </sequence>
</complexType>
<wsdl:message name="moduleRegisterResponse">
  <wsdl:part name="moduleRegisterReturn" type="tns1:Module"/>
</wsdl:message>
<wsdl:message name="moduleRegisterRequest">
  <wsdl:part name="in0" type="tns1:Module"/>
  <wsdl:part name="in1" type="soapenc:string"/>
  <wsdl:part name="in2" type="soapenc:string"/>
</wsdl:message>
<wsdl:operation name="moduleRegister" parameterOrder="in0 in1 in2">
  <wsdl:input message="impl:moduleRegisterRequest" name="moduleRegisterRequest"/>
  <wsdl:output message="impl:moduleRegisterResponse" name="moduleRegisterResponse"/>
</wsdl:operation>
<wsdl:operation name="moduleRegister">
  <wsdlsoap:operation soapAction=""/>
  <wsdl:input name="moduleRegisterRequest">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://services.ws.erpCommon.openbravo.org" use="encoded"/>
  </wsdl:input>
  <wsdl:output name="moduleRegisterResponse">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://67.202.45.105/openbravo/services/WebService" use="encoded"/>
  </wsdl:output>
</wsdl:operation>

Publish a new version of a module

This service is fully provided through the standard process of publishing files in the Openbravo Forge. A developer logged in the Forge requests to publish a new version of a module he/she is allowed to publish versions. The request includes the .obx file for that module-version that has been generated from an utility in Openbravo ERP. The Central Repository reads the file and validates the information. If it is ok then it stores the information in the DB and returns a success message confirming the new version has been published. If it is wrong returns a failure message with a clear explanation of the error and suggestions on how to proceed.

Information provided in the request (included in the .obx file):

Updateable information in a module might change from time to time. To keep consistent information when a new version is created all these fields are copied into it. When a new version is published the module is updated with the information in the latest version. So this information is also provided in the process of publishing a new version:

Validation before performing the publishing:

If the validation fails the Service returns an error message with a clear explanation of the error and suggestions on how to solve it (eg. You can not change the dependencies in a minor release).

Actions if the validation is successful:

Update information of a version of a module

This service is fully provided through the Openbravo Forge. A logged in the Forge developer requests to publish a new version of a module he/she is allowed to modify. The request includes the .obx file for that module-version that has been generated from an utility in Openbravo ERP. The only information he/she can change is to extend the compatibility of version in modules it depends on. The request includes information of the version included in the .obx file. The Central Repository validates the information. If it is ok then it stores the information in the DB and returns a success message confirming the version has been updated. If it is wrong returns a failure message with a clear explanation of the error and suggestions on how to proceed.

Information provided in the request:

Validation before performing the update:

If the validation fails the Service returns an error message with a clear explanation of the error and suggestions on how to solve it (eg. The dependency you want to extend does not exist in the current version).

Actions if the validation is successful:

Detailed description for services to Users

Services to Users do not need to be secured since it is public information (perhaps in the future it will be required for modules in the AppExchange). All these services have to be implemented as web services and they are not directly operated by the User but by the Module Manager Console (MMC) in Openbravo ERP. These services should support multi-language (TBD) so information in the MMC is shown in the language of the user or English if not available.

Search for Modules

From the MMC in Openbravo ERP a user queries the Central Repository with a filtering criteria and a list of installed modules. The Central Repository executes that query in its database and returns a list of light module-version objects that match the criteria less the installed modules. The MMC gets the list of objects and shows them to the user.

Information provided in the request:

The service gets this value and performs a query in its database to get the last version of all modules in the Central Repository where their description contains the word (text) in the request.

A light module-version object includes the next attributes:


Example of declaration of web service in Java:

public SimpleModule[] moduleSearch(String word, String[] exclude);

WSDL technical detail:

<complexType name="SimpleModule">
  <sequence>
    <element name="author" nillable="true" type="xsd:string"/>
    <element name="description" nillable="true" type="xsd:string"/>
    <element name="help" nillable="true" type="xsd:string"/>
    <element name="licenseAgreement" nillable="true" type="xsd:string"/>
    <element name="licenseType" nillable="true" type="xsd:string"/>
    <element name="moduleID" nillable="true" type="xsd:string"/>
    <element name="moduleVersionID" nillable="true" type="xsd:string"/>
    <element name="name" nillable="true" type="xsd:string"/>
    <element name="type" nillable="true" type="xsd:string"/>
    <element name="updateDescription" nillable="true" type="xsd:string"/>
    <element name="url" nillable="true" type="xsd:string"/>
    <element name="versionNo" nillable="true" type="xsd:string"/>
  </sequence>
</complexType>
<complexType name="ArrayOf_tns1_SimpleModule">
  <complexContent>
    <restriction base="soapenc:Array">
      <attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:SimpleModule[]"/>
    </restriction>
  </complexContent>
</complexType>
<wsdl:message name="moduleSearchResponse">
  <wsdl:part name="moduleSearchReturn" type="impl:ArrayOf_tns1_SimpleModule"/>
</wsdl:message>
<wsdl:message name="moduleSearchRequest">
  <wsdl:part name="in0" type="soapenc:string"/>
  <wsdl:part name="in1" type="impl:ArrayOf_xsd_string"/>
</wsdl:message>
<wsdl:operation name="moduleSearch" parameterOrder="in0 in1">
  <wsdl:input message="impl:moduleSearchRequest" name="moduleSearchRequest"/>
  <wsdl:output message="impl:moduleSearchResponse" name="moduleSearchResponse"/>
</wsdl:operation>
<wsdl:operation name="moduleSearch">
  <wsdlsoap:operation soapAction=""/>
  <wsdl:input name="moduleSearchRequest">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://services.ws.erpCommon.openbravo.org" use="encoded"/>
  </wsdl:input>
  <wsdl:output name="moduleSearchResponse">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://67.202.45.105/openbravo/services/WebService" use="encoded"/>
  </wsdl:output>
</wsdl:operation>

Detailed information of a Version

From the MMC in Openbravo ERP a user requests detailed information of a specific version he/she is interested in. The Central Repository executes a query in its database and returns a full module-version object. The MMC gets the object and shows it to the user.

Information provided in the request:

The service gets this value and performs a query in its database to get all the information related to that module-version.

A full module-version object includes the next attributes:

A module-dependency object includes the next attributes:

Example of declaration of web service in Java:

public Module moduleDetail(String moduleVersionID)

WSDL technical detail:

<complexType name="ModuleDependency">
  <sequence>
    <element name="moduleID" nillable="true" type="xsd:string"/>
    <element name="moduleName" nillable="true" type="xsd:string"/>
    <element name="moduleVersionDependencyID" nillable="true" type="xsd:string"/>
    <element name="moduleVersionID" nillable="true" type="xsd:string"/>
    <element name="versionEnd" nillable="true" type="xsd:string"/>
    <element name="versionStart" nillable="true" type="xsd:string"/>
  </sequence>
</complexType>
<complexType name="Module">
  <sequence>
    <element name="author" nillable="true" type="xsd:string"/>
    <element name="dbPrefix" nillable="true" type="xsd:string"/>
    <element name="dependencies" nillable="true" type="impl:ArrayOf_tns1_ModuleDependency"/>
    <element name="description" nillable="true" type="xsd:string"/>
    <element name="help" nillable="true" type="xsd:string"/>
    <element name="includes" nillable="true" type="impl:ArrayOf_tns1_ModuleDependency"/>
    <element name="licenseAgreement" nillable="true" type="xsd:string"/>
    <element name="licenseType" nillable="true" type="xsd:string"/>
    <element name="moduleID" nillable="true" type="xsd:string"/>
    <element name="moduleVersionID" nillable="true" type="xsd:string"/>
    <element name="name" nillable="true" type="xsd:string"/>
    <element name="packageName" nillable="true" type="xsd:string"/>
    <element name="type" nillable="true" type="xsd:string"/>
    <element name="updateDescription" nillable="true" type="xsd:string"/>
    <element name="url" nillable="true" type="xsd:string"/>
    <element name="versionNo" nillable="true" type="xsd:string"/>
  </sequence>
</complexType>
<wsdl:message name="moduleDetailRequest">
  <wsdl:part name="in0" type="soapenc:string"/>
</wsdl:message>
<wsdl:message name="moduleDetailResponse">
  <wsdl:part name="moduleDetailReturn" type="tns1:Module"/>
</wsdl:message>
<wsdl:operation name="moduleDetail" parameterOrder="in0">
  <wsdl:input message="impl:moduleDetailRequest" name="moduleDetailRequest"/>
  <wsdl:output message="impl:moduleDetailResponse" name="moduleDetailResponse"/>
</wsdl:operation>
<wsdl:operation name="moduleDetail">
  <wsdlsoap:operation soapAction=""/>
  <wsdl:input name="moduleDetailRequest">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://services.ws.erpCommon.openbravo.org" use="encoded"/>
  </wsdl:input>
  <wsdl:output name="moduleDetailResponse">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://67.202.45.105/openbravo/services/WebService" use="encoded"/>
  </wsdl:output>
</wsdl:operation>

Get the code of a Module - Version

From the MMC in Openbravo ERP a user requests to install a module-version he/she has previously found. The Central Repository returns the XOB file for that module-version. The MMC gets the file and installs it into the user instance.

Information provided in the request:

The service returns the XOB file for that ModuleVersionID.

Example of declaration of web service in Java:

public byte[] getModule(String moduleVersionID)

WSDL technical detail:

<wsdl:message name="getModuleRequest">
  <wsdl:part name="in0" type="soapenc:string"/>
</wsdl:message>
<wsdl:message name="getModuleResponse">
  <wsdl:part name="getModuleReturn" type="soapenc:base64Binary"/>
</wsdl:message>
<wsdl:operation name="getModule" parameterOrder="in0">
  <wsdl:input message="impl:getModuleRequest" name="getModuleRequest"/>
  <wsdl:output message="impl:getModuleResponse" name="getModuleResponse"/>
</wsdl:operation>
<wsdl:operation name="getModule">
  <wsdlsoap:operation soapAction=""/>
  <wsdl:input name="getModuleRequest">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://services.ws.erpCommon.openbravo.org" use="encoded"/>
  </wsdl:input>
  <wsdl:output name="getModuleResponse">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://67.202.45.105/openbravo/services/WebService" use="encoded"/>
  </wsdl:output>
</wsdl:operation>

Scan for Updates

From the MMC in Openbravo ERP a user requests for available updates for some (one, many, all) the modules he/she has installed in his/her instance. The Central Repository executes a query in its database and returns a list of light module-version objects that are newer versions of the module-versions provided. All the modules version contained in the list of updates will be compatible with themselves and with installed modules version, this means that all the modules version returned in list of updates can be installed without any problem of dependencies. The MMC gets the list of objects and shows them to the user.

Information provided in the request:

The service gets this list and performs a query in its database to get the newest version for each of them, if any

Example of declaration of web service in Java:

public SimpleModule[] moduleScanForUpdates(HashMap<String,String> moduleIdInstalledModules);

WSDL technical detail:

<complexType name="SimpleModule">
  <sequence>
    <element name="author" nillable="true" type="xsd:string"/>
    <element name="description" nillable="true" type="xsd:string"/>
    <element name="help" nillable="true" type="xsd:string"/>
    <element name="licenseAgreement" nillable="true" type="xsd:string"/>
    <element name="licenseType" nillable="true" type="xsd:string"/>
    <element name="moduleID" nillable="true" type="xsd:string"/>
    <element name="moduleVersionID" nillable="true" type="xsd:string"/>
    <element name="name" nillable="true" type="xsd:string"/>
    <element name="type" nillable="true" type="xsd:string"/>
    <element name="updateDescription" nillable="true" type="xsd:string"/>
    <element name="url" nillable="true" type="xsd:string"/>
    <element name="versionNo" nillable="true" type="xsd:string"/>
  </sequence>
</complexType>
<wsdl:message name="moduleScanForUpdatesRequest">
  <wsdl:part name="in0" type="apachesoap:Map"/>
</wsdl:message>
<wsdl:message name="moduleScanForUpdatesResponse">
  <wsdl:part name="moduleScanForUpdatesReturn" type="impl:ArrayOf_tns1_SimpleModule"/>
</wsdl:message>
<wsdl:operation name="moduleScanForUpdates" parameterOrder="in0">
  <wsdl:input message="impl:moduleScanForUpdatesRequest" name="moduleScanForUpdatesRequest"/>
  <wsdl:output message="impl:moduleScanForUpdatesResponse" name="moduleScanForUpdatesResponse"/>
</wsdl:operation>
<wsdl:operation name="moduleScanForUpdates">
  <wsdlsoap:operation soapAction=""/>
  <wsdl:input name="moduleScanForUpdatesRequest">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://services.ws.erpCommon.openbravo.org" use="encoded"/>
  </wsdl:input>
  <wsdl:output name="moduleScanForUpdatesResponse">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://67.202.45.105/openbravo/services/WebService" use="encoded"/>
  </wsdl:output>
</wsdl:operation>

Check Consistency

From the MMC in Openbravo ERP a user requests for checking the consistency of a set of new modules to install and/or update in his/her particular instance, taking into account the modules that the instance has installed. The Central Repository executes a query in its database and checks all the dependencies and includes of modules installed in the client, new modules to install and modules to update. There might be more than one combination of module-versions that meets all dependencies and includes. In that case the Central Repository executes an algorithm to find the most "updated" combination: one combination is more "updated" than other when it includes newer versions for higher priority modules (priority is first core, then Industry Templates, then packs and last plain modules) or it includes more updated versions for equal priority modules.

The Central Repository returns an object including an array of full module-version objects to install, an array of full module-version objects to update, an array of user messages for eventual errors because of broken dependencies, and a boolean to know if a valid configuration have been found. With the information returned, the MMC can do a get of all the module-versions to install/update them or return a user message explaining why he/she can not install/update those modules.

Information provided in the request:

The service gets those lists and process all the data to return a ModuleInstallDetail, which contains:

Example of declaration of web service in Java:

public ModuleInstallDetail checkConsistency(HashMap<String,String> versionIdInstalled, String[] versionIdToInstall, String[] versionIdToUpdate);

WSDL technical detail:

<complexType name="ModuleDependency">
  <sequence>
    <element name="moduleID" nillable="true" type="xsd:string"/>
    <element name="moduleName" nillable="true" type="xsd:string"/>
    <element name="moduleVersionDependencyID" nillable="true" type="xsd:string"/>
    <element name="moduleVersionID" nillable="true" type="xsd:string"/>
    <element name="versionEnd" nillable="true" type="xsd:string"/>
    <element name="versionStart" nillable="true" type="xsd:string"/>
  </sequence>
</complexType>
<complexType name="Module">
  <sequence>
    <element name="author" nillable="true" type="xsd:string"/>
    <element name="dbPrefix" nillable="true" type="xsd:string"/>
    <element name="dependencies" nillable="true" type="impl:ArrayOf_tns1_ModuleDependency"/>
    <element name="description" nillable="true" type="xsd:string"/>
    <element name="help" nillable="true" type="xsd:string"/>
    <element name="includes" nillable="true" type="impl:ArrayOf_tns1_ModuleDependency"/>
    <element name="licenseAgreement" nillable="true" type="xsd:string"/>
    <element name="licenseType" nillable="true" type="xsd:string"/>
    <element name="moduleID" nillable="true" type="xsd:string"/>
    <element name="moduleVersionID" nillable="true" type="xsd:string"/>
    <element name="name" nillable="true" type="xsd:string"/>
    <element name="packageName" nillable="true" type="xsd:string"/>
    <element name="type" nillable="true" type="xsd:string"/>
    <element name="updateDescription" nillable="true" type="xsd:string"/>
    <element name="url" nillable="true" type="xsd:string"/>
    <element name="versionNo" nillable="true" type="xsd:string"/>
  </sequence>
</complexType>
<complexType name="ModuleInstallDetail">
  <sequence>
    <element name="dependencyErrors" nillable="true" type="impl:ArrayOf_xsd_string"/>
    <element name="modulesToInstall" nillable="true" type="impl:ArrayOf_tns1_Module"/>
    <element name="modulesToUpdate" nillable="true" type="impl:ArrayOf_tns1_Module"/>
    <element name="validConfiguration" type="xsd:boolean"/>
  </sequence>
</complexType>
<wsdl:message name="checkConsistencyResponse">
  <wsdl:part name="checkConsistencyReturn" type="tns1:ModuleInstallDetail"/>
</wsdl:message>
<wsdl:message name="checkConsistencyRequest">
  <wsdl:part name="in0" type="apachesoap:Map"/>
  <wsdl:part name="in1" type="impl:ArrayOf_xsd_string"/>
  <wsdl:part name="in2" type="impl:ArrayOf_xsd_string"/>
</wsdl:message>
<wsdl:operation name="checkConsistency" parameterOrder="in0 in1 in2">
  <wsdl:input message="impl:checkConsistencyRequest" name="checkConsistencyRequest"/>
  <wsdl:output message="impl:checkConsistencyResponse" name="checkConsistencyResponse"/>
</wsdl:operation>
<wsdl:operation name="checkConsistency">
  <wsdlsoap:operation soapAction=""/>
  <wsdl:input name="checkConsistencyRequest">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://services.ws.erpCommon.openbravo.org" use="encoded"/>
  </wsdl:input>
  <wsdl:output name="checkConsistencyResponse">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://67.202.45.105/openbravo/services/WebService" use="encoded"/>
  </wsdl:output>
</wsdl:operation>

Closed Discussion Items

ICI: how to implement support for multi-language in modularity? It seems that the search for modules service should show module information (name, description, help) in the language of the user if available, but it would be odd that when installing the same information is shown in English (because the .obx does not include the translations). Other problem is that modules for translations to other languages other than English are modules and need to be declared in English (so they need a translation but in a different module?). So perhaps translations for a module (at least module information) should be included in the .obx file, although it is also a problem because it should be done by a different team from the one who developed the module) -> It is solved because modules are defined in a native language. For further details go to Translation Modules spec.

Retrieved from "http://wiki.openbravo.com/wiki/Projects:Modularity/Central_Repository"

This page has been accessed 9,186 times. This page was last modified on 8 June 2012, at 05:28. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.