CRLSXDM Class Reference

class CRLSXDM : public CActive

This class is used for RLS XDM. Refer to OMA 'Resource List Server (RLS) XDM Specification'. The class maintains a so called current path information, which can be manipulated using specific functions. The elements adding, removing, getting etc are performed on current path. However, 'service' uri nodes related functions are always treated on document root. The class also applies restrictions on adding elements on certain paths, to comply with OMA specifications. Some servers does not allow empty 'list' or 'service' uri nodes, the class provides functions to delete those from the whole document.

rlspresxdm.lib
Since
S60 3.2

Inherits from

Public Member Functions
~CRLSXDM()
IMPORT_C TIntAddElementL(const TDesC &, const TDesC &, const TDesC &)
IMPORT_C TIntAddServiceURIL(const TDesC &)
IMPORT_C voidCancelUpdateL()
IMPORT_C voidDeleteAll()
IMPORT_C TIntDeleteAllEmptyLists(MRLSPresXDMAsyncHandler *const )
IMPORT_C voidDeleteAllEmptyServiceUrisL()
IMPORT_C voidGetCurrentPathL(CDesCArray &)
IMPORT_C TIntGetDisplayName(const TDesC &, const TDesC &, TPtrC8 &)
IMPORT_C voidGetElementsL(const TDesC &, CDesCArray &)
IMPORT_C voidGetServiceUrisL(CDesCArray &)
IMPORT_C TBoolIsElementExist(const TDesC &, const TDesC &)
IMPORT_C TBoolIsExistServiceURI(const TDesC &)
IMPORT_C TPtrCNegotiatedServiceUri()
IMPORT_C CRLSXDM *NewL(const TInt)
IMPORT_C CRLSXDM *NewLC(const TInt)
IMPORT_C TIntRemoveElementL(const TDesC &, const TDesC &)
IMPORT_C TIntRemoveServiceURIL(const TDesC &)
IMPORT_C TIntRenameListL(const TDesC &, const TDesC &)
IMPORT_C TIntSetCurrentpathL(const MDesCArray &)
IMPORT_C voidSwitchOutFromList()
IMPORT_C TIntSwitchToListL(const TDesC &)
IMPORT_C TIntSwitchToServiceURIL(const TDesC &)
IMPORT_C TIntUpdateAllFromServerL(MRLSPresXDMAsyncHandler *const )
IMPORT_C TIntUpdateDisplayNameL(const TDesC &, const TDesC &, const TDesC &)
IMPORT_C TIntUpdateToServerL(MRLSPresXDMAsyncHandler *const )
Private Member Functions
CRLSXDM()
voidAddLeafElementL(const TDesC &, const TDesC &, CXdmDocumentNode *const )
voidAddNonLeafElementL(const TDesC &, const TDesC &, const TDesC &, CXdmDocumentNode *const )
voidAddPackageL()
voidConstructL(const TInt)
voidCreateRootIfNeededL()
voidDeleteEmptyListsL()
voidDoCancel()
voidDoParseNegotiatedServiceUriL(CXdmDocumentNode *)
TInt GetDisplayNameInt(const TDesC &, const TDesC &, TPtrC8 &, CXdmDocumentNode *const )
CXdmDocumentNode *GetLeafChild(const TDesC &, const TDesC &, CXdmDocumentNode *const )
voidGetLeafElementsL(const TDesC &, CDesCArray &, CXdmDocumentNode *const )
CXdmDocumentNode *GetNonLeafChild(const TDesC &, const TDesC &, CXdmDocumentNode *const )
voidGetNonLeafElementAttrName(const TDesC &, TDes &)
voidGetNonLeafElementsL(const TDesC &, CDesCArray &, CXdmDocumentNode *const )
TBool IsNonLeafElementValid(const TDesC &)
CXdmDocumentNode *IsServiceUriExist(const TDesC &, CXdmDocumentNode *)
voidRemovePackageL()
TInt RunError(TInt)
voidRunL()
TInt UpdateDisplayNameIntL(const TDesC &, const TDesC &, const TDesC &, CXdmDocumentNode *const )
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
CActive::Extension_(TUint,TAny *&,TAny *)
CActive::IsActive()const
CActive::IsAdded()const
CActive::Priority()const
CActive::SetActive()
CActive::SetPriority(TInt)
CActive::~CActive()
CBase::CBase()
CBase::Delete(CBase *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Inherited Enumerations
CActive:TPriority
Private Attributes
MRLSPresXDMAsyncHandler *iAsyncHandler
TInt iAsyncReq
CDesCArray *iListPath
RPointerArray< CXdmDocumentNode >iListPointerPath
HBufC *iNegotiatedServiceUri
CXdmDocument *iRLSDocument
CXdmEngine *iXDMEngine
CXdmProtocolInfo *iXDMProtocolInfo
Inherited Attributes
CActive::iStatus

Constructor & Destructor Documentation

CRLSXDM()

CRLSXDM()[private]

C++ constructor

~CRLSXDM()

~CRLSXDM()

Destructor

Member Functions Documentation

AddElementL(const TDesC &, const TDesC &, const TDesC &)

IMPORT_C TIntAddElementL(const TDesC &aElementType,
const TDesC &aData,
const TDesC &aDisplayName
)

Adds an element to current path, only 'list' and 'resource-list' elements can be added to the root of ServiceURI, to add any of other elements current path should be inside an existing list. aDisplayName is optional and KNullDesC can be provided if display name is not desired. Note that leaf element type can not have display-name so in that case display-name is always discarded.

Parameters

const TDesC & aElementType
const TDesC & aDataname in case of list, value of element's attribute for other elements. In case of resource-list this is the link.
const TDesC & aDisplayNamedisplay name of the element, use KNullDesC if display-name is not required.

AddLeafElementL(const TDesC &, const TDesC &, CXdmDocumentNode *const)

voidAddLeafElementL(const TDesC &aElementType,
const TDesC &aData,
CXdmDocumentNode *const aTargetNode
)[private]

Adds a leaf element to current path, only 'resource-list' element can be added to the root of ServiceURI. This functions doesnt care whether element already exist or not.

Parameters

const TDesC & aElementType
const TDesC & aDatavalue of the element
CXdmDocumentNode *const aTargetNodepointer to target node

AddNonLeafElementL(const TDesC &, const TDesC &, const TDesC &, CXdmDocumentNode *const)

voidAddNonLeafElementL(const TDesC &aElementType,
const TDesC &aData,
const TDesC &aDisplayName,
CXdmDocumentNode *const aTargetNode
)[private]

Adds a non leaf element to current path, only 'list' element can be added to the root of ServiceURI, to add any of other possible elements current path should be inside an existing list. This functions doesnt care whether element already exist or not.

Parameters

const TDesC & aElementType
const TDesC & aDataname in case of list, value of element's attribute for other elements.
const TDesC & aDisplayNamedisplay name of the element
CXdmDocumentNode *const aTargetNodepointer to target node

AddPackageL()

voidAddPackageL()[private]

Adds the compulsory package node to current service uri in case no current uri found, does nothing. This function needed because some servers wants package as the last child node of service uri node.

AddServiceURIL(const TDesC &)

IMPORT_C TIntAddServiceURIL(const TDesC &aServiceURI)

Add a new service URI

Parameters

const TDesC & aServiceURI

CancelUpdateL()

IMPORT_C voidCancelUpdateL()

Cancels document update to/from server if going on. This results in HandleRLSUpdateCancelL on completion.

ConstructL(const TInt)

voidConstructL(const TIntaSettingId)[private]

Second phase constructor

Parameters

const TInt aSettingId

CreateRootIfNeededL()

voidCreateRootIfNeededL()[private]

Creates the document root if needed

DeleteAll()

IMPORT_C voidDeleteAll()

Delete all data by deleting all service uris. It also resets the path.

DeleteAllEmptyLists(MRLSPresXDMAsyncHandler *const)

IMPORT_C TIntDeleteAllEmptyLists(MRLSPresXDMAsyncHandler *const aHandler)

Async. function. Deletes all lists in the document which doesnt have any lists or entries. This function is very useful with the servers which doesnt accept empty lists. Note that as a side effect of this call, the path information is deleted. Results in HandleRLSDeleteAllEmptyListsL upon completion. If empty service-uris also needed to be deleted, DeleteAllEmptyServiceUrisL must be called after calling this function.

Parameters

MRLSPresXDMAsyncHandler *const aHandler

DeleteAllEmptyServiceUrisL()

IMPORT_C voidDeleteAllEmptyServiceUrisL()

Deletes all service-uris in the document which doesnt have any lists. This function is very useful with the servers which doesnt accept empty service uris. Note that as a side effect of this call, the path information is deleted. If emtpy lists also needed to be deleted, DeleteAllEmptyListsL must be called before calling this function.

DeleteEmptyListsL()

voidDeleteEmptyListsL()[private]

Internal function for deleting empty lists, keep called by RunL until all lists are deleted.

DoCancel()

voidDoCancel()[private, virtual]

From CActive

DoParseNegotiatedServiceUriL(CXdmDocumentNode *)

voidDoParseNegotiatedServiceUriL(CXdmDocumentNode *aErrorBody)[private]

Parse Serice URI negotiation response body and save it into iNegotiatedServiceUri.

Parameters

CXdmDocumentNode * aErrorBodyHTTP 409 error body

GetCurrentPathL(CDesCArray &)

IMPORT_C voidGetCurrentPathL(CDesCArray &aPath)

This gives complete hierarchy of the current path. The first element of the array will be ServiceURI, and after that will be child lists, The current list name is the last element of the array.

Parameters

CDesCArray & aPath

GetDisplayName(const TDesC &, const TDesC &, TPtrC8 &)

IMPORT_C TIntGetDisplayName(const TDesC &aElementType,
const TDesC &aData,
TPtrC8 &aDisplayName
)

Gets display name of an element. Only applicable to those elements which can have a display name.

Parameters

const TDesC & aElementType
const TDesC & aDataname in case of list, value of element's attribute for other elements.
TPtrC8 & aDisplayNamedisplay name of the element

GetDisplayNameInt(const TDesC &, const TDesC &, TPtrC8 &, CXdmDocumentNode *const)

TInt GetDisplayNameInt(const TDesC &aElementType,
const TDesC &aData,
TPtrC8 &aDisplayName,
CXdmDocumentNode *const aTargetNode
)[private]

Gets display name of a non leaf element.

Parameters

const TDesC & aElementType
const TDesC & aDataname in case of list, value of element's attribute for other elements.
TPtrC8 & aDisplayNamedisplay name of the element
CXdmDocumentNode *const aTargetNodepointer to target node

GetElementsL(const TDesC &, CDesCArray &)

IMPORT_C voidGetElementsL(const TDesC &aElementType,
CDesCArray &aValues
)

Get all elements of same type at given node path

Parameters

const TDesC & aElementType
CDesCArray & aValuesarray of data values. 'name' in case of list or value of element's attribute for other element types.

GetLeafChild(const TDesC &, const TDesC &, CXdmDocumentNode *const)

CXdmDocumentNode *GetLeafChild(const TDesC &aChildName,
const TDesC &aValue,
CXdmDocumentNode *const aTargetNode
)[private]

Get list's leaf child. These includes getting of resource-list and packages

Parameters

const TDesC & aChildName
const TDesC & aValuevalue to match with
CXdmDocumentNode *const aTargetNodepointer to target node

GetLeafElementsL(const TDesC &, CDesCArray &, CXdmDocumentNode *const)

voidGetLeafElementsL(const TDesC &aElementType,
CDesCArray &aValues,
CXdmDocumentNode *const aTargetNode
)[private]

Get all elements of same type at given node path

Parameters

const TDesC & aElementType
CDesCArray & aValuesarray of data values. 'name' in case of list or value of element's attribute for other element types.
CXdmDocumentNode *const aTargetNodepointer to target node

GetNonLeafChild(const TDesC &, const TDesC &, CXdmDocumentNode *const)

CXdmDocumentNode *GetNonLeafChild(const TDesC &aChildName,
const TDesC &aAttrValue,
CXdmDocumentNode *const aTargetNode
)[private]

Get list's non-leaf child. These includes getting of list, entry external and entry ref.

Parameters

const TDesC & aChildName
const TDesC & aAttrValuevalue of attribute to match with
CXdmDocumentNode *const aTargetNodepointer to target node

GetNonLeafElementAttrName(const TDesC &, TDes &)

voidGetNonLeafElementAttrName(const TDesC &aElementName,
TDes &aAttrName
)[private]

Return the attribute name used for the element. Only valid for non-leaf elements.

Parameters

const TDesC & aElementName
TDes & aAttrNamename of the attribute returns here

GetNonLeafElementsL(const TDesC &, CDesCArray &, CXdmDocumentNode *const)

voidGetNonLeafElementsL(const TDesC &aElementType,
CDesCArray &aValues,
CXdmDocumentNode *const aTargetNode
)[private]

Get all elements of same type at given node path

Parameters

const TDesC & aElementType
CDesCArray & aValuesarray of data values. 'name' in case of list or value of element's attribute for other element types.
CXdmDocumentNode *const aTargetNodepointer to target node

GetServiceUrisL(CDesCArray &)

IMPORT_C voidGetServiceUrisL(CDesCArray &aServiceUris)

Get all Service Uri(s) in current document

Parameters

CDesCArray & aServiceUris

IsElementExist(const TDesC &, const TDesC &)

IMPORT_C TBoolIsElementExist(const TDesC &aElementType,
const TDesC &aData
)

Is element exist on the current path

Parameters

const TDesC & aElementType
const TDesC & aDataname in case of list, value of element's attribute for other elements.

IsExistServiceURI(const TDesC &)

IMPORT_C TBoolIsExistServiceURI(const TDesC &aServiceURI)

Return ETrue if service URI is exist with given name

Parameters

const TDesC & aServiceURI

IsNonLeafElementValid(const TDesC &)

TBool IsNonLeafElementValid(const TDesC &aElementName)[private]

Validates the given non-leaf element.

Parameters

const TDesC & aElementName

IsServiceUriExist(const TDesC &, CXdmDocumentNode *)

CXdmDocumentNode *IsServiceUriExist(const TDesC &aUriAttr,
CXdmDocumentNode *aRootNode
)[private]

Return pointer to serviceUri and its attribute value

Parameters

const TDesC & aUriAttr
CXdmDocumentNode * aRootNode

NegotiatedServiceUri()

IMPORT_C TPtrCNegotiatedServiceUri()

Accessor for the last negotiated RLS service URI. URI is Zero length if the last HTTP PUT did not receive HTTP 409 error or if there was no <alt-value> value in the response body.

NewL(const TInt)

IMPORT_C CRLSXDM *NewL(const TIntaSettingId)[static]

Creates CRLSXDM

Parameters

const TInt aSettingId

NewLC(const TInt)

IMPORT_C CRLSXDM *NewLC(const TIntaSettingId)[static]

Create CRLSXDM, leaves pointer to stack

Parameters

const TInt aSettingId

RemoveElementL(const TDesC &, const TDesC &)

IMPORT_C TIntRemoveElementL(const TDesC &aElementType,
const TDesC &aData
)

Removes the given element from the current path

Parameters

const TDesC & aElementType
const TDesC & aDataname in case of list, value of element's attribute for other elements.

RemovePackageL()

voidRemovePackageL()[private]

Removes the compulsory package node to current service uri in case no current uri found, does nothing. This function needed because some servers wants package as the last child node of service uri node.

RemoveServiceURIL(const TDesC &)

IMPORT_C TIntRemoveServiceURIL(const TDesC &aServiceURI)

Removes a service URI (and all lists/Entries it holds). Current path will be reset if this service exists in current path

Parameters

const TDesC & aServiceURI

RenameListL(const TDesC &, const TDesC &)

IMPORT_C TIntRenameListL(const TDesC &aListName,
const TDesC &aListNewName
)

Renames a 'list' element

Parameters

const TDesC & aListName
const TDesC & aListNewName

RunError(TInt)

TInt RunError(TIntaError)[private, virtual]

From CActive

Parameters

TInt aError

RunL()

voidRunL()[private, virtual]

From CActive

SetCurrentpathL(const MDesCArray &)

IMPORT_C TIntSetCurrentpathL(const MDesCArray &aListsNames)

Set the current path according to given hierarchy. The first element of the array must be the ServiceURI, with child lists to follow. The target list name is the last element of the array. If the list is not found according to the given heirarchy, the current path will not be changed and KErrNotFound will be returned. An empty array will cause the path to be completely empty.

Parameters

const MDesCArray & aListsNames

SwitchOutFromList()

IMPORT_C voidSwitchOutFromList()

Switch out from current list, if path is already service-uri level nothing will happed. This corresponds to gettting out from a directory. The Current path changes if successful

SwitchToListL(const TDesC &)

IMPORT_C TIntSwitchToListL(const TDesC &aListName)

Switch into given list. After this the given list will become currently pointed list (path), and all operations will be performed in this path. This corresponds to entering into a directory in DOS

Parameters

const TDesC & aListName

SwitchToServiceURIL(const TDesC &)

IMPORT_C TIntSwitchToServiceURIL(const TDesC &aServiceURI)

Switch into given service URI. After this the given ServiceURI will become currently pointed URI, and all operations will be performed on this URI. This corresponds to entering into a disk in DOS

Parameters

const TDesC & aServiceURI

UpdateAllFromServerL(MRLSPresXDMAsyncHandler *const)

IMPORT_C TIntUpdateAllFromServerL(MRLSPresXDMAsyncHandler *const aHandler)

Updates all information (document) from server. This results in HandleRLSUpdateFromServerL on completion.

Parameters

MRLSPresXDMAsyncHandler *const aHandler

UpdateDisplayNameIntL(const TDesC &, const TDesC &, const TDesC &, CXdmDocumentNode *const)

TInt UpdateDisplayNameIntL(const TDesC &aElementType,
const TDesC &aData,
const TDesC &aDisplayName,
CXdmDocumentNode *const aTargetNode
)[private]

Updates display name of an element.

Parameters

const TDesC & aElementType
const TDesC & aDataname in case of list, value of element's attribute for other elements.
const TDesC & aDisplayNamedisplay name of the element
CXdmDocumentNode *const aTargetNodepointer to target node

UpdateDisplayNameL(const TDesC &, const TDesC &, const TDesC &)

IMPORT_C TIntUpdateDisplayNameL(const TDesC &aElementType,
const TDesC &aData,
const TDesC &aDisplayName
)

Updates display name of an element.

Parameters

const TDesC & aElementType
const TDesC & aDataname in case of list, value of element's attribute for other elements.
const TDesC & aDisplayNamedisplay name of the element

UpdateToServerL(MRLSPresXDMAsyncHandler *const)

IMPORT_C TIntUpdateToServerL(MRLSPresXDMAsyncHandler *const aHandler)

Updates information (document) to server. This results in HandleRLSUpdateToServerL on completion.

Parameters

MRLSPresXDMAsyncHandler *const aHandler

Member Data Documentation

MRLSPresXDMAsyncHandler * iAsyncHandler

MRLSPresXDMAsyncHandler *iAsyncHandler[private]

TInt iAsyncReq

TInt iAsyncReq[private]

CDesCArray * iListPath

CDesCArray *iListPath[private]

RPointerArray< CXdmDocumentNode > iListPointerPath

RPointerArray< CXdmDocumentNode >iListPointerPath[private]

HBufC * iNegotiatedServiceUri

HBufC *iNegotiatedServiceUri[private]

Negotiated RLS service URI Own

CXdmDocument * iRLSDocument

CXdmDocument *iRLSDocument[private]

CXdmEngine * iXDMEngine

CXdmEngine *iXDMEngine[private]

CXdmProtocolInfo * iXDMProtocolInfo

CXdmProtocolInfo *iXDMProtocolInfo[private]