Skip to content
Snippets Groups Projects
Commit 386d199a authored by guha%netscape.com's avatar guha%netscape.com
Browse files

More RDF fixing. Now ready for Raptor.

parent a6bb07ef
No related branches found
No related tags found
No related merge requests found
......@@ -63,6 +63,10 @@ public:
NS_IMETHOD ResourceIdentifier(RDF_Resource r,
char** url /* out */) = 0;
#ifdef MOZILLA_CLIENT
NS_IMETHOD SetBookmarkFile(const char* bookmarkFilePath) = 0;
#endif
};
......
......@@ -104,7 +104,7 @@ PR_PUBLIC_API(RDF_Error) RDF_Shutdown(void);
PR_PUBLIC_API(char*) RDF_GetResourceName(RDF rdfDB, RDF_Resource node);
PR_PUBLIC_API(void) SetBookmarkURL(const char* url);
PR_PUBLIC_API(RDF_Resource) RDFUtil_GetFirstInstance (RDF_Resource type, char* defaultURL);
PR_PUBLIC_API(void) RDFUtil_SetFirstInstance (RDF_Resource type, RDF_Resource item);
......
......@@ -163,13 +163,15 @@ public:
NS_METHOD CreateDatabase(const char** url,
nsIRDFDataBase** db);
NS_IMETHOD ResourceIdentifier(RDF_Resource r,
NS_METHOD ResourceIdentifier(RDF_Resource r,
char** url /* out */);
#ifdef MOZILLA_CLIENT
NS_METHOD SetBookmarkFile(const char* bookmarkFilePath);
#endif
};
class rdfServiceFactory : public nsIFactory {
public:
NS_DECL_ISUPPORTS
......@@ -545,7 +547,7 @@ rdfDatabaseWrapper::DeleteAllArcs(RDF_Resource resource)
*/
NS_IMPL_ISUPPORTS( rdfServiceWrapper, NS_IRDFSERVICE_IID )
NS_IMPL_ISUPPORTS(rdfServiceWrapper, NS_IRDFSERVICE_IID )
rdfServiceWrapper::rdfServiceWrapper()
{
......@@ -592,7 +594,14 @@ rdfServiceWrapper::ResourceIdentifier(RDF_Resource r,
*url = RDF_ResourceID(r);
return NS_OK;
}
#ifdef MOZILLA_CLIENT
NS_METHOD
rdfServiceWrapper::SetBookmarkFile(const char* bookmarkFilePath) {
SetBookmarkURL(bookmarkFilePath);
return NS_OK;
}
#endif
/*
......
......@@ -367,6 +367,11 @@ isSeparator (RDF_Resource r)
return (startsWith("separator", resourceID(r)) || startsWith("nc:separator", resourceID(r))) ;
}
extern char* gBookmarkURL;
PR_PUBLIC_API(void)
SetBookmarkURL(const char* url) {
gBookmarkURL = copyString(url);
}
char *
......
......@@ -25,7 +25,7 @@
#include "plevent.h"
#include "nsRepository.h"
#define RDF_DB "test.rdf"
#define RDF_DB "rdf:bookmarks"
#define SUCCESS 0
#define FAILURE -1
......@@ -53,7 +53,7 @@ main(int argc, char** argv)
NS_GetRDFService( &pRDF );
PR_ASSERT( pRDF != 0 );
pRDF->SetBookmarkFile("bookmark.htm");
nsIRDFDataBase* pDB;
char* url[] = { RDF_DB, NULL };
......@@ -64,7 +64,8 @@ main(int argc, char** argv)
/* execute queries */
RDF_Resource resource = 0;
if( NS_OK != pDB->CreateResource("test.rdf#root", &resource) )
if( NS_OK != pDB->CreateResource("NC:Bookmarks", &resource) )
fail("Unable to get resource on db!!!\n");
RDF_Resource parent = 0;
if( NS_OK != pDB->GetResource("parent", &parent) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment