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 TInt AddElementL (const TDesC &, const TDesC &, const TDesC &)
IMPORT_C TInt AddServiceURIL (const TDesC &)
IMPORT_C void CancelUpdateL ()
IMPORT_C void DeleteAll ()
IMPORT_C TInt DeleteAllEmptyLists ( MRLSPresXDMAsyncHandler *const )
IMPORT_C void DeleteAllEmptyServiceUrisL ()
IMPORT_C void GetCurrentPathL ( CDesCArray &)
IMPORT_C TInt GetDisplayName (const TDesC &, const TDesC &, TPtrC8 &)
IMPORT_C void GetElementsL (const TDesC &, CDesCArray &)
IMPORT_C void GetServiceUrisL ( CDesCArray &)
IMPORT_C TBool IsElementExist (const TDesC &, const TDesC &)
IMPORT_C TBool IsExistServiceURI (const TDesC &)
IMPORT_C TPtrC NegotiatedServiceUri ()
IMPORT_C CRLSXDM * NewL (const TInt )
IMPORT_C CRLSXDM * NewLC (const TInt )
IMPORT_C TInt RemoveElementL (const TDesC &, const TDesC &)
IMPORT_C TInt RemoveServiceURIL (const TDesC &)
IMPORT_C TInt RenameListL (const TDesC &, const TDesC &)
IMPORT_C TInt SetCurrentpathL (const MDesCArray &)
IMPORT_C void SwitchOutFromList ()
IMPORT_C TInt SwitchToListL (const TDesC &)
IMPORT_C TInt SwitchToServiceURIL (const TDesC &)
IMPORT_C TInt UpdateAllFromServerL ( MRLSPresXDMAsyncHandler *const )
IMPORT_C TInt UpdateDisplayNameL (const TDesC &, const TDesC &, const TDesC &)
IMPORT_C TInt UpdateToServerL ( MRLSPresXDMAsyncHandler *const )
Private Member Functions
CRLSXDM ()
void AddLeafElementL (const TDesC &, const TDesC &, CXdmDocumentNode *const )
void AddNonLeafElementL (const TDesC &, const TDesC &, const TDesC &, CXdmDocumentNode *const )
void AddPackageL ()
void ConstructL (const TInt )
void CreateRootIfNeededL ()
void DeleteEmptyListsL ()
void DoCancel ()
void DoParseNegotiatedServiceUriL ( CXdmDocumentNode *)
TInt GetDisplayNameInt (const TDesC &, const TDesC &, TPtrC8 &, CXdmDocumentNode *const )
CXdmDocumentNode * GetLeafChild (const TDesC &, const TDesC &, CXdmDocumentNode *const )
void GetLeafElementsL (const TDesC &, CDesCArray &, CXdmDocumentNode *const )
CXdmDocumentNode * GetNonLeafChild (const TDesC &, const TDesC &, CXdmDocumentNode *const )
void GetNonLeafElementAttrName (const TDesC &, TDes &)
void GetNonLeafElementsL (const TDesC &, CDesCArray &, CXdmDocumentNode *const )
TBool IsNonLeafElementValid (const TDesC &)
CXdmDocumentNode * IsServiceUriExist (const TDesC &, CXdmDocumentNode *)
void RemovePackageL ()
TInt RunError ( TInt )
void RunL ()
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 TInt AddElementL ( 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 & aData name in case of list, value of element's attribute for other elements. In case of resource-list this is the link.
const TDesC & aDisplayName display name of the element, use KNullDesC if display-name is not required.

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

void AddLeafElementL ( 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 & aData value of the element
CXdmDocumentNode *const aTargetNode pointer to target node

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

void AddNonLeafElementL ( 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 & aData name in case of list, value of element's attribute for other elements.
const TDesC & aDisplayName display name of the element
CXdmDocumentNode *const aTargetNode pointer to target node

AddPackageL()

void AddPackageL ( ) [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 TInt AddServiceURIL ( const TDesC & aServiceURI )

Add a new service URI

Parameters

const TDesC & aServiceURI

CancelUpdateL()

IMPORT_C void CancelUpdateL ( )

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

ConstructL(const TInt)

void ConstructL ( const TInt aSettingId ) [private]

Second phase constructor

Parameters

const TInt aSettingId

CreateRootIfNeededL()

void CreateRootIfNeededL ( ) [private]

Creates the document root if needed

DeleteAll()

IMPORT_C void DeleteAll ( )

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

DeleteAllEmptyLists(MRLSPresXDMAsyncHandler *const)

IMPORT_C TInt DeleteAllEmptyLists ( 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 void DeleteAllEmptyServiceUrisL ( )

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()

void DeleteEmptyListsL ( ) [private]

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

DoCancel()

void DoCancel ( ) [private, virtual]

DoParseNegotiatedServiceUriL(CXdmDocumentNode *)

void DoParseNegotiatedServiceUriL ( CXdmDocumentNode * aErrorBody ) [private]

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

Parameters

CXdmDocumentNode * aErrorBody HTTP 409 error body

GetCurrentPathL(CDesCArray &)

IMPORT_C void GetCurrentPathL ( 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 TInt GetDisplayName ( 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 & aData name in case of list, value of element's attribute for other elements.
TPtrC8 & aDisplayName display 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 & aData name in case of list, value of element's attribute for other elements.
TPtrC8 & aDisplayName display name of the element
CXdmDocumentNode *const aTargetNode pointer to target node

GetElementsL(const TDesC &, CDesCArray &)

IMPORT_C void GetElementsL ( const TDesC & aElementType,
CDesCArray & aValues
)

Get all elements of same type at given node path

Parameters

const TDesC & aElementType
CDesCArray & aValues array 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 & aValue value to match with
CXdmDocumentNode *const aTargetNode pointer to target node

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

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

Get all elements of same type at given node path

Parameters

const TDesC & aElementType
CDesCArray & aValues array of data values. 'name' in case of list or value of element's attribute for other element types.
CXdmDocumentNode *const aTargetNode pointer 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 & aAttrValue value of attribute to match with
CXdmDocumentNode *const aTargetNode pointer to target node

GetNonLeafElementAttrName(const TDesC &, TDes &)

void GetNonLeafElementAttrName ( 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 & aAttrName name of the attribute returns here

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

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

Get all elements of same type at given node path

Parameters

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

GetServiceUrisL(CDesCArray &)

IMPORT_C void GetServiceUrisL ( CDesCArray & aServiceUris )

Get all Service Uri(s) in current document

Parameters

CDesCArray & aServiceUris

IsElementExist(const TDesC &, const TDesC &)

IMPORT_C TBool IsElementExist ( const TDesC & aElementType,
const TDesC & aData
)

Is element exist on the current path

Parameters

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

IsExistServiceURI(const TDesC &)

IMPORT_C TBool IsExistServiceURI ( 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 TPtrC NegotiatedServiceUri ( )

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 TInt aSettingId ) [static]

Creates CRLSXDM

Parameters

const TInt aSettingId

NewLC(const TInt)

IMPORT_C CRLSXDM * NewLC ( const TInt aSettingId ) [static]

Create CRLSXDM , leaves pointer to stack

Parameters

const TInt aSettingId

RemoveElementL(const TDesC &, const TDesC &)

IMPORT_C TInt RemoveElementL ( const TDesC & aElementType,
const TDesC & aData
)

Removes the given element from the current path

Parameters

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

RemovePackageL()

void RemovePackageL ( ) [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 TInt RemoveServiceURIL ( 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 TInt RenameListL ( const TDesC & aListName,
const TDesC & aListNewName
)

Renames a 'list' element

Parameters

const TDesC & aListName
const TDesC & aListNewName

RunError(TInt)

TInt RunError ( TInt aError ) [private, virtual]

Parameters

TInt aError

RunL()

void RunL ( ) [private, virtual]

SetCurrentpathL(const MDesCArray &)

IMPORT_C TInt SetCurrentpathL ( 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 void SwitchOutFromList ( )

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 TInt SwitchToListL ( 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 TInt SwitchToServiceURIL ( 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 TInt UpdateAllFromServerL ( 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 & aData name in case of list, value of element's attribute for other elements.
const TDesC & aDisplayName display name of the element
CXdmDocumentNode *const aTargetNode pointer to target node

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

IMPORT_C TInt UpdateDisplayNameL ( const TDesC & aElementType,
const TDesC & aData,
const TDesC & aDisplayName
)

Updates display name of an element.

Parameters

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

UpdateToServerL(MRLSPresXDMAsyncHandler *const)

IMPORT_C TInt UpdateToServerL ( 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]