SourceForge.net Logo

<< New features in openCRX v2.3 >>


REST Servlet

The openCRX REST servlet allows easy 3rd party integration with openCRX. The full functionality of the openCRX API can be accessed via REST requests, i.e. you can use openCRX as a REST Service. See http://code.google.com/p/rest-client/ for a REST client. Below are some sample requests:

Object creation:

Method:
POST
URL:
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account
Body:
<?xml version="1.0"?>
<org.opencrx.kernel.account1.Contact>
  <lastName>REST</lastName>
  <firstName>Test #1</firstName>
</org.opencrx.kernel.account1.Contact>

Object retrievals:

Method:
GET
URLs:
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/extent?position=0&size=50&queryType=org:opencrx:kernel:account1:Contact&query=identity().like(%22xri://@openmdx*org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/%25%22);orderByFirstName().ascending()
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account?position=0&size=50&queryType=org:opencrx:kernel:account1:Contact&query=modifiedAt().between(:datetime:20080101T000000.000Z,:datetime:20081001T000000.000Z);orderByFirstName().ascending()
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account?position=0&size=50&queryType=org:opencrx:kernel:account1:Contact&query=modifiedAt().greaterThan(:datetime:20080101T000000.000Z);orderByFirstName().ascending()
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account?position=0&size=50&queryType=org:opencrx:kernel:account1:Contact&query=thereExistsModifiedAt().greaterThan(:date:2008-01-01);orderByFirstName().ascending()
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account?position=0&size=50&queryType=org:opencrx:kernel:account1:Contact&query=thereExistsNumberOfChildren().greaterThan(:integer:-1);orderByFirstName().ascending()
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account?position=0&size=50&queryType=org:opencrx:kernel:account1:Contact&query=thereExistsNumberOfChildren().lessThan(0);orderByFirstName().ascending()
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account?position=0&size=50&queryType=org:opencrx:kernel:account1:Contact&query=thereExistsNumberOfChildren().lessThan(3);orderByFirstName().ascending()
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account?position=0&size=50&queryType=org:opencrx:kernel:account1:Contact&query=thereExistsFullName().like(%22D%25,%20Joe%22);orderByFirstName().ascending()
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account?position=0&size=50&queryType=org:opencrx:kernel:account1:Contact&query=thereExistsFirstName().elementOf(%22Joe%22,%20%22Guest%22);orderByFirstName().ascending()
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account?position=0&size=50&queryType=org:opencrx:kernel:account1:Contact&query=thereExistsFirstName().equalTo(%22Guest%22);orderByLastName().ascending()
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account?position=0&size=50&queryType=org:opencrx:kernel:account1:Contact&query=thereExistsFirstName().equalTo(%22Guest%22)

Object modification:

Method:
PUT
URL:
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/2YlAOJYlEd2Y4zv65ePspg
Body:
<?xml version="1.0"?>
<org.opencrx.kernel.account1.Contact>
  <preferredContactMethod>1</preferredContactMethod>
  <preferredSpokenLanguage>1</preferredSpokenLanguage>
</org.opencrx.kernel.account1.Contact>

Object deletion:

Method:
DELETE
URL:
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/2YlAOJYlEd2Y4zv65ePspg

Operation invocation:

Method:
POST
URL:
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.home1/provider/CRX/segment/Standard/userHome/guest/sendAlert
Body:
<?xml version="1.0"?>
<org.opencrx.kernel.base.SendAlertParams>
  <toUsers>guest</toUsers>
  <name>Test REST</name>
  <importance>0</importance>
</org.opencrx.kernel.base.SendAlertParams>

 

Glitch in openCRX v2.4 with REST servlet

Unfortunately, there is a glitch in openCRX v2.4.0 that prevents the REST servlet from working properly (NoClassDefFoundError). With the following workaround you can still get it to work, however:

  • once the openCRX EAR is expanded (start/stop Tomcat to expand it) navigate to the directory {TOMCAT_INSTALL_DIR}\apps\opencrx-core-CRX\APP-INF\lib
  • copy the file openmdx-application.jar to the directory {TOMCAT_INSTALL_DIR}\lib
  • start Tomcat - the REST servlet should now work fine

^top


DataBinding for Composite Objects

With this new feature the customizer can selectively "pull up" attributes from composite objects to the parent object for easier viewing and/or editing. For example, by specifying appropriate filters one can easily pull up selected e-mail addresses, phone numbers, etc. from the list of addresses into the contact object as shown in the screen shot below:

Even though the above customizing of openCRX contacts includes 3 e-mail addresses only (Business, Home, Other), you do not loose the feature of managing an unlimited number of addresses for each contact.

The following extract from the UI customizing file account.xml shows how the attribute "phoneNumberFull" of the class "PhoneNumber" is "pulled up" into the class "Account" by defining a DataBinding:

...
<featureDefinition>
  <org.openmdx.ui1.StructuralFeatureDefinition qualifiedName="org:opencrx:kernel:account1:Account:address*Business!phoneNumberFull">
    <_object>
      <type>org:w3c:string</type>
      <multiplicity>0..1</multiplicity>
      <changeable>true</changeable>
    </_object>
    <_content/>
  </org.openmdx.ui1.StructuralFeatureDefinition>
</featureDefinition>
...
...
<elementDefinition>
  <org.openmdx.ui1.ElementDefinition name="org:opencrx:kernel:account1:Account:address*Business!phoneNumberFull">
    <_object>
      <dataBindingName>org.openmdx.portal.servlet.databinding.CompositeObjectDataBinding?type=org:opencrx:kernel:account1:PhoneNumber;disabled=(boolean)false;[isMain=(boolean)true];usage=(short)500;automaticParsing=(boolean)true</dataBindingName>
      <active>true</active>
      <toolTip>
        <_item>Phone business</_item>
      </toolTip>
      <label>
        <_item>Phone business</_item>
      </label>
      <order>
        <_item>0</_item>
        <_item>0</_item>
        <_item>80</_item>
      </order>
    </_object>
    <_content/>
  </org.openmdx.ui1.ElementDefinition>
</elementDefinition>
...

The above element definition contains an object filter as follows:

  • disabled=(boolean)false: PhoneNumber must not be disabled
  • [isMain=(boolean)true]: PhoneNumber's attribute isMain is set to true on commits
  • usage=(short)500: PhoneNumber's usage includes 500 (= Business)
  • automaticParsing=(boolean)true: PhoneNumber's attribute automaticParsing is set to true

^top


UI Perspectives

UI perspectives enable you to provide several different and highly customized views on the same object within the same openCRX application. With UI perspectives you can adapt views on objects to the needs of your various user groups, e.g. a front-office view on contacts and a back-office view on contacts. All of this is possible within the same web application. The following example shows a simplified view on contacts where a lot of the extra information that is rarely used has been stripped away (compare this view to the full view as it is shown in this screen shot above):

openCRX supports an unlimited number of perspectives so that you can cater to all of your various departments' needs.

^top


Wizard Monthly Work Report

This wizard enables you to produce monthly work reports filtered by various aspects like period, project, resource, priority, etc. In addition to a calendar-like overview of all involved activities the wizard also produces a clickable list of all filtered work reports:

^top


Wizard Mail Merge

This wizard enables you to produce RTF mail merges (serial letters, labels, etc.) from various data sources:

  • Address Filters
  • Address Groups
  • Account Groups
  • Account

Depending on the number of merged documents you get either a single RTF document or a ZIP file containing a collection of RTF documents which you can download:

^top


Support for JBoss 5 Application Server

^top

http://www.crixp.com/ http://www.openmdx.org/