How to use the REST Servlet
This guide explains how to use the REST servlet. The REST servlet allows SOA-based integration of openCRX with 3rd party systems. The REST servlet gives access to the full API of openCRX, i.e. objects can be created, retrieved, updated and deleted. In addition, operations can be invoked on objects.
This guide assumes that you have
- A running openCRX instance
- A REST client such as RestClient
- Access to the openCRX JavaDoc and UML diagrams.
This guide explains how to
Known Bugs
The REST servlet delivered with openMDX 2.4.1 has some known bugs. Download the improved version Sdk24.RestServlet.java and apply the fix as follows:
- Download and install openMDX SDK 2.4.1. For more information see here.
- Replace RestServlet?.java in directory openmdxSdk-2.4.1/openmdx-2.4.1/core/src/java/org/openmdx/application/rest.
- Open a shell, cd to openmdxSdk-2.4.1/openmdx-2.4.1/core and run ant deliverables
- The resulting openmdx-base.jar located in openmdxSdk-2.4.1/openmdx-2.4.1/jre-1.5/core/lib contains the fixed RestServlet?.class.
- Replace openmdx-base.jar located in the Tomcat lib directory, e.g. apache-tomcat-6.0.18/lib
Object retrievals
Objects which are stored in openCRX can be retrieved as follows:
- Using the Standard GUI navigate to the object that you want to retrieve.
- Select the tab System. Copy the object's XRI (e.g. xri://@openmdx*org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN).
- In the REST client setup a GET request. As URL first take http://localhost:8080/opencrx-rest-CRX/ as prefix and then append the object's XRI from step 2). Make sure to remove the prefix xri:@openmdx* from XRI.
- Execute the GET request. The REST servlet requires basic authentication. Make sure to provide a valid user name and password.
An object retrieval returns all attributes of an object which have a non-null value.
Here is an example:
URL
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN
Method
GET
Response Body
<?xml version="1.0"?>
<org.opencrx.kernel.account1.Contact id="LFTRDS1LY08NYYAHJHLYC75EN" href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN">
<salutation><![CDATA[Mr.]]></salutation>
<education>0</education>
<firstName><![CDATA[Joe]]></firstName>
<accessLevelUpdate>2</accessLevelUpdate>
<owningUser href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.User">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.User</owningUser>
<accessGrantedByParent href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard">
xri://@openmdx*org.opencrx.kernel.account1/provider/CRX/segment/Standard</accessGrantedByParent>
<preferredSpokenLanguage>0</preferredSpokenLanguage>
<accessLevelBrowse>3</accessLevelBrowse>
<fullName><![CDATA[Doe, Joe]]></fullName>
<preferredWrittenLanguage>0</preferredWrittenLanguage>
<familyStatus>0</familyStatus>
<lastName><![CDATA[Doe]]></lastName>
<vcard><![CDATA[BEGIN:VCARD
VERSION:2.1
UID:9ce8c860-3ece-11de-bea3-1b11ed87fb1f
REV:20090512T132858Z
N:Doe;Joe;;Mr.;
FN:Joe Doe
END:VCARD
]]></vcard>
<gender>0</gender>
<owner>
<_item><![CDATA[Standard:Administrators]]></_item>
<_item><![CDATA[Standard:wfro.Group]]></_item>
</owner>
<salutationCode>6</salutationCode>
<accountRating>0</accountRating>
<accessLevelDelete>2</accessLevelDelete>
<modifiedBy>
<_item><![CDATA[wfro]]></_item>
</modifiedBy>
<identity><![CDATA[xri://@openmdx*org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN]]></identity>
<createdAt>20090512T082638.492Z</createdAt>
<owningGroup>
<_item href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/Administrators">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/Administrators</_item>
<_item href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.Group">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.Group</_item>
</owningGroup>
<createdBy>
<_item><![CDATA[wfro]]></_item>
</createdBy>
<accountState>0</accountState>
<preferredContactMethod>0</preferredContactMethod>
<modifiedAt>20090512T132858.568Z</modifiedAt>
</org.opencrx.kernel.account1.Contact>
Queries
Queries return a list of objects (all contacts matching a given criteria, all addresses of an account, etc.). Query requests can be constructed as follows:
- Using the Standard GUI navigate to one of the object which is in the result set. E.g. if you want to retrieve all accounts navigate to one of these accounts.
- Select the tab System. Copy the object's XRI (e.g. xri://@openmdx*org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN).
- In the REST client setup a GET request. Construct an URL with http://localhost:8080/opencrx-rest-CRX/ as prefix and then append the object's XRI from step 2). From the XRI remove the last path component. Also make sure to remove the prefix xri:@openmdx*. Given the XRI from step 2) the URL then is http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account
- Execute the GET request. It returns the first batch of accounts starting from position 0.
Here is an example:
URL
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account
Method
GET
Response Body
<?xml version="1.0"?>
<account href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account">
<query><![CDATA[filter={filterProperties=[org.openmdx.base.query.FilterProperty (THERE_EXISTS object_instanceof IS_IN [org:opencrx:kernel:account1:Account]): {
quantor = "THERE_EXISTS"
name = "object_instanceof"
operator = "IS_IN"
values = [
0: "org:opencrx:kernel:account1:Account"
]
}], attributeSpecifiers=[]}
]]></query>
<position>0</position>
<size>25</size>
<resultSet>
<org.opencrx.kernel.account1.Contact id="0075e000-0de1-11dc-9f21-130ee180d055" href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/0075e000-0de1-11dc-9f21-130ee180d055">
<salutation><![CDATA[Frau]]></salutation>
<education>0</education>
<firstName><![CDATA[Vilja]]></firstName>
<accessLevelUpdate>2</accessLevelUpdate>
<owningUser href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.User">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.User</owningUser>
<accessGrantedByParent href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard">
xri://@openmdx*org.opencrx.kernel.account1/provider/CRX/segment/Standard</accessGrantedByParent>
<preferredSpokenLanguage>138</preferredSpokenLanguage>
<accessLevelBrowse>3</accessLevelBrowse>
<fullName><![CDATA[Schirra, Vilja]]></fullName>
<doNotPhone>false</doNotPhone>
<birthdate>19311002T000000.000Z</birthdate>
<externalLink>
</externalLink>
<doNotBulkPostalMail>false</doNotBulkPostalMail>
<preferredWrittenLanguage>0</preferredWrittenLanguage>
<familyStatus>0</familyStatus>
<lastName><![CDATA[Schirra]]></lastName>
<doNotFax>false</doNotFax>
<vcard><![CDATA[BEGIN:VCARD
VERSION:2.1
UID:0075e000-0de1-11dc-9f21-130ee180d055
REV:20080522T204425Z
N:Schirra;Vilja;;Frau;
FN:Vilja Schirra
END:VCARD
]]></vcard>
<gender>2</gender>
<annualIncomeCurrency>0</annualIncomeCurrency>
<disabled>false</disabled>
<salutationCode>6</salutationCode>
<accountRating>0</accountRating>
<accessLevelDelete>2</accessLevelDelete>
<identity><![CDATA[xri://@openmdx*org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/0075e000-0de1-11dc-9f21-130ee180d055]]></identity>
<createdAt>20070529T123455.077Z</createdAt>
<doNotEMail>false</doNotEMail>
<owningGroup>
</owningGroup>
<accountState>0</accountState>
<preferredContactMethod>0</preferredContactMethod>
<doNotPostalMail>false</doNotPostalMail>
<modifiedAt>20080522T204425.790Z</modifiedAt>
</org.opencrx.kernel.account1.Contact>
<org.opencrx.kernel.account1.Contact id="01048b70-0de1-11dc-9f21-130ee180d055" href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/01048b70-0de1-11dc-9f21-130ee180d055">
<salutation><![CDATA[Herr]]></salutation>
<education>0</education>
<firstName><![CDATA[Ratko]]></firstName>
...
</resultSet>
<hasMore>true</hasMore>
</account>
The request URL supports the following properties which allow to filter, sort and iterate the result set:
- position: the result set starts from the given position. The default is 0. Increasing the position by a batch size allows to iterate the result set. hasMore=false indicates that there are no more objects to be returned.
- size: specifies the batch size. The default is 25.
- queryType: specifies the type of the objects to be returned. For example the reference XRI org.opencrx.kernel.account1/provider/CRX/segment/Standard/account returns objects which are instanceof org:opencrx:kernel:account1:Account, i.e. objects of type org:opencrx:kernel:account1:Contact, org:opencrx:kernel:account1:LegalEntity, org:opencrx:kernel:account1:UnspecifiedAccount, org:opencrx:kernel:account1:Group. Setting the queryType to org:opencrx:kernel:account1:Contact restricts the result set to objects which are instanceof org:opencrx:kernel:account1:Contact.
- query: a query which is a semicolon-separated list of query verbs. The list of verbs is specified by the methods of the query class. The name of the query class is derived from the queryType. E.g. for org:opencrx:kernel:account1:Contact the corresponding query class is org.opencrx.kernel.account1.cci2.ContactQuery?.
Here is a list of sample query URLs:
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account
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:20101001T000000.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=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(%22%25Test%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=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 modifications
Objects which are stored in openCRX can be modified as follows:
- Retrieve the object that you want to modify.
- Take the response body which contains the retrieved object as request template. Remove all attributes that you do NOT want to modify. Modify the values of the attributes that you DO want to modify.
- In the REST client prepare a PUT request. Take the request body prepared in step 2) and the URL used to retrieve the object.
- Execute the PUT request. The response contains the modified object.
Here is an example:
URL
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN
Method
PUT
Request Body
<?xml version="1.0"?> <org.opencrx.kernel.account1.Contact> <salutation>Dr.</salutation> </org.opencrx.kernel.account1.Contact>
Response Body
<?xml version="1.0"?>
<org.opencrx.kernel.account1.Contact id="LFTRDS1LY08NYYAHJHLYC75EN" href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN">
<salutation><![CDATA[Dr.]]></salutation>
<education>0</education>
<firstName><![CDATA[Joe]]></firstName>
<accessLevelUpdate>2</accessLevelUpdate>
<owningUser href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.User">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.User</owningUser>
<accessGrantedByParent href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard">
xri://@openmdx*org.opencrx.kernel.account1/provider/CRX/segment/Standard</accessGrantedByParent>
<preferredSpokenLanguage>0</preferredSpokenLanguage>
<accessLevelBrowse>3</accessLevelBrowse>
<fullName><![CDATA[Doe, Joe]]></fullName>
<preferredWrittenLanguage>0</preferredWrittenLanguage>
<familyStatus>0</familyStatus>
<lastName><![CDATA[Doe]]></lastName>
<vcard><![CDATA[BEGIN:VCARD
VERSION:2.1
UID:9ce8c860-3ece-11de-bea3-1b11ed87fb1f
REV:20090512T170858Z
N:Doe;Joe;;Dr.;
FN:Joe Doe
END:VCARD
]]></vcard>
<gender>0</gender>
<owner>
<_item><![CDATA[Standard:Administrators]]></_item>
<_item><![CDATA[Standard:wfro.Group]]></_item>
</owner>
<salutationCode>6</salutationCode>
<accountRating>0</accountRating>
<accessLevelDelete>2</accessLevelDelete>
<owningGroup>
<_item href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/Administrators">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/Administrators</_item>
<_item href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.Group">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.Group</_item>
</owningGroup>
<accountState>0</accountState>
<preferredContactMethod>0</preferredContactMethod>
</org.opencrx.kernel.account1.Contact>
Operation invocations
Requests which allow to invoke operations on objects are constructed as follows:
- First consult and try the examples below
- Using the Standard GUI navigate to an object on which you want to invoke the operation.
- Select the tab System. Copy the object's XRI (e.g. xri:@openmdx*org.opencrx.kernel.activity1/provider/CRX/segment/Standard/activityCreator/ABXRDS1LY08NYYAHJHLYC75EN).
- In the REST client setup a POST request. Construct the URL by taking http://localhost:8080/opencrx-rest-CRX/ as prefix and then append the object's XRI from step 3). Add the operation name to the XRI. Also make sure to remove the prefix xri:@openmdx*. Given the XRI from step 2) the URL then is http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.activity1/provider/CRX/segment/Standard/activityCreator/ABXRDS1LY08NYYAHJHLYC75EN/newActivity. Put the operation parameters in the request body.
- Execute the POST request. The operation result is retunred as response body.
Here are some examples:
- org.opencrx.kernel.activity1.Incident
- org.opencrx.kernel.activity1.ActivityFollowUp
- org.opencrx.kernel.home1.UserHome
org.opencrx.kernel.activity1.Incident
Incidents (which are Activities) can not be created directly. They are created by the operation newActivity which must be invoked on an ActivityCreator?.
URL Determine the XRI of an activity creator and append newActivity as operation name.
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.activity1/provider/CRX/segment/Standard/activityCreator/BugsAndFeaturesCreator/newActivity
Method
POST
Request Body The request body serves as operation parameter which is the structure type org.opencrx.kernel.activity1.NewActivityParams?. The full list of attributes of org.opencrx.kernel.activity1.NewActivityParams? is specified in JavaDoc and UML.
<?xml version="1.0"?> <org.opencrx.kernel.activity1.NewActivityParams> <name>Testing REST #1</name> <description>Testing REST servlet</description> <scheduledStart>2009-05-12T00:00:00.000Z</scheduledStart> <scheduledEnd>2009-05-31T00:00:00.000Z</scheduledEnd> <priority>2</priority> <icalType>0</icalType> </org.opencrx.kernel.activity1.NewActivityParams>
Response Body
<org.opencrx.kernel.activity1.NewActivityResult id="result" href="http://localhost:8080/opencrx-rest-CRX/R1S8G92IOJRHAOAXYQCAN3PF5">
<activity href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.activity1/provider/CRX/segment/Standard/activity/!95WOUVHCHMAXQOAXYQCAN3PF5">
xri://@openmdx*org.opencrx.kernel.activity1/provider/CRX/segment/Standard/activity/!95WOUVHCHMAXQOAXYQCAN3PF5</activity>
</org.opencrx.kernel.activity1.NewActivityResult>
org.opencrx.kernel.activity1.ActivityFollowUp?
Activity follow ups can not be created directly. They are created by the operation doFollowUp which must be invoked on an activity.
URL Take the URL of an activity and append doFollowUp as operation name.
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.activity1/provider/CRX/segment/Standard/activity/!95WOUVHCHMAXQOAXYQCAN3PF5/doFollowUp
Method
POST
Request Body The request body serves as operation parameter which is the structure type org.opencrx.kernel.activity1.ActivityDoFollowUpParams?. The full list of attributes of org.opencrx.kernel.activity1.ActivityDoFollowUpParams? is specified in JavaDoc and UML. The parameter transition be a valid transition of the activitie's activityProcess.
<?xml version="1.0"?> <org.opencrx.kernel.activity1.ActivityDoFollowUpParams> <followUpTitle>Assign to me</followUpTitle> <followUpText>Assign activity to me</followUpText> <transition>xri://@openmdx*org.opencrx.kernel.activity1/provider/CRX/segment/Standard/activityProcess/BugAndFeatureRequestProcess/transition/TransitionAssign</transition> </org.opencrx.kernel.activity1.ActivityDoFollowUpParams>
Response Body
<?xml version="1.0"?>
<org.opencrx.kernel.activity1.ActivityDoFollowUpResult id="result" href="http://localhost:8080/opencrx-rest-CRX/R1S8G94HPNTGEOAXYQCAN3PF5">
<followUp href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.activity1/provider/CRX/segment/Standard/activity/!95WOUVHCHMAXQOAXYQCAN3PF5/followUp/95WOUVLAJUEVYOAXYQCAN3PF5">
xri://@openmdx*org.opencrx.kernel.activity1/provider/CRX/segment/Standard/activity/!95WOUVHCHMAXQOAXYQCAN3PF5/followUp/95WOUVLAJUEVYOAXYQCAN3PF5</followUp>
</org.opencrx.kernel.activity1.ActivityDoFollowUpResult>
org.opencrx.kernel.home1.UserHome?
A UserHome? can not be created directly. It is created by the operation createUser which is invoked on the home1 segment.
URL Take the XRI of the home1 segment and append createUser as operation name.
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.home1/provider/CRX/segment/Standard/createUser
Method
POST
Request Body The request body serves as operation parameter which is the structure type org.opencrx.kernel.home1.CreateUserParams?. The full list of attributes of org.opencrx.kernel.home1.CreateUserParams? is specified in JavaDoc and UML.
<?xml version="1.0"?> <org.opencrx.kernel.home1.CreateUserParams> <principalName>testrest1</principalName> <contact>xri://@openmdx*org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN</contact> <primaryUserGroup>xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/Users</primaryUserGroup> <initialPassword>changeit</initialPassword> <initialPasswordVerification>changeit</initialPasswordVerification> </org.opencrx.kernel.home1.CreateUserParams>
Response Body
<?xml version="1.0"?>
<org.opencrx.kernel.home1.CreateUserResult id="result" href="http://localhost:8080/opencrx-rest-CRX/RK6T9HJNXXWWU0X1CZ46N6SXD">
<status>0</status>
<createdUserHome href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.home1/provider/CRX/segment/Standard/userHome/testrest1">
xri://@openmdx*org.opencrx.kernel.home1/provider/CRX/segment/Standard/userHome/testrest1</createdUserHome>
</org.opencrx.kernel.home1.CreateUserResult>
Object creation
Below you find a list of sample requests which allow you to create new objects. Here is a step-by-step procedure:
- First consult and try the examples below
- Using the Standard GUI create an object of the required type (e.g. org:opencrx:kernel:account1:Contact).
- Navigate to the newly created object and select the tab System. Copy the object's XRI (e.g. xri:@openmdx*org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN).
- Using the RestClient? execute a GET request with the XRI from step 3).
- Take the response body as template to construct the request body of the object creation request. Remove all fields which are read-only, derived or otherwise not needed. IMPORTANT: Consult the JavaDoc and UML for the complete list of object attributes.
- Create a REST request with method POST, the request body from step 5) and the URL from step 4) with removed qualifier (last component of XRI).
- org.opencrx.kernel.account1.Contact
- org.opencrx.kernel.account1.PostalAddress
- org.opencrx.kernel.account1.PhoneNumber
- org.opencrx.kernel.account1.EMailAddress
- org.opencrx.kernel.contract1.Lead
- org.opencrx.kernel.contract1.Opportunity
- org.opencrx.kernel.contract1.Quote
- org.opencrx.kernel.contract1.SalesOrder
- org.opencrx.kernel.contract1.Invoice
- org.opencrx.kernel.contract1.ContractPosition
- org.opencrx.kernel.document1.Document
- org.opencrx.kernel.document1.DocumentRevision
org.opencrx.kernel.account1.Contact
URL
''http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account''
Method
''POST''
Request Body The full list of attributes of org.opencrx.kernel.account1.Contact is specified in JavaDoc and UML.
<?xml version="1.0"?> <org.opencrx.kernel.account1.Contact> <salutation>Mr.</salutation> <firstName>Joe</firstName> <lastName>Doe</lastName> <salutationCode>6</salutationCode> </org.opencrx.kernel.account1.Contact>
Response Body
<?xml version="1.0"?>
<org.opencrx.kernel.account1.Contact id="LFTRDS1LY08NYYAHJHLYC75EN" href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN">
<salutation><![CDATA[Mr.]]></salutation>
<education>0</education>
<firstName><![CDATA[Joe]]></firstName>
<accessLevelUpdate>2</accessLevelUpdate>
<owningUser href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.User">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.User</owningUser>
<accessGrantedByParent href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard">
xri://@openmdx*org.opencrx.kernel.account1/provider/CRX/segment/Standard</accessGrantedByParent>
<preferredSpokenLanguage>0</preferredSpokenLanguage>
<accessLevelBrowse>3</accessLevelBrowse>
<fullName><![CDATA[Doe, Joe]]></fullName>
<preferredWrittenLanguage>0</preferredWrittenLanguage>
<familyStatus>0</familyStatus>
<lastName><![CDATA[Doe]]></lastName>
<vcard><![CDATA[BEGIN:VCARD
VERSION:2.1
UID:9ce8c860-3ece-11de-bea3-1b11ed87fb1f
REV:20090512T082638Z
N:Doe;Joe;;Mr.;
FN:Joe Doe
END:VCARD
]]></vcard>
<gender>0</gender>
<owner>
<_item><![CDATA[Standard:wfro.User]]></_item>
<_item><![CDATA[Standard:wfro.Group]]></_item>
</owner>
<salutationCode>6</salutationCode>
<accountRating>0</accountRating>
<accessLevelDelete>2</accessLevelDelete>
<owningGroup>
<_item href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.Group">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.Group</_item>
</owningGroup>
<accountState>0</accountState>
<preferredContactMethod>0</preferredContactMethod>
</org.opencrx.kernel.account1.Contact>
org.opencrx.kernel.account1.PostalAddress?
URL Take the URL of a contact and append address as reference name.
http://''localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN/address
Method
POST
Request Body The full list of attributes of org.opencrx.kernel.account1.PostalAddress? is specified in JavaDoc and UML. The multi-valued attribute postalAddress occurs multiple times for each value. The first occurence clears the list and appends the value Mr., the second appends the value Joe Doe and finally the third occurence the value c/o CRIXP Corp..
<?xml version="1.0"?> <org.opencrx.kernel.account1.PostalAddress> <postalStreet>Mr.</postalStreet> <postalStreet>Joe Doe</postalStreet> <postalStreet>c/o CRIXP Corp.</postalStreet> <postalCode>8005</postalCode> <postalCity>Zuerich</postalCity> <postalAddressLine>Technoparkstr. 1</postalAddressLine> <postalCountry>756</postalCountry> </org.opencrx.kernel.account1.PostalAddress>
Response Body
<?xml version="1.0"?>
<org.opencrx.kernel.account1.PostalAddress id="R1S8G8SNIZHLQOAXYQCAN3PF5" href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN/address/R1S8G8SNIZHLQOAXYQCAN3PF5">
<postalStreet>
<_item><![CDATA[Mr.]]></_item>
<_item><![CDATA[Joe Doe]]></_item>
<_item><![CDATA[c/o CRIXP Corp.]]></_item>
</postalStreet>
<postalCode><![CDATA[8005]]></postalCode>
<accessLevelUpdate>2</accessLevelUpdate>
<postalCity><![CDATA[Zuerich]]></postalCity>
<owningUser href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.User">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.User</owningUser>
<owner>
<_item><![CDATA[Standard:wfro.User]]></_item>
<_item><![CDATA[Standard:wfro.Group]]></_item>
</owner>
<accessGrantedByParent href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN">
xri://@openmdx*org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN</accessGrantedByParent>
<accessLevelBrowse>3</accessLevelBrowse>
<accessLevelDelete>2</accessLevelDelete>
<postalFreightTerms>0</postalFreightTerms>
<postalAddressLine>
<_item><![CDATA[Technoparkstr. 1]]></_item>
</postalAddressLine>
<postalCountry>756</postalCountry>
<isMain>false</isMain>
<owningGroup>
<_item href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.Group">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.Group</_item>
</owningGroup>
<postalUtcOffset>0</postalUtcOffset>
</org.opencrx.kernel.account1.PostalAddress>
org.opencrx.kernel.account1.PhoneNumber?
URL Take the URL of a contact and append address as reference name.
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN/address
Method
POST
Request Body The full list of attributes of org.opencrx.kernel.account1.PhoneNumber? is specified in JavaDoc and UML.
<?xml version="1.0"?> <org.opencrx.kernel.account1.PhoneNumber> <automaticParsing>true</automaticParsing> <phoneNumberFull>+41(44)1112233</phoneNumberFull> <isMain>true</isMain> </org.opencrx.kernel.account1.PhoneNumber>
Response Body
<?xml version="1.0"?>
<org.opencrx.kernel.account1.PhoneNumber id="R1S8G8UMK3JKUOAXYQCAN3PF5" href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN/address/R1S8G8UMK3JKUOAXYQCAN3PF5">
<phoneCountryPrefix>756</phoneCountryPrefix>
<automaticParsing>true</automaticParsing>
<phoneExtension><![CDATA[]]></phoneExtension>
<phoneCityArea><![CDATA[44]]></phoneCityArea>
<accessLevelUpdate>2</accessLevelUpdate>
<owningUser href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.User">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.User</owningUser>
<owner>
<_item><![CDATA[Standard:wfro.User]]></_item>
<_item><![CDATA[Standard:wfro.Group]]></_item>
</owner>
<accessGrantedByParent href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN">
xri://@openmdx*org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN</accessGrantedByParent>
<accessLevelBrowse>3</accessLevelBrowse>
<phoneLocalNumber><![CDATA[1112233]]></phoneLocalNumber>
<accessLevelDelete>2</accessLevelDelete>
<phoneNumberFull><![CDATA[+41(44)1112233]]></phoneNumberFull>
<isMain>true</isMain>
<owningGroup>
<_item href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.Group">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.Group</_item>
</owningGroup>
</org.opencrx.kernel.account1.PhoneNumber>
org.opencrx.kernel.account1.EMailAddress
URL Take the URL of a contact and append address as reference name.
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN/address
Method
POST
Request Body The full list of attributes of org.opencrx.kernel.account1.EMailAddress is specified in JavaDoc and UML.
<?xml version="1.0"?> <org.opencrx.kernel.account1.EMailAddress> <emailType>1</emailType> <emailFormat>1</emailFormat> <emailAddress>joe.doe@dot.net</emailAddress> <isMain>true</isMain> </org.opencrx.kernel.account1.EMailAddress>
Response Body
<?xml version="1.0"?>
<org.opencrx.kernel.account1.EMailAddress id="R1S8G8WLL7LJYOAXYQCAN3PF5" href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN/address/R1S8G8WLL7LJYOAXYQCAN3PF5">
<emailFormat>1</emailFormat>
<emailAddress><![CDATA[joe.doe@dot.net]]></emailAddress>
<accessLevelUpdate>2</accessLevelUpdate>
<owningUser href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.User">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.User</owningUser>
<isMain>true</isMain>
<owner>
<_item><![CDATA[Standard:wfro.User]]></_item>
<_item><![CDATA[Standard:wfro.Group]]></_item>
</owner>
<owningGroup>
<_item href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.Group">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.Group</_item>
</owningGroup>
<accessGrantedByParent href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN">
xri://@openmdx*org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN</accessGrantedByParent>
<accessLevelBrowse>3</accessLevelBrowse>
<emailType>1</emailType>
<accessLevelDelete>2</accessLevelDelete>
</org.opencrx.kernel.account1.EMailAddress>
org.opencrx.kernel.contract1.Lead
URL
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.contract1/provider/CRX/segment/Standard/lead
Method
POST
Request Body The full list of attributes of org.opencrx.kernel.contract1.Lead is specified in JavaDoc and UML. The value of the attribute customer must be the valid XRI of an account.
<?xml version="1.0"?> <org.opencrx.kernel.contract1.Lead> <name>Lead created by REST</name> <customer>xri://@openmdx*org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN</customer> <closeProbability>10</closeProbability> <leadSource>2</leadSource> <leadRating>1</leadRating> <shippingMethod>0</shippingMethod> <contractState>200</contractState> <contractLanguage>0</contractLanguage> <paymentTerms>0</paymentTerms> <priority>1</priority> <contractCurrency>36</contractCurrency> </org.opencrx.kernel.contract1.Lead>
Response Body
<?xml version="1.0"?>
<org.opencrx.kernel.contract1.Lead id="R1S8G96GQRVFIOAXYQCAN3PF5" href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.contract1/provider/CRX/segment/Standard/lead/R1S8G96GQRVFIOAXYQCAN3PF5">
<totalDiscountAmount>0E-15</totalDiscountAmount>
<closeProbability>10</closeProbability>
<pricingState>0</pricingState>
<leadSource>2</leadSource>
<accessLevelUpdate>2</accessLevelUpdate>
<owningUser href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.User">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.User</owningUser>
<totalBaseAmount>0E-15</totalBaseAmount>
<owner>
<_item><![CDATA[Standard:wfro.User]]></_item>
<_item><![CDATA[Standard:Administrators]]></_item>
<_item><![CDATA[Standard:wfro.Group]]></_item>
</owner>
<shippingMethod>0</shippingMethod>
<leadRating>1</leadRating>
<customer href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN">
xri://@openmdx*org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN</customer>
<accessGrantedByParent href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.contract1/provider/CRX/segment/Standard">
xri://@openmdx*org.opencrx.kernel.contract1/provider/CRX/segment/Standard</accessGrantedByParent>
<totalAmount>0E-15</totalAmount>
<contractState>200</contractState>
<accessLevelBrowse>3</accessLevelBrowse>
<totalAmountIncludingTax>0E-15</totalAmountIncludingTax>
<isGift>false</isGift>
<accessLevelDelete>2</accessLevelDelete>
<contractLanguage>0</contractLanguage>
<totalSalesCommission>0E-15</totalSalesCommission>
<paymentTerms>0</paymentTerms>
<totalTaxAmount>0E-15</totalTaxAmount>
<name><![CDATA[Lead created by REST]]></name>
<priority>1</priority>
<owningGroup>
<_item href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/Administrators">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/Administrators</_item>
<_item href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.Group">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.Group</_item>
</owningGroup>
<contractCurrency>36</contractCurrency>
</org.opencrx.kernel.contract1.Lead>
org.opencrx.kernel.contract1.Opportunity
URL
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.contract1/provider/CRX/segment/Standard/opportunity
Method
POST
Request Body The full list of attributes of org.opencrx.kernel.contract1.Opportunity is specified in JavaDoc and UML. The value of the attribute customer must be the valid XRI of an account.
<?xml version="1.0"?> <org.opencrx.kernel.contract1.Opportunity> <name>Opportunity created by REST</name> <closeProbability>0</closeProbability> <opportunityRating>0</opportunityRating> <shippingMethod>0</shippingMethod> <customer>xri://@openmdx*org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN</customer> <contractState>210</contractState> <contractLanguage>0</contractLanguage> <paymentTerms>0</paymentTerms> <priority>0</priority> <activeOn>2009-09-20T13:37:14.610Z</activeOn> <opportunitySource>0</opportunitySource> <contractCurrency>0</contractCurrency> </org.opencrx.kernel.contract1.Opportunity>
Response Body
<?xml version="1.0"?>
<org.opencrx.kernel.contract1.Opportunity id="R1S8G98FRVXEMOAXYQCAN3PF5" href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.contract1/provider/CRX/segment/Standard/opportunity/R1S8G98FRVXEMOAXYQCAN3PF5">
<totalDiscountAmount>0E-15</totalDiscountAmount>
<closeProbability>0</closeProbability>
<opportunityRating>0</opportunityRating>
<pricingState>0</pricingState>
<accessLevelUpdate>2</accessLevelUpdate>
<owningUser href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.User">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.User</owningUser>
<totalBaseAmount>0E-15</totalBaseAmount>
<owner>
<_item><![CDATA[Standard:wfro.User]]></_item>
<_item><![CDATA[Standard:Administrators]]></_item>
<_item><![CDATA[Standard:wfro.Group]]></_item>
</owner>
<shippingMethod>0</shippingMethod>
<accessGrantedByParent href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.contract1/provider/CRX/segment/Standard">
xri://@openmdx*org.opencrx.kernel.contract1/provider/CRX/segment/Standard</accessGrantedByParent>
<customer href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN">
xri://@openmdx*org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN</customer>
<totalAmount>0E-15</totalAmount>
<contractState>210</contractState>
<accessLevelBrowse>3</accessLevelBrowse>
<totalAmountIncludingTax>0E-15</totalAmountIncludingTax>
<isGift>false</isGift>
<accessLevelDelete>2</accessLevelDelete>
<contractLanguage>0</contractLanguage>
<totalSalesCommission>0E-15</totalSalesCommission>
<paymentTerms>0</paymentTerms>
<totalTaxAmount>0E-15</totalTaxAmount>
<name><![CDATA[Opportunity created by REST]]></name>
<priority>0</priority>
<owningGroup>
<_item href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/Administrators">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/Administrators</_item>
<_item href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.Group">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.Group</_item>
</owningGroup>
<activeOn>20090920T133714.610Z</activeOn>
<opportunitySource>0</opportunitySource>
<contractCurrency>0</contractCurrency>
</org.opencrx.kernel.contract1.Opportunity>
org.opencrx.kernel.contract1.Quote
URL
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.contract1/provider/CRX/segment/Standard/quote
Method
POST
Request Body The full list of attributes of org.opencrx.kernel.contract1.Quote is specified in JavaDoc and UML. The value of the attribute customer must be the valid XRI of an account.
<?xml version="1.0"?> <org.opencrx.kernel.contract1.Quote> <name>Quote created by REST</name> <closeProbability>0</closeProbability> <estimatedCloseDate>2009-09-16T12:17:01.000Z</estimatedCloseDate> <shippingMethod>0</shippingMethod> <customer>xri://@openmdx*org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN</customer> <contractState>330</contractState> <freightTerms>0</freightTerms> <contractLanguage>126</contractLanguage> <paymentTerms>0</paymentTerms> <priority>0</priority> <activeOn>2009-12-26T23:12:39.000Z</activeOn> <contractCurrency>840</contractCurrency> </org.opencrx.kernel.contract1.Quote>
Response Body
<?xml version="1.0"?>
<org.opencrx.kernel.contract1.Quote id="R1S8G9AESZZDQOAXYQCAN3PF5" href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.contract1/provider/CRX/segment/Standard/quote/R1S8G9AESZZDQOAXYQCAN3PF5">
<totalDiscountAmount>0E-15</totalDiscountAmount>
<closeProbability>0</closeProbability>
<estimatedCloseDate>20090916T121701.000Z</estimatedCloseDate>
<pricingState>0</pricingState>
<accessLevelUpdate>2</accessLevelUpdate>
<owningUser href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.User">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.User</owningUser>
<totalBaseAmount>0E-15</totalBaseAmount>
<owner>
<_item><![CDATA[Standard:wfro.User]]></_item>
<_item><![CDATA[Standard:Administrators]]></_item>
<_item><![CDATA[Standard:wfro.Group]]></_item>
</owner>
<shippingMethod>0</shippingMethod>
<accessGrantedByParent href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.contract1/provider/CRX/segment/Standard">
xri://@openmdx*org.opencrx.kernel.contract1/provider/CRX/segment/Standard</accessGrantedByParent>
<customer href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN">
xri://@openmdx*org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN</customer>
<totalAmount>0E-15</totalAmount>
<contractState>330</contractState>
<accessLevelBrowse>3</accessLevelBrowse>
<totalAmountIncludingTax>0E-15</totalAmountIncludingTax>
<isGift>false</isGift>
<accessLevelDelete>2</accessLevelDelete>
<freightTerms>0</freightTerms>
<contractLanguage>126</contractLanguage>
<totalSalesCommission>0E-15</totalSalesCommission>
<paymentTerms>0</paymentTerms>
<totalTaxAmount>0E-15</totalTaxAmount>
<name><![CDATA[Quote created by REST]]></name>
<priority>0</priority>
<owningGroup>
<_item href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/Administrators">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/Administrators</_item>
<_item href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.Group">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.Group</_item>
</owningGroup>
<activeOn>20091226T231239.000Z</activeOn>
<contractCurrency>840</contractCurrency>
</org.opencrx.kernel.contract1.Quote>
org.opencrx.kernel.contract1.Invoice
URL
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.contract1/provider/CRX/segment/Standard/invoice
Method
POST
Request Body The full list of attributes of org.opencrx.kernel.contract1.Invoice is specified in JavaDoc and UML. The value of the attribute customer must be the valid XRI of an account.
<?xml version="1.0"?> <org.opencrx.kernel.contract1.Invoice> <name>Invoice created by REST</name> <pricingState>0</pricingState> <shippingMethod>0</shippingMethod> <customer>xri://@openmdx*org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN</customer> <expiresOn>2009-11-27T00:00:00.000Z</expiresOn> <contractState>520</contractState> <contractLanguage>0</contractLanguage> <paymentTerms>0</paymentTerms> <priority>0</priority> <activeOn>2009-09-22T00:00:00.000Z</activeOn> <contractCurrency>756</contractCurrency> </org.opencrx.kernel.contract1.Invoice>
Response Body
<?xml version="1.0"?>
<org.opencrx.kernel.contract1.Invoice id="R1S8G9CDU41CUOAXYQCAN3PF5" href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.contract1/provider/CRX/segment/Standard/invoice/R1S8G9CDU41CUOAXYQCAN3PF5">
<totalDiscountAmount>0E-15</totalDiscountAmount>
<pricingState>0</pricingState>
<accessLevelUpdate>2</accessLevelUpdate>
<owningUser href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.User">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.User</owningUser>
<totalBaseAmount>0E-15</totalBaseAmount>
<owner>
<_item><![CDATA[Standard:wfro.User]]></_item>
<_item><![CDATA[Standard:Administrators]]></_item>
<_item><![CDATA[Standard:wfro.Group]]></_item>
</owner>
<shippingMethod>0</shippingMethod>
<accessGrantedByParent href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.contract1/provider/CRX/segment/Standard">
xri://@openmdx*org.opencrx.kernel.contract1/provider/CRX/segment/Standard</accessGrantedByParent>
<customer href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN">
xri://@openmdx*org.opencrx.kernel.account1/provider/CRX/segment/Standard/account/LFTRDS1LY08NYYAHJHLYC75EN</customer>
<totalAmount>0E-15</totalAmount>
<expiresOn>20091127T000000.000Z</expiresOn>
<contractState>520</contractState>
<accessLevelBrowse>3</accessLevelBrowse>
<totalAmountIncludingTax>0E-15</totalAmountIncludingTax>
<isGift>false</isGift>
<accessLevelDelete>2</accessLevelDelete>
<contractLanguage>0</contractLanguage>
<totalSalesCommission>0E-15</totalSalesCommission>
<paymentTerms>0</paymentTerms>
<totalTaxAmount>0E-15</totalTaxAmount>
<name><![CDATA[Invoice created by REST]]></name>
<priority>0</priority>
<owningGroup>
<_item href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/Administrators">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/Administrators</_item>
<_item href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.Group">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.Group</_item>
</owningGroup>
<activeOn>20090922T000000.000Z</activeOn>
<contractCurrency>756</contractCurrency>
</org.opencrx.kernel.contract1.Invoice>
org.opencrx.kernel.contract1.ContractPosition?
Contract positions can not be created directly. The are created by the operation createPosition which must be invoked on a contract (i.e. Opportunity, Quote, SalesOrder? or Invoice).
URL Take the URL of a contract and append createPosition as operation name.
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.contract1/provider/CRX/segment/Standard/invoice/R1S8G9CDU41CUOAXYQCAN3PF5/createPosition
Method
POST
Request Body The request body serves as operation parameter which is the structure type org.opencrx.kernel.contract1.CreatePositionParams?. The full list of attributes of org.opencrx.kernel.contract1.CreatePositionParams? is specified in JavaDoc and UML.
<?xml version="1.0"?> <org.opencrx.kernel.contract1.CreatePositionParams> <name>Invoice position created by REST</name> <quantity>1.0</quantity> <product>xri://@openmdx*org.opencrx.kernel.product1/provider/CRX/segment/Standard/product/90</product> </org.opencrx.kernel.contract1.CreatePositionParams>
Response Body
<?xml version="1.0"?>
<org.opencrx.kernel.contract1.CreatePositionResult id="result" href="http://localhost:8080/opencrx-rest-CRX/9WT9Q4AJSARJ2SISEM4V24VAX">
<position href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.contract1/provider/CRX/segment/Standard/invoice/R1S8G9CDU41CUOAXYQCAN3PF5/position/9VL89VXPS2AJISISEM4V24VAX">
xri://@openmdx*org.opencrx.kernel.contract1/provider/CRX/segment/Standard/invoice/R1S8G9CDU41CUOAXYQCAN3PF5/position/9VL89VXPS2AJISISEM4V24VAX</position>
</org.opencrx.kernel.contract1.CreatePositionResult>
org.opencrx.kernel.document1.Document
URL
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.document1/provider/CRX/segment/Standard/document
Method
POST
Request Body The full list of attributes of org.opencrx.kernel.document1.Document is specified in JavaDoc and UML.
<?xml version="1.0"?> <org.opencrx.kernel.document1.Document> <name>How to use REST servlet</name> <title>How to use REST servlet</name></title> <literatureType>0</literatureType> <documentState>0</documentState> <documentType>0</documentType> <contentLanguage>0</contentLanguage> <author>jdoe</author> </org.opencrx.kernel.document1.Document>
Response Body
<?xml version="1.0"?>
<org.opencrx.kernel.document1.Document id="9WT9Q4CITETI6SISEM4V24VAX" href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.document1/provider/CRX/segment/Standard/document/9WT9Q4CITETI6SISEM4V24VAX">
<title><![CDATA[How to use REST servlet]]></title>
<literatureType>0</literatureType>
<documentState>0</documentState>
<name><![CDATA[How to use REST servlet]]></name>
<accessLevelUpdate>2</accessLevelUpdate>
<owningUser href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.User">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.User</owningUser>
<owner>
<_item><![CDATA[Standard:wfro.User]]></_item>
<_item><![CDATA[Standard:Administrators]]></_item>
<_item><![CDATA[Standard:wfro.Group]]></_item>
</owner>
<owningGroup>
<_item href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/Administrators">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/Administrators</_item>
<_item href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.Group">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.Group</_item>
</owningGroup>
<accessGrantedByParent href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.document1/provider/CRX/segment/Standard">
xri://@openmdx*org.opencrx.kernel.document1/provider/CRX/segment/Standard</accessGrantedByParent>
<documentType>0</documentType>
<accessLevelBrowse>3</accessLevelBrowse>
<contentLanguage>0</contentLanguage>
<accessLevelDelete>2</accessLevelDelete>
<author><![CDATA[jdoe]]></author>
</org.opencrx.kernel.document1.Document>
org.opencrx.kernel.document1.DocumentRevision?
URL Document revisions are attached to documents. Take the XRI of a document and add revision as reference name.
http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.document1/provider/CRX/segment/Standard/document/9WT9Q4CITETI6SISEM4V24VAX/revision
Method
POST
Request Body The full list of attributes of org.opencrx.kernel.document1.MediaContent? is specified in JavaDoc and UML. The attribute content is modeled as binary stream. The value of binary attribute must be a Base64-encoded byte array. In the example below VEVTVCAK is the Base64-encoded representation of the UTF-8 string Test.
<?xml version="1.0"?> <org.opencrx.kernel.document1.MediaContent> <name>Media content created by REST</name> <contentName>Test.txt</contentName> <content>VEVTVCAK</content> <contentMimeType>text/plain</contentMimeType> </org.opencrx.kernel.document1.MediaContent>
Response Body
<?xml version="1.0"?>
<org.opencrx.kernel.document1.MediaContent id="9WT9Q4EHUIVHASISEM4V24VAX" href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.document1/provider/CRX/segment/Standard/document/9WT9Q4CITETI6SISEM4V24VAX/revision/9WT9Q4EHUIVHASISEM4V24VAX">
<owningUser href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.User">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.User</owningUser>
<contentName><![CDATA[Test.txt]]></contentName>
<owner>
<_item><![CDATA[Standard:wfro.User]]></_item>
<_item><![CDATA[Standard:Administrators]]></_item>
<_item><![CDATA[Standard:wfro.Group]]></_item>
</owner>
<owningGroup>
<_item href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/Administrators">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/Administrators</_item>
<_item href="http://localhost:8080/opencrx-rest-CRX/org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.Group">
xri://@openmdx*org.openmdx.security.realm1/provider/CRX/segment/Root/realm/Standard/principal/wfro.Group</_item>
</owningGroup>
<accessGrantedByParent href="http://localhost:8080/opencrx-rest-CRX/org.opencrx.kernel.document1/provider/CRX/segment/Standard/document/9WT9Q4CITETI6SISEM4V24VAX">
xri://@openmdx*org.opencrx.kernel.document1/provider/CRX/segment/Standard/document/9WT9Q4CITETI6SISEM4V24VAX</accessGrantedByParent>
<content>VEVTVCAK</content>
<contentMimeType><![CDATA[text/plain]]></contentMimeType>
<accessLevelBrowse>3</accessLevelBrowse>
<accessLevelUpdate>2</accessLevelUpdate>
<name><![CDATA[Media content created by REST]]></name>
<accessLevelDelete>2</accessLevelDelete>
</org.opencrx.kernel.document1.MediaContent>
Attachments
- Sdk24.RestServlet.java (72.1 KB) - added by wfro 5 months ago.