WARNING: Most of this content (with the exception of the Mozilla 1.9 XPCOM reference) is very old, and can be expected to be out of date and possibly obsolete. For better XUL documentation, please visit the XUL hub at the Mozilla Developer Center.

nsIPlacesTransactionsService

IID:d91e4575-14cf-497d-b497-bd47b40c50e3
Inherits From:nsITransactionManager

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.

This interface is implemented by the following components:


Methods

nsITransaction aggregateTransactions ( AString name , nsIVariant transactions ) nsITransaction createFolder ( AString name , PRInt64 container , PRInt64 index , nsIVariant annotations , nsIVariant childItemsTransactions ) nsITransaction createItem ( nsIURI URI , PRInt64 container , PRInt64 index , AString title , AString keyword , nsIVariant annotations , nsIVariant childTransactions ) nsITransaction createLivemark ( nsIURI feedURI , nsIURI siteURI , AString name , PRInt64 container , PRInt64 index , nsIVariant annotations ) nsITransaction createSeparator ( PRInt64 container , PRInt64 index ) nsITransaction editBookmarkKeyword ( PRInt64 itemId , AString newKeyword ) nsITransaction editBookmarkMicrosummary ( PRInt64 itemId , nsIMicrosummary newMicrosummary ) nsITransaction editBookmarkPostData ( PRInt64 itemId , AString postData ) nsITransaction editBookmarkURI ( PRInt64 bookmarkId , nsIURI newURI ) nsITransaction editItemDateAdded ( PRInt64 itemId , PRTime newDateAdded ) nsITransaction editItemDescription ( PRInt64 itemId , AString description ) nsITransaction editItemLastModified ( PRInt64 itemId , PRTime newLastModified ) nsITransaction editItemTitle ( PRInt64 id , AString newTitle ) nsITransaction editLivemarkFeedURI ( PRInt64 folderId , nsIURI uri ) nsITransaction editLivemarkSiteURI ( PRInt64 folderId , nsIURI URI ) nsITransaction moveItem ( PRInt64 itemId , PRInt64 newContainer , PRInt64 newIndex ) nsITransaction removeItem ( PRInt64 itemId ) nsITransaction setLoadInSidebar ( PRInt64 bookmarkId , PRBool loadInSidebar ) nsITransaction sortFolderByName ( PRInt64 folderId , PRInt64 folderIndex ) nsITransaction tagURI ( nsIURI URI , nsIVariant tags ) nsITransaction untagURI ( nsIURI URI , nsIVariant tags )

nsITransaction aggregateTransactions ( AString name , nsIVariant transactions )

Transaction for performing several Places Transactions in a single batch.

Arguments:
name: title of the aggregate transactions
transactions: an array of transactions to perform

nsITransaction createFolder ( AString name , PRInt64 container , PRInt64 index , nsIVariant annotations , nsIVariant childItemsTransactions )

Transaction for creating a new folder item.

Arguments:
name: the name of the new folder
container: the identifier of the folder in which the new folder should be added.
index
annotations
childItemsTransactions

nsITransaction createItem ( nsIURI URI , PRInt64 container , PRInt64 index , AString title , AString keyword , nsIVariant annotations , nsIVariant childTransactions )

Transaction for creating a new bookmark item

Arguments:
URI: the uri of the new bookmark (nsIURI)
container: the identifier of the folder in which the bookmark should be added.
index
title
keyword
annotations
childTransactions

nsITransaction createLivemark ( nsIURI feedURI , nsIURI siteURI , AString name , PRInt64 container , PRInt64 index , nsIVariant annotations )

Transaction for creating a new live-bookmark item.

Arguments:
feedURI
siteURI
name
container: the identifier of the folder in which the live-bookmark should be added.
index
annotations

nsITransaction createSeparator ( PRInt64 container , PRInt64 index )

Transaction for creating a new separator item

Arguments:
container: the identifier of the folder in which the separator should be added.
index

nsITransaction editBookmarkKeyword ( PRInt64 itemId , AString newKeyword )

Transaction for editing a bookmark's keyword.

Arguments:
itemId
newKeyword: new keyword for the bookmark

nsITransaction editBookmarkMicrosummary ( PRInt64 itemId , nsIMicrosummary newMicrosummary )

Transaction for editing a bookmark's microsummary.

Arguments:
itemId: id of the bookmark to edit
newMicrosummary: new microsummary for the bookmark

nsITransaction editBookmarkPostData ( PRInt64 itemId , AString postData )

Transaction for editing the post data associated with a bookmark.

Arguments:
itemId: id of the bookmark to edit
postData: post data

nsITransaction editBookmarkURI ( PRInt64 bookmarkId , nsIURI newURI )

Transaction for editing a bookmark's uri.

Arguments:
bookmarkId: id of the bookmark to edit
newURI: new uri for the bookmark

nsITransaction editItemDateAdded ( PRInt64 itemId , PRTime newDateAdded )

Transaction for editing an item's date added property.

Arguments:
itemId: id of the item to edit
newDateAdded: new date added for the item

nsITransaction editItemDescription ( PRInt64 itemId , AString description )

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

Arguments:
itemId: id of the item to edit
description: new description

nsITransaction editItemLastModified ( PRInt64 itemId , PRTime newLastModified )

Transaction for editing an item's last modified time.

Arguments:
itemId: id of the item to edit
newLastModified: new last modified date for the item

nsITransaction editItemTitle ( PRInt64 id , AString newTitle )

Transaction for editting a bookmark's title.

Arguments:
id: id of the item to edit
newTitle: new title for the item to edit

nsITransaction editLivemarkFeedURI ( PRInt64 folderId , nsIURI uri )

Transaction for editting a live bookmark's feed URI.

Arguments:
folderId: id of the livemark
uri: new feed uri

nsITransaction editLivemarkSiteURI ( PRInt64 folderId , nsIURI URI )

Transaction for editing a live bookmark's site URI.

Arguments:
folderId: id of the livemark
URI: new site uri

nsITransaction moveItem ( PRInt64 itemId , PRInt64 newContainer , PRInt64 newIndex )

Transaction for moving an Item.

Arguments:
itemId: the id of the item to move
newContainer: id of the new container to move to
newIndex: index of the new position to move to

nsITransaction removeItem ( PRInt64 itemId )

Transaction for removing an Item

Arguments:
itemId: id of the item to remove

nsITransaction setLoadInSidebar ( PRInt64 bookmarkId , PRBool loadInSidebar )

Transaction for setting/unsetting Load-in-sidebar annotation

Arguments:
bookmarkId: id of the selected bookmark
loadInSidebar: boolean value

nsITransaction sortFolderByName ( PRInt64 folderId , PRInt64 folderIndex )

Transaction for sorting a folder by name

Arguments:
folderId: id of the folder to sort
folderIndex

nsITransaction tagURI ( nsIURI URI , nsIVariant tags )

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 uRI was already tagged by any of the tags in tags, undoing this tags transaction removes them all from uRL!

Arguments:
URI: the URL to tag.
tags: Array of tags to set for the given URL.

nsITransaction untagURI ( nsIURI URI , nsIVariant tags )

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

Arguments:
URI: the URL to un-tag.
tags: Array of tags to unset. pass null to remove all tags from the given url.

Reference documentation is generated from Mozilla's source.