Deleting RDF bookmarks using XUL.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Deleting RDF bookmarks using XUL.

MC-26
Hello Everyone,

A while ago, I created an extension that creates a bookmark folder
into the BookmarksRoot and adds some bookmarks into that folder (the
source code at end of my posting shows in brief how the folder is
created and how the bookmark is finally added).

This works fine, but there is one problem.
When the folder (myFolder) already exists, then a new folder with the
same name is created, and the created bookmark is added in that 2nd
folder. What I'd like to do is: check whether the folder already
exists and delete it. Then my current script can re-create the folder
and it's content.

Question:

  Does anyoneknow how to delete the folder named "myFolder" from the
NC:BookmarksRoot?


Many thanks in advance.

Best regards,
MC




/***************************/
/* Initialise the services */
/***************************/
initServices();
initBMService();

/*****************************/
/* Create bookmark or folder */
/*****************************/
ptfResource = RDF.GetResource("NC:BookmarksRoot");
ptfFolder = BMSVC.createFolderInContainer("myFolder", ptfResource,
-1);
BMSVC.createBookmarkInContainer("myBookmarks", " http://
www.google.com", null, null, null,null, ptfFolder,-1);

var remote =
BMDS.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);
if (remote)
   remote.Flush();

_______________________________________________
dev-tech-rdf mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-rdf