nsIPlacesTransactionsService Interface Reference

import"nsIPlacesTransactionsService.idl";

Inheritance diagram for nsIPlacesTransactionsService:
[legend]
Collaboration diagram for nsIPlacesTransactionsService:
[legend]

Public Member Functions

nsITransaction aggregateTransactions (in AString aName, in nsIVariant aTransactions)
 
nsITransaction createFolder (in AString aName, in long long aContainerId, [optional] in long long aIndex, [optional] in nsIVariant aAnnotations, [optional] in nsIVariant aChildItemsTransactions)
 
nsITransaction createItem (in nsIURI aURI, in long long aContainerId, [optional] in long long aIndex, [optional] in AString aTitle, [optional] in AString aKeyword, [optional] in nsIVariant aAnnotations, [optional] in nsIVariant aChildTransactions)
 
nsITransaction createSeparator (in long long aContainerId, [optional] in long long aIndex)
 
nsITransaction createLivemark (in nsIURI aFeedURI, in nsIURI aSiteURI, in AString aName, in long long aContainerId, [optional] in long long aIndex, [optional] in nsIVariant aAnnotations)
 
nsITransaction moveItem (in long long aItemId, in long long aNewContainerId, in long long aNewIndex)
 
nsITransaction removeItem (in long long aItemId)
 
nsITransaction editItemTitle (in long long aItemId, in AString aNewTitle)
 
nsITransaction editBookmarkURI (in long long aBookmarkId, in nsIURI aNewURI)
 
nsITransaction setItemAnnotation (in nsIVariant aItemId, in nsIVariant aAnnotationObject)
 
nsITransaction setPageAnnotation (in nsIURI aURI, in nsIVariant aAnnotationObject)
 
nsITransaction setLoadInSidebar (in long long aBookmarkId, in boolean aLoadInSidebar)
 
nsITransaction editItemDescription (in long long aItemId, in AString aDescription)
 
nsITransaction editBookmarkKeyword (in long long aBookmarkId, in AString aNewKeyword)
 
nsITransaction editBookmarkPostData (in long long aBookmarkId, in AString aPostData)
 
nsITransaction editLivemarkSiteURI (in long long aLivemarkId, in nsIURI aURI)
 
nsITransaction editLivemarkFeedURI (in long long aLivemarkId, in nsIURI aURI)
 
nsITransaction editBookmarkMicrosummary (in long long aBookmarkId, in nsIMicrosummary aNewMicrosummary)
 
nsITransaction editItemDateAdded (in long long aItemId, in PRTime aNewDateAdded)
 
nsITransaction editItemLastModified (in long long aItemId, in PRTime aNewLastModified)
 
nsITransaction sortFolderByName (in long long aFolderId)
 
nsITransaction tagURI (in nsIURI aURI, in nsIVariant aTags)
 
nsITransaction untagURI (in nsIURI aURI, in nsIVariant aTags)
 

Detailed Description

nsIPlacesTransactionService is a service designed to handle nsITransactions that correspond to changes in Places. It is here as a service so that we can keep the transactions around without holding onto the global scope of a js window.

NOTE: If you are interacting directly with the Places back-end, and you need to transactionalize a large amount of changes, look at nsINavBookmarksService.runInBatchMode.

Definition at line 60 of file nsIPlacesTransactionsService.idl.

Member Function Documentation

nsITransaction nsIPlacesTransactionsService::aggregateTransactions ( in AString  aName,
in nsIVariant  aTransactions 
)

Transaction for performing several Places Transactions in a single batch.

Parameters
aNametitle of the aggregate transactions
aTransactionsan array of transactions to perform
Returns
nsITransaction object
nsITransaction nsIPlacesTransactionsService::createFolder ( in AString  aName,
in long long  aContainerId,
[optional] in long long  aIndex,
[optional] in nsIVariant  aAnnotations,
[optional] in nsIVariant  aChildItemsTransactions 
)

Transaction for creating a new folder item.

Parameters
aNamethe name of the new folder
aContainerIdthe identifier of the folder in which the new folder should be added.
[optional]aIndex the index of the item in aContainer, pass -1 or nothing to create the item at the end of aContainer.
[optional]aAnnotations the annotations to set for the new folder.
[optional]aChildItemsTransactions array of transactions for items to be created under the new folder.
Returns
nsITransaction object
nsITransaction nsIPlacesTransactionsService::createItem ( in nsIURI  aURI,
in long long  aContainerId,
[optional] in long long  aIndex,
[optional] in AString  aTitle,
[optional] in AString  aKeyword,
[optional] in nsIVariant  aAnnotations,
[optional] in nsIVariant  aChildTransactions 
)

Transaction for creating a new bookmark item

Parameters
aURIthe uri of the new bookmark (nsIURI)
aContainerIdthe identifier of the folder in which the bookmark should be added.
[optional]aIndex the index of the item in aContainer, pass -1 or nothing to create the item at the end of aContainer.
[optional]aTitle the title of the new bookmark.
[optional]aKeyword the keyword of the new bookmark.
[optional]aAnnotations the annotations to set for the new bookmark.
[optional]aChildTransactions child transactions to commit after creating the bookmark. Prefer using any of the arguments above if possible. In general, a child transations should be used only if the change it does has to be reverted manually when removing the bookmark item. a child transaction must support setting its bookmark-item identifier via an "id" js setter.
Returns
nsITransaction object
nsITransaction nsIPlacesTransactionsService::createLivemark ( in nsIURI  aFeedURI,
in nsIURI  aSiteURI,
in AString  aName,
in long long  aContainerId,
[optional] in long long  aIndex,
[optional] in nsIVariant  aAnnotations 
)

Transaction for creating a new live-bookmark item.

See Also
nsILivemarksService::createLivemark for documentation regarding the first three arguments.
Parameters
aContainerIdthe identifier of the folder in which the live-bookmark should be added.
[optional]aIndex the index of the item in aContainer, pass -1 or nothing to create the item at the end of aContainer.
[optional]aAnnotations the annotations to set for the new live-bookmark.
Returns
nsITransaction object
nsITransaction nsIPlacesTransactionsService::createSeparator ( in long long  aContainerId,
[optional] in long long  aIndex 
)

Transaction for creating a new separator item

Parameters
aContainerIdthe identifier of the folder in which the separator should be added.
[optional]aIndex the index of the item in aContainer, pass -1 or nothing to create the separator at the end of aContainer.
Returns
nsITransaction object
nsITransaction nsIPlacesTransactionsService::editBookmarkKeyword ( in long long  aBookmarkId,
in AString  aNewKeyword 
)

Transaction for editing a bookmark's keyword.

Parameters
aBookmarkIdid of the bookmark to edit
aNewKeywordnew keyword for the bookmark
Returns
nsITransaction object
nsITransaction nsIPlacesTransactionsService::editBookmarkMicrosummary ( in long long  aBookmarkId,
in nsIMicrosummary  aNewMicrosummary 
)

Transaction for editing a bookmark's microsummary.

Parameters
aBookmarkIdid of the bookmark to edit
aNewMicrosummarynew microsummary for the bookmark
Returns
nsITransaction object
nsITransaction nsIPlacesTransactionsService::editBookmarkPostData ( in long long  aBookmarkId,
in AString  aPostData 
)

Transaction for editing the post data associated with a bookmark.

Parameters
aBookmarkIdid of the bookmark to edit
aPostDatapost data
Returns
nsITransaction object
nsITransaction nsIPlacesTransactionsService::editBookmarkURI ( in long long  aBookmarkId,
in nsIURI  aNewURI 
)

Transaction for editing a bookmark's uri.

Parameters
aBookmarkIdid of the bookmark to edit
aNewURInew uri for the bookmark
Returns
nsITransaction object
nsITransaction nsIPlacesTransactionsService::editItemDateAdded ( in long long  aItemId,
in PRTime  aNewDateAdded 
)

Transaction for editing an item's date added property.

Parameters
aItemIdid of the item to edit
aNewDateAddednew date added for the item
Returns
nsITransaction object
nsITransaction nsIPlacesTransactionsService::editItemDescription ( in long long  aItemId,
in AString  aDescription 
)

Transaction for editing a the description of a bookmark or a folder

Parameters
aItemIdid of the item to edit
aDescriptionnew description
Returns
nsITransaction object
nsITransaction nsIPlacesTransactionsService::editItemLastModified ( in long long  aItemId,
in PRTime  aNewLastModified 
)

Transaction for editing an item's last modified time.

Parameters
aItemIdid of the item to edit
aNewLastModifiednew last modified date for the item
Returns
nsITransaction object
nsITransaction nsIPlacesTransactionsService::editItemTitle ( in long long  aItemId,
in AString  aNewTitle 
)

Transaction for editting a bookmark's title.

Parameters
aItemIdid of the item to edit
aNewTitlenew title for the item to edit
Returns
nsITransaction object
nsITransaction nsIPlacesTransactionsService::editLivemarkFeedURI ( in long long  aLivemarkId,
in nsIURI  aURI 
)

Transaction for editting a live bookmark's feed URI.

Parameters
aLivemarkIdid of the livemark
aURInew feed uri
Returns
nsITransaction object
nsITransaction nsIPlacesTransactionsService::editLivemarkSiteURI ( in long long  aLivemarkId,
in nsIURI  aURI 
)

Transaction for editing a live bookmark's site URI.

Parameters
aLivemarkIdid of the livemark
aURInew site uri
Returns
nsITransaction object
nsITransaction nsIPlacesTransactionsService::moveItem ( in long long  aItemId,
in long long  aNewContainerId,
in long long  aNewIndex 
)

Transaction for moving an Item.

Parameters
aItemIdthe id of the item to move
aNewContainerIdid of the new container to move to
aNewIndexindex of the new position to move to
Returns
nsITransaction object
nsITransaction nsIPlacesTransactionsService::removeItem ( in long long  aItemId)

Transaction for removing an Item

Parameters
aItemIdid of the item to remove
Returns
nsITransaction object
nsITransaction nsIPlacesTransactionsService::setItemAnnotation ( in nsIVariant  aItemId,
in nsIVariant  aAnnotationObject 
)

Transaction for setting/unsetting an item annotation

Parameters
aItemIdid of the item where to set annotation
aAnnotationObjectObject representing an annotation, containing the following properties: name, flags, expires, type, mimeType (only used for binary annotations), value. If value is null the annotation will be removed
Returns
nsITransaction object
nsITransaction nsIPlacesTransactionsService::setLoadInSidebar ( in long long  aBookmarkId,
in boolean  aLoadInSidebar 
)

Transaction for setting/unsetting Load-in-sidebar annotation

Parameters
aBookmarkIdid of the bookmark where to set Load-in-sidebar annotation
aLoadInSidebarboolean value
Returns
nsITransaction object
nsITransaction nsIPlacesTransactionsService::setPageAnnotation ( in nsIURI  aURI,
in nsIVariant  aAnnotationObject 
)

Transaction for setting/unsetting a page annotation

Parameters
aURIURI of the page where to set annotation
aAnnotationObjectObject representing an annotation, containing the following properties: name, flags, expires, type, mimeType (only used for binary annotations), value. If value is null the annotation will be removed
Returns
nsITransaction object
nsITransaction nsIPlacesTransactionsService::sortFolderByName ( in long long  aFolderId)

Transaction for sorting a folder by name

Parameters
aFolderIdid of the folder to sort
Returns
nsITransaction object
nsITransaction nsIPlacesTransactionsService::tagURI ( in nsIURI  aURI,
in nsIVariant  aTags 
)

Transaction for tagging a URL with the given set of tags. Current tags set for the URL persist. It's the caller's job to check whether or not aURI was already tagged by any of the tags in aTags, undoing this tags transaction removes them all from aURL!

Parameters
aURIthe URL to tag.
aTagsArray of tags to set for the given URL.
nsITransaction nsIPlacesTransactionsService::untagURI ( in nsIURI  aURI,
in nsIVariant  aTags 
)

Transaction for removing tags from a URL. It's the caller's job to check whether or not aURI isn't tagged by any of the tags in aTags, undoing this tags transaction adds them all to aURL!

Parameters
aURIthe URL to un-tag.
aTagsArray of tags to unset. pass null to remove all tags from the given url.

The documentation for this interface was generated from the following file: