Difference between revisions of "Java API"

From AgileApps Support Wiki
imported>Aeric
imported>Aeric
Β 
(28 intermediate revisions by the same user not shown)
Line 12: Line 12:
:''Learn more about the platform:'' Β 
:''Learn more about the platform:'' Β 
::* [[Getting Started with the Java API]]
::* [[Getting Started with the Java API]]
::* [[Java Code Samples]]
::* [[Java API Cheatsheet]]
::* [[Java API Cheatsheet]]
::* [[System Object Types]]
::* [[Developer_Suite#Java_Code|Java Code in the Developer Suite]]
::* [[Developer_Suite#Java_Code|Java Code in the Developer Suite]]
::* Java API [{{DOCHOST}}/javadocs javadocs]
::* Java API [{{DOCHOST}}/javadocs javadocs]
Line 63: Line 65:
::* [[Java_API:Data Import#getMappingProfiles|<tt>getMappingProfiles</tt>]]
::* [[Java_API:Data Import#getMappingProfiles|<tt>getMappingProfiles</tt>]]
::* [[Java_API:Data Import#importData|<tt>importData</tt>]]
::* [[Java_API:Data Import#importData|<tt>importData</tt>]]
::* <tt>[[getImportStatus]]</tt>


:''Learn more:'' [[Java_API:Data Import]]
:''Learn more:'' [[Java_API:Data Import]]


===<span id="relay">Relay</span>===
===Email===
To do social networking.
:* [[Java API:Email#sendEmail|<tt>sendEmail</tt>]]
:* Groups
:* [[Java API:Email#sendEmailUsingTemplate|<tt>sendEmailUsingTemplate</tt>]]
:*:* [[Java_API:Relay#getSocialGroup|<tt>getSocialGroup</tt>]]
:*:* [[Java_API:Relay#addSocialGroup|<tt>addSocialGroup</tt>]] Β 
:*:* [[Java_API:Relay#updateSocialGroup|<tt>updateSocialGroup</tt>]]
:*:* [[Java_API:Relay#deleteSocialGroup|<tt>deleteSocialGroup</tt>]]
:*:* [[Java_API:Relay#searchSocialGroups|<tt>searchSocialGroups</tt>]] Β 


:* Messages
===Document Management===
:*:* [[Java_API:Relay#addSocialFeed|<tt>addSocialFeed</tt>]] (post a msg)
:* [[Java API:Document Management#generateDocument|<tt>generateDocument</tt>]]
:*:* [[Java_API:Relay#getSocialFeed|<tt>getSocialFeed</tt>]] (get msg)
:* [[Java API:Document Management#getDocument|<tt>getDocument</tt>]]
:*:* [[Java_API:Relay#deleteSocialFeed|<tt>deleteSocialFeed</tt>]] (delete msg)
:* [[Java API:Document Management#Example: Generate an Attachment|Example: Generate an Attachment]]
:*:* [[Java_API:Relay#searchSocialFeeds|<tt>searchSocialFeeds</tt>]] (search msgs)
Β 
:* Message Voting
:*:* [[Java_API:Relay#getSocialVotes|<tt>getSocialVotes</tt>]]
:*:* [[Java_API:Relay#socialVote|<tt>socialVote</tt>]]
Β 
:* Following Feeds
:*:* [[Java_API:Relay#socialFollow|<tt>socialFollow</tt>]]
:*:* [[Java_API:Relay#socialUnFollow|<tt>socialUnfollow</tt>]]
:*:* [[Java_API:Relay#getSocialFollowers|<tt>getSocialFollowers</tt>]]
:*:* [[Java_API:Relay#getSocialFollowing|<tt>getSocialFollowing</tt>]]
Β 
:* Notifications
:*:* [[Java_API:Relay#getSocialNotificationsCount|<tt>getSocialNotificationsCount</tt>]]Β 
:*:* [[Java_API:Relay#getSocialNotificationsList|<tt>getSocialNotificationsList</tt>]]Β 
:*:* [[Java_API:Relay#setAllSocialNotificationsRead|<tt>setAllSocialNotificationsRead</tt>]]Β 
Β 
===Email and Document Management===
Manage [[Email]] and documents:
:* [[Java API:Email_and_Document_Management#sendEmail|<tt>sendEmail</tt>]]
:* [[Java API:Email_and_Document_Management#sendEmailUsingTemplate|<tt>sendEmailUsingTemplate</tt>]]
::<hr width="200">
:* [[Java API:Email_and_Document_Management#generateDocument|<tt>generateDocument</tt>]]
:* [{{DOCHOST}}/javadocs/com/platform/api/Functions.html#getDocument(java.lang.String) <tt>getDocument(id)</tt>]
:* [{{DOCHOST}}/javadocs/com/platform/api/Functions.html#getDocumentByTitle(java.lang.String) <tt>getDocumentByTitle("title")</tt>]
Β 
:''Learn more:''
::* [[Java_API:Email_and_Document_Management]]
::* [[Java Code Samples#Manage Record Attachments]]


===Transaction Management===
===Transaction Management===
Line 139: Line 108:
Use these functions to convert between [[Database Format]]s and localized [[User Format]]s.
Use these functions to convert between [[Database Format]]s and localized [[User Format]]s.
:* [{{DOCHOST}}/javadocs/com/platform/api/Functions.html#formatCurrency(java.lang.String,%20int) <tt>formatCurrency</tt>]
:* [{{DOCHOST}}/javadocs/com/platform/api/Functions.html#formatCurrency(java.lang.String,%20int) <tt>formatCurrency</tt>]
:* [{{DOCHOST}}/javadocs/com/platform/api/Functions.html#formatDate(java.util.Date) <tt>formatDate</tt>]
:* [{{DOCHOST}}/javadocs/com/platform/api/Functions.html#formatDateTime(java.util.Date) <tt>formatDateTime</tt>]
:* [{{DOCHOST}}/javadocs/com/platform/api/Functions.html#formatNumber(java.lang.String,%20int) <tt>formatNumber</tt>]
:* [{{DOCHOST}}/javadocs/com/platform/api/Functions.html#formatNumber(java.lang.String,%20int) <tt>formatNumber</tt>]
:* [{{DOCHOST}}/javadocs/com/platform/api/Functions.html#formatPercent(java.lang.String,%20int) <tt>formatPercent</tt>]
:* [{{DOCHOST}}/javadocs/com/platform/api/Functions.html#formatPercent(java.lang.String,%20int) <tt>formatPercent</tt>]
:* [{{DOCHOST}}/javadocs/com/platform/api/Functions.html#formatTime(java.util.Date) <tt>formatTime</tt>]
:* [{{DOCHOST}}/javadocs/com/platform/api/Functions.html#parseCurrency(java.lang.String) <tt>parseCurrency</tt>]
:* [{{DOCHOST}}/javadocs/com/platform/api/Functions.html#parseCurrency(java.lang.String) <tt>parseCurrency</tt>]
:* [{{DOCHOST}}/javadocs/com/platform/api/Functions.html#parseNumber(java.lang.String) <tt>parseNumber</tt>]
:* [{{DOCHOST}}/javadocs/com/platform/api/Functions.html#parseNumber(java.lang.String) <tt>parseNumber</tt>]
Line 151: Line 123:


===Utility Functions===
===Utility Functions===
Logger functions:
====Logger functions====
:* [[Java_API:Utility functions#Logger functions|<tt>info</tt>]]
:* [[Java_API:Utility functions#Logger functions|<tt>info</tt>]]
:* [[Java_API:Utility functions#Logger functions|<tt>warn</tt>]]
:* [[Java_API:Utility functions#Logger functions|<tt>warn</tt>]]
Line 157: Line 129:
:* [[Java_API:Utility functions#Logger functions|<tt>fatal</tt>]]
:* [[Java_API:Utility functions#Logger functions|<tt>fatal</tt>]]


General-purpose operations.
====Service Configuration Functions====
:* [{{DOCHOST}}/javadocs/com/platform/api/utility/ServiceConfiguration.html#getServiceName()<tt>getServiceName</tt>]
:* [{{DOCHOST}}/javadocs/com/platform/api/utility/ServiceConfiguration.html#getServiceDomainURL()<tt>getServiceDomainURL</tt>]
Β 
====General Purpose Functions====
:* [[Java_API:Utility functions#getEnv|<tt>getEnv</tt>]]
:* [[Java_API:Utility functions#getEnv|<tt>getEnv</tt>]]
:* [[Java_API:Utility functions#getLoggedInUserInfo|<tt>getLoggedInUserInfo</tt>]]
:* [[Java_API:Utility functions#getParametersInstance|<tt>getParametersInstance</tt>]]
:* [[Java_API:Utility functions#getParametersInstance|<tt>getParametersInstance</tt>]]
:* [[Java_API:Utility functions#getTimezonesUtility|<tt>getTimezonesUtility</tt>]]
:* [[Java_API:Utility functions#getTimezonesUtility|<tt>getTimezonesUtility</tt>]]
:* [[Java_API:Utility functions#getTimezoneUtility|<tt>getTimezoneUtility</tt>]]
:* [[Java_API:Utility functions#getTimezoneUtility|<tt>getTimezoneUtility</tt>]]
:* [[Java_API:Utility functions#getLoggedInUserInfo|<tt>getLoggedInUserInfo</tt>]]
:* [[Java_API:Utility functions#setTargetPage |<tt>setTargetPage </tt>]]
:* [[Java_API:Utility functions#showMessage |<tt>showMessage</tt>]]
:* [[Java_API:Utility functions#showMessage |<tt>showMessage</tt>]]
:* [[Java_API:Utility functions#sleep |<tt>sleep</tt>]]
:* [[Java_API:Utility functions#sleep |<tt>sleep</tt>]]
:* [[Java_API:Utility functions#setTargetPage |<tt>setTargetPage </tt>]]
:* [[Java_API:Utility functions#throwError|<tt>throwError</tt>]]
:* [[Java_API:Utility functions#throwError|<tt>throwError</tt>]]
:* [[Java_API:Utility functions#translateToken|<tt>translateToken</tt>]]
:* [[Java_API:Utility functions#translateToken|<tt>translateToken</tt>]]
::<hr width="200">
:* [{{DOCHOST}}/javadocs/com/platform/api/utility/ServiceConfiguration.html#getServiceName() <tt>getServiceName</tt>]
:* [{{DOCHOST}}/javadocs/com/platform/api/utility/ServiceConfiguration.html#getServiceDomainURL() <tt>getServiceDomainURL</tt>]


:''Learn more:'' [[Java API:Utility functions|Utility functions]]
:''Learn more:'' [[Java API:Utility functions]]


===Customization APIs===
===Customization APIs===
Line 190: Line 163:
:''Learn more:'' [[getStatus]]
:''Learn more:'' [[getStatus]]


==Identifying Objects and Records ==
==Finding Identifiers ==
===Object ID===
{{:Object Type Identifier}}
{{:Object Type Identifier}}
===Record ID===
Each record has a unique ID, needed to access and update data. The Record Identifier can appear as: <tt>id,Β  record_id, or recordId</tt>, depending on the tool. (Most often it appears as the <tt>id</tt> field to programmers.)
:''Learn more:'' [[Record ID]]


__FORCETOC__
===Session ID===
{{:Session Identifier}}
===Commonly Used Constants===
{{:Commonly Used Constants}}
<noinclude>
<noinclude>


[[Category:Java API|1 (Intro & Overview)]]
[[Category:Java API|1 (Intro & Overview)]]
</noinclude>
</noinclude>

Latest revision as of 20:41, 3 October 2014

The Java API is a set of built-in calls that are made to programmatically customize and extend the platform.

1 About the Java API

The following platform elements provide the ability to make Java API calls from the user interface (UI):

  • Standard Java classes, to create custom business logic that models your organization's environment
  • JSP Pages, which can invoke Java APIs

2 Prerequisites

You must know the Java programming language to make the Java API calls. This includes knowing the basic elements of Java such as conditional structures (if statement), looping structures (while and for loop statements), variable declaration and assignment, use of operators, variable naming conventions, debugging techniques, and so on.

Learn more about the platform:
Learn more about web services and programming:

3 Classes, Objects, and APIs

This table lists the APIs and links to detail pages. For a quick synopsis of syntax, see the Java API Cheatsheet.

3.1 Record Handling

3.1.1 Objects

Handle records in standard Objects:
Learn more: Java_API:Record_Handling

3.1.2 Composite Objects

Operate on records in Composite Objects:
Learn more: Working with Composite Objects

3.1.3 Tenant Data Sharing

Handle records in Objects shared using Tenant Data Sharing Policies:
Learn more: Tenant_Data_Sharing_Policies#Using the JAVA API to Access Shared Data

3.1.4 Data Import

Import CSV data into Objects
Learn more: Java_API:Data Import

3.2 Email

3.3 Document Management

3.4 Transaction Management

Provides the ability to Rollback transactions to a SavePoint

Learn more: Java_API:Transaction_Management

3.5 Support Classes and Objects

Use these support classes and objects when you work with the Java API.



Learn more: Java_API:Support_Classes_and_Objects

3.6 Localization Functions

Use these functions to convert between Database Formats and localized User Formats.

Learn more: Localization

3.7 Utility Functions

3.7.1 Logger functions

3.7.2 Service Configuration Functions

3.7.3 General Purpose Functions

Learn more: Java API:Utility functions

3.8 Customization APIs

Use these Provisional APIs give to manage metadata for program entities.

Learn more: Customize

3.9 Status

Check status of scheduled jobs.

Learn more: getStatus

4 Finding Identifiers

4.1 Object ID

An object type identifier uniquely identifies an object type. It is used to specify object types in APIs.

There are two kinds of type identifiers:

  • objectName: This identifier is a human-readable name for both System Objects and Custom Objects.
  • objectID: This identifier is a human-readable name for System Objects (e.g. "cases"), but for Custom Objects, it is a computer-generated string with no humanly-interpretable semantic value (e.g. 123qwe456rty).
See also:

To find an object type identifier:

  1. Click GearIcon.png > Customization > Objects
  2. In the Display Title column, find the object you're looking for.
  3. The Object Name column has the identifier you need.

Alternatively:

  1. Go to GearIcon.png > Customization > Objects > {object}
  2. Click Properties
  3. The object name appears at the top of the page

Notepad.png

Note:

4.2 Record ID

Each record has a unique ID, needed to access and update data. The Record Identifier can appear as: id, record_id, or recordId, depending on the tool. (Most often it appears as the id field to programmers.)

Learn more: Record ID

4.3 Session ID

The Session Identifier (session_id or sessionId) is used in HTTP communications to identify a series of related message exchanges, or "sessions".

Learn more: session identifier

4.4 Commonly Used Constants

Constants are defined in the CONSTANTS class. On that page, follow the links in the Nested Class Summary for a complete guide to AgileApps Cloud platform constants. For convenience, some of the more common constants used in the Java APIs are listed here.

Notepad.png

Note:

  • Constants have all-uppercase names, and are listed as static in the Field Summary. For example: static String CONTAINS
  • Some of the classes have nested classes of their own. Keep drilling down until you find the constant you need.

4.4.1 Documents

Constant Name Description Used in function
CONSTANTS.DOCUMENT.HTML HTML format generateDocument
CONSTANTS.DOCUMENT.PDF PDF format generateDocument

4.4.2 Search

Constant Name Description Used in function
CONSTANTS.SEARCH.SORT_ASCENDING Ascending order searchRecords
CONSTANTS.SEARCH.SORT_DESCENDING Descending order searchRecords

4.4.3 HttpConnection

Constant Name Description Used in function
CONSTANTS.HTTP. METHOD.GET HTTP GET request HttpConnection Constructor
CONSTANTS.HTTP. METHOD.POST HTTP POST request HttpConnection Constructor

4.4.4 Request Parameter

Constant Name Description Used in
... ... ...
CONSTANTS.SEARCH.SEARCH_RESULTS Retrieve search results