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.
Inherited Enumerations | |
---|---|
CActive:TPriority |
Inherited Attributes | |
---|---|
CActive::iStatus |
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.
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.
const TDesC & aElementType | |
const TDesC & aData | value of the element |
CXdmDocumentNode *const aTargetNode | pointer to target node |
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.
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 |
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.
IMPORT_C TInt | AddServiceURIL | ( | const TDesC & | aServiceURI | ) |
Add a new service URI
const TDesC & aServiceURI |
IMPORT_C void | CancelUpdateL | ( | ) |
Cancels document update to/from server if going on. This results in HandleRLSUpdateCancelL on completion.
void | ConstructL | ( | const TInt | aSettingId | ) | [private] |
Second phase constructor
const TInt aSettingId |
IMPORT_C void | DeleteAll | ( | ) |
Delete all data by deleting all service uris. It also resets the path.
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.
MRLSPresXDMAsyncHandler *const aHandler |
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.
void | DeleteEmptyListsL | ( | ) | [private] |
Internal function for deleting empty lists, keep called by RunL until all lists are deleted.
void | DoParseNegotiatedServiceUriL | ( | CXdmDocumentNode * | aErrorBody | ) | [private] |
Parse Serice URI negotiation response body and save it into iNegotiatedServiceUri.
CXdmDocumentNode * aErrorBody | HTTP 409 error body |
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.
CDesCArray & aPath |
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.
TInt | GetDisplayNameInt | ( | const TDesC & | aElementType, |
const TDesC & | aData, | |||
TPtrC8 & | aDisplayName, | |||
CXdmDocumentNode *const | aTargetNode | |||
) | [private] |
Gets display name of a non leaf element.
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 |
IMPORT_C void | GetElementsL | ( | const TDesC & | aElementType, |
CDesCArray & | aValues | |||
) |
Get all elements of same type at given node path
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 * | GetLeafChild | ( | const TDesC & | aChildName, |
const TDesC & | aValue, | |||
CXdmDocumentNode *const | aTargetNode | |||
) | [private] |
Get list's leaf child. These includes getting of resource-list and packages
const TDesC & aChildName | |
const TDesC & aValue | value to match with |
CXdmDocumentNode *const aTargetNode | pointer to target node |
void | GetLeafElementsL | ( | const TDesC & | aElementType, |
CDesCArray & | aValues, | |||
CXdmDocumentNode *const | aTargetNode | |||
) | [private] |
Get all elements of same type at given node path
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 |
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.
const TDesC & aChildName | |
const TDesC & aAttrValue | value of attribute to match with |
CXdmDocumentNode *const aTargetNode | pointer to target node |
void | GetNonLeafElementAttrName | ( | const TDesC & | aElementName, |
TDes & | aAttrName | |||
) | [private] |
Return the attribute name used for the element. Only valid for non-leaf elements.
void | GetNonLeafElementsL | ( | const TDesC & | aElementType, |
CDesCArray & | aValues, | |||
CXdmDocumentNode *const | aTargetNode | |||
) | [private] |
Get all elements of same type at given node path
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 |
IMPORT_C void | GetServiceUrisL | ( | CDesCArray & | aServiceUris | ) |
Get all Service Uri(s) in current document
CDesCArray & aServiceUris |
IMPORT_C TBool | IsElementExist | ( | const TDesC & | aElementType, |
const TDesC & | aData | |||
) |
Is element exist on the current path
IMPORT_C TBool | IsExistServiceURI | ( | const TDesC & | aServiceURI | ) |
Return ETrue if service URI is exist with given name
const TDesC & aServiceURI |
TBool | IsNonLeafElementValid | ( | const TDesC & | aElementName | ) | [private] |
Validates the given non-leaf element.
const TDesC & aElementName |
CXdmDocumentNode * | IsServiceUriExist | ( | const TDesC & | aUriAttr, |
CXdmDocumentNode * | aRootNode | |||
) | [private] |
Return pointer to serviceUri and its attribute value
const TDesC & aUriAttr | |
CXdmDocumentNode * aRootNode |
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.
IMPORT_C CRLSXDM * | NewL | ( | const TInt | aSettingId | ) | [static] |
Creates CRLSXDM
const TInt aSettingId |
IMPORT_C CRLSXDM * | NewLC | ( | const TInt | aSettingId | ) | [static] |
Create CRLSXDM , leaves pointer to stack
const TInt aSettingId |
IMPORT_C TInt | RemoveElementL | ( | const TDesC & | aElementType, |
const TDesC & | aData | |||
) |
Removes the given element from the current path
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.
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
const TDesC & aServiceURI |
IMPORT_C TInt | RenameListL | ( | const TDesC & | aListName, |
const TDesC & | aListNewName | |||
) |
Renames a 'list' element
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.
const MDesCArray & aListsNames |
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
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
const TDesC & aListName |
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
const TDesC & aServiceURI |
IMPORT_C TInt | UpdateAllFromServerL | ( | MRLSPresXDMAsyncHandler *const | aHandler | ) |
Updates all information (document) from server. This results in HandleRLSUpdateFromServerL on completion.
MRLSPresXDMAsyncHandler *const aHandler |
TInt | UpdateDisplayNameIntL | ( | const TDesC & | aElementType, |
const TDesC & | aData, | |||
const TDesC & | aDisplayName, | |||
CXdmDocumentNode *const | aTargetNode | |||
) | [private] |
Updates display name of an element.
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 |
IMPORT_C TInt | UpdateDisplayNameL | ( | const TDesC & | aElementType, |
const TDesC & | aData, | |||
const TDesC & | aDisplayName | |||
) |
Updates display name of an element.
IMPORT_C TInt | UpdateToServerL | ( | MRLSPresXDMAsyncHandler *const | aHandler | ) |
Updates information (document) to server. This results in HandleRLSUpdateToServerL on completion.
MRLSPresXDMAsyncHandler *const aHandler |
RPointerArray < CXdmDocumentNode > | iListPointerPath | [private] |
HBufC * | iNegotiatedServiceUri | [private] |
Negotiated RLS service URI Own
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.