powered by Authenteo
by Xucia  

Learn more

Persistent Object Framework API

Authenteo provides additional access to the persistent objects through the Persistent JavaScript API. The API is contained in the pjs namespace.

pjs.load(id:String, filter:String):*

Returns an object with the given id. All persisted objects should have an id, and this functions provides the ability to retrieve an object by its id.

The second parameter is an optional parameter that can be used to provide a filter (SQL where clause) for an object that is a set.

pjs.set(target,field,value)

This will set a persistent property of the given target object.

pjs.getAccessLevel(object:Object):Number

Returns the access level of the current user on the given object. The access level should be an integer denoted a permission according to this table:

    * 0 - none - can not access any of the fields on this object

    * 1 - browse - can only read from a limited set of fields (usually name and basis)

    * 2 - read - can read all the information from this object, but can not make any modifications to this object

    * 3 - append - for list objects, entries can be appended, but no property modifications can be made

    * 5 - write - any modifications can be made to this object

    * Note that Persistent JavaScript is garbage collection based so there is no concept of deleting an object, only properties. Objects are deleted when all references to them are removed.

pjs.filter(collection:Array,query:String):Array

This allows for a SQL/EQL style condition string to filter a collection. For example:

            var newCustomers = pjs.filter(customers,
          
            	"startDate>1/1/2007 AND isActive=true");
          

pjs.commit()

Commits all the changes that have been made in the current transaction.

pjs.rollback()

Rolls back all the changes that have been made in the current transaction.

pjs.getId(object:Object)

Returns the object id for the given object.

pjs.isPersisted(object:Object)

Returns true if the object has been persisted or is in the act of being persisted.

pjs.newInstance(basis:Object):Object

This function is called whenever the new operator is applied to an object (not a function). This returns a new object with a basis of the provided basis parameter.

News

Authenteo 1.1 is available.

Firebug - Web Development Evolved Now with Firebug integration . Make changes to CSS and HTML with Firebug and save the changes

Check out press releases and the following articles on Authenteo:

Authenteo beta