Show TOC

Predefined Services and Data TypesLocate this document in the navigation structure

In this topic, you can find an overview of frequently used services, objects, and data types that are used in developing cross applications with CAF. They are delivered with the standard caf.core project.

You can find them in the
caf.core
application, which contains the following packages:
  • faults
    - standard error messages
  • primitive
    - simple data types
  • services
    -application services, business objects, and complex types
Faults

You can find certain fault types delivered and installed with caf.core application. They are listed in the table below.

Exception Name Java Class Name Description

CAFBaseException

com.sap.caf.rt.exception.CAFBaseException

Used by the CAF framework

CAFBONodeException

com.sap.caf.rt.exception.CAFBONodeException

Used by the CAF framework

CAFCreateException

com.sap.caf.rt.exception.CAFCreateException

Thrown when the creation of a business object node instance failed

CAFDeleteException

com.sap.caf.rt.exception.CAFDeleteException

Thrown when the deletion of a business object node instance  failed

CAFDataAccessException

com.sap.caf.rt.exception.CAFDataAccessException

 

CAFFindException

com.sap.caf.rt.exception.CAFFindException

Thrown when the search of a business object node instance failed

CAFLockException

com.sap.caf.rt.exception.CAFLockException

A base class for CAFOptimisticLockException and CAFPessimisticLockException. Thrown when pessimistic or optimistic locking prevents the business object service operation from successful execution.

CAFPermissionException

com.sap.caf.rt.exception.CAFPermissionException

Thrown when the user does not have the necessary permissions for the operation

CAFRetrieveException

com.sap.caf.rt.exception.CAFRetrieveException

Thrown from the read operation if the requested business object node instance was not found

CAFServiceException

com.sap.caf.rt.exception.CAFServiceException

Used by the CAF framework

CAFUpdateException

com.sap.caf.rt.exception.CAFUpdateException

Thrown when the update of a business object node instance failed

CAFOptimisticLockException

com.sap.caf.rt.exception.CAFOptimisticLockException

Thrown when optimistic locking prevents the business object instance from being updated (the instance has been changed in the back end since the last read operation).

CAFPessimisticLockException

com.sap.caf.rt.exception.CAFPessimisticLockException

Thrown when the business object instance is locked pessimistically (using the locking methods in com.sap.caf.rt.bol.IBusinessEntityService) in another thread.

Types

Primitive Types

Type Name Java Type Built-In Type Default DB Length

ANY

java.lang.Object

binary

Not limited

ANYURI

java.lang.String

string

512

ANYSIMPLE

java.lang.Object

binary

Not limited

BASE64BINARY

byte[]

binary

Not limited

BOOLEAN

java.lang.Boolean

string

 

BYTE

Java.lang.Byte

short

 

DATE

javax.xml.datatype.XMLGregorianCalendar

timestamp

 

DATETIME

javax.xml.datatype.XMLGregorianCalendar

timestamp

 

DECIMAL

java.math.BigDecimal

decimal

30, 10

DOUBLE

java.math.Double

double

 

DURATION

javax.xml.datatype.Duration

integer

30

FLOAT

java.lang.Float

float

 

GDAY

javax.xml.datatype.XMLGregorianCalendar

string

5

GMONTH

javax.xml.datatype.XMLGregorianCalendar

string

7

GMONTHDAY

javax.xml.datatype.XMLGregorianCalendar

string

7

GYEAR

javax.xml.datatype.XMLGregorianCalendar

string

4

GYEARMONTH

javax.xml.datatype.XMLGregorianCalendar

string

7

HEXBINARY

byte[]

binary

Not limited

IDREF

java.lang.Object

binary

Not limited

INT

java.lang.Integer

integer

 

INTEGER

java.lang.BigDecimal

decimal

30, 0

LONG

java.lang.Long

long

 

NOTATION

javax.xml.namespace.QName

sring

512

QNAME

javax.xml.namespace.QName

string

512

SHORT

java.lang.Short

short

 

STRING

java.lang.String

string

30

TIME

javax.xml.datatype.XMLGregorianCalendar

time

 
Services

This package contains the following:

  • Application services - predefined application services that help you organize the logic of your application
  • Business object nodes
  • Data types - complex types used by business object nodes and application services

Application Services

Application Service DocContent

Operation Description

addRelatedObjectRid (boRid, documentKey,boGuid,boName)

Relates a business object node to the document.

copyDocument (srcRid, dstBOGuid, dstBOName)

Copies a document from a specified source to the destination business object.

deleteVersion (historyRid)

Deletes the recent history of the document.

disableDocumentVersioning (rid)

Disables versioning of a document.

enableDocumentVersioning (rid)

Enables versioning of a document.

getCurrentVersion (rid)

Returns the latest version of the document.

getDocumentVersion (rid)

Returns a business object Document with the version of the specified document.

getLockInfo (rid)

Provides information about the current state of the document:

  • Which user locked the document
  • Is locking/unlocking enabled

getRelatedObjects (documentKey)

Returns the ids of the objects related to the document.

getVersionHistory (rid)

Provides the versioning history of the document.

isAttached (rid)

Indicates whether  the document is related to business object node.

isDocumentLocked (rid)

Indicates whether the document is locked.

isDocumentVersioned (rid)

Indicates whether the document has been versioned.

readDocumentContent (documentKey)

Returns the content of the document.

relateDocument (srcRid, dstBOGuid, dstBOName)

Relates a particular document to a business object node.

removeRelatedObject (boInstanceGuid,

documentKey,

boName)

Removes the related business object  from the relations of a document.

setAsCurrentVersion (history, rid)

Sets a version from the version history to be a current version of the document.

unlockDocument (rid)

Unlocks the document.

uploadDocument (key, content)

Uploads content of the specified document in the KM repository.

uploadDocumentWithType (key, content, contentType, encoding)

Uploads the specified content type of a document in the KM repository.

uploadExtLink (url, key)

Uploads external link in the document.

Business Objects

Business Object Document

Attribute Description

createdBy:UserId

  • The user id of the document author.

createdAt:DATETIME

  • The date the document has been created.

modifiedAt:DATETIME

  • The date when the document has been last modified.

modifiedBy:UserId

  • The user id of the person that last modified the document.

title:LongText

  • The title of the document.

link:Rid

  • Resource id in the KM repository.

description:LongText

  • Description of the document.

contentLength:LONG

  • The length of the document.

contentType:ShortText

  • Type of the document.

parentFolder:Rid

  • Resource id of the parent folder

documentId:Rid

  • Resource id of the document

key:Id

 

Complex Data Types

Complex Data Types

Complex Data Type Attributes (Simple Data Types) Description

Document

See the information about the business object Documentabove

RelatedObject

Key:Id

 

createdBy:UserId

The user id of the person that created the relation.

createdAt:DATETIME

The date the relation was created.

modifiedAt:DATETIME

The date the relation was last modified.

modifiedBy:UserId

The user id of the person that last modified the relation.

refObjectKey:Id

Id of the business object node to which the document is attached.

refObjectType:LongText

 

refObjectRid:Rid

Resource id of the business object node to which the document is attached in KM repository.