Show TOC Start of Content Area

Background documentation Predefined Services and Data Types  Locate the document in its SAP Library structure

Use

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

ANY

java.lang.Object

binary

ANYURI

java.lang.String

string

ANYSIMPLE

java.lang.Object

binary

BASE64BINARY

byte[]

binary

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

integer

DOUBLE

java.math.Double

double

DURATION

javax.xml.datatype.Duration

integer

FLOAT

java.lang.Float

float

GDAY

javax.xml.datatype.XMLGregorianCalendar

string

GMONTH

javax.xml.datatype.XMLGregorianCalendar

string

GMONTHDAY

javax.xml.datatype.XMLGregorianCalendar

string

GYEAR

javax.xml.datatype.XMLGregorianCalendar

string

GYEARMONTH

javax.xml.datatype.XMLGregorianCalendar

string

HEXBINARY

byte[]

binary

INT

java.lang.Integer

integer

INTEGER

java.lang.BigInteger

long

LONG

java.lang.Long

long

NOTATION

javax.xml.namespace.QName

string

QNAME

javax.xml.namespace.QName

string

SHORT

java.lang.Short

short

STRING

java.lang.String

string

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)

Enables versioning of a document.

enableDocumentVersioning (rid)

Disables 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 Document above

 

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.

 

 

End of Content Area