mozdev.org

JSLib
Page Updated: January 28, 2002
Latest Version: 0.1.375
Debug | Install | File I/O | RDF | Network | Sound | Utils | XUL | Zip
Home | Mailing List | Install | Source Code | Downloads | Bugs | docs | clients

RDFBase

RDFBase
RDFBase.prototype.getDatasource

RDFBase.prototype.isValid
RDFBase.prototype.setValid

RDFBase.prototype.flush

RDFBase

RDFBase is foundation for all the other RDF classes (in jslib).

Note:  This class is not intended to be directly created.  RDF, RDFFile or RDFContainer should create this for you.  See those classes for an example.

void RDFBase (nsIRDFDataSource aDatasource)


This base creates all the supporting RDF manipulation objects for derived classes to use.

aDatasource - an nsIRDFDataSource object.


 RDFBase.prototype.getDatasource

Get the nsIRDFDataSource for the resource.

nsIRDFDataSource getDatasource ()


Usefull if you want to attach this datasource to a tree, or outliner.

Example:
var gRDF = new RDFFile(path);
ourlinerbody.database.AddDataSource(gRDF.getDatasource());

RDFBase.prototype.isValid

Check to see if resource valid.

boolean isValid ()


This returns true if this resource is still valid.  An invalid state only happens when you remove the resource.

Example:
var gRDF = new RDFFile(path );
var node = gRDF.getRootNode("urn:test:bob");
if(node.isValid()) {
    dump("node: "+node.getSubject()+"\n");
}

prints:
node: urn:test:bob

RDFBase.prototype.setValid

Change the validity of this resource.

boolean setValid (boolean aTruth)


Sets the truth value for the resource.  This can be usefull if you want to make sure that you can't manipulate a resouce.

aTruth - true or false.

Example:
var gRDF = new RDFFile(path );
var node = gRDF.getRootNode("urn:test:bob");
node.setValid(false);


RDFBase.prototype.flush

Flush the changes out to file/net/memory.

void flush ()


This call will "flush" the changes that you made to the datasource out to disk or memory.

Example:
var gRDF = new RDFFile(path );
var node = gRDF.getRootNode("urn:test:bob");
node.setAttribute("address", "123 somewhere st");
node.flush();


The jslib project can be contacted through the mailing list or the member list.
Copyright © 2000-2017. All rights reserved. Terms of Use & Privacy Policy.