WWW::Kontent::Store

WWW::Kontent::Store contains base classes for Kontent stores.
Download

WWW::Kontent::Store Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • WWW::Kontent::Store team
  • Publisher web site:
  • http://search.cpan.org/~brentdax/WWW-Kontent-0.02/WWW/Kontent/Store.pm

WWW::Kontent::Store Tags


WWW::Kontent::Store Description

WWW::Kontent::Store contains base classes for Kontent stores. WWW::Kontent::Store contains base classes for Kontent stores.SYNOPSIS class MySavedPage is WWW::Kontent::SavedPage { ... } class MyDraftPage is WWW::Kontent::DraftPage { ... } class MySavedRev is WWW::Kontent::SavedRevision { ... } class MyDraftRev is WWW::Kontent::DraftRevision { ... } say "$page.path() ('$page.cur.attributes') has {+$page.revisions} revisions.";WWW::Kontent::Store contains the classes defining Kontent pages and revisions. The classes in this module are abstract, and are usually inherited from by store modules.WWW::Kontent::PageThis is a base class for a Kontent page. A store will not usually derive directly from this class; rather, it will derive its child classes, SavedPage and DraftPage.MethodsnameReturns the name of the page. In DraftPages, this should be writable. Store authors must override this method to give it a body.parentReturns the page's parent page. Note that this must be the parent as seen by Kontent, which may be different from the parent reflected in the store if a special page class is bridging between two stores. Hence, it's probably best to have parent pages pass themselves into the constructors of their children. Store authors must override this method to give it a body.pathReturns the path from the root page to this page. This method has a default implementation using name and parent, but store authors may want to override it for efficiency.WWW::Kontent::SavedPageSavedPage represents a page retrieved from whatever backing store the store module interfaces with. SavedPages are basically immutable.MethodsrevisionsReturns an array of SavedRevision objects representing the page's revisions.curReturns a SavedRevision object representing the page's current revision. This method defaults to simply calling revisions and extracting the last element, but store authors may want to override it with a more efficient implementation.childrenReturns an array containing the names of the page's children.XXX should probably be one of the default_ methodsdefault_resolveFinds the child page of the given name and returns it. Page classes will typically use this method to resolve a page, but may override it to implement a bridge.default_createCreates a child page of the given name and returns a draft of its first revision. Page classes will typically use this method to resolve a page, but may override it to implement a bridge or simply set a default page class.pool($module)Returns a pool in the current store with the module name $module.WWW::Kontent::DraftPageDraftPages represent a page which has been created in the Kontent store, but has not yet been committed. Each DraftPage has a single DraftRevision; committing the DraftRevision should also save the DraftPage. The name field in a DraftPage should be mutable.Methodsdraft_revisionReturns the draft revision associated with this draft page.WWW::Kontent::RevisionThis is a base class for a Kontent page. A store will not usually derive directly from this class; rather, it will derive its child classes, SavedPage and DraftPage.MethodspageReturns the page this revision belongs to.attributesReturns a hash containing all attributes of this revision.revnoReturns the revision number of this revision; this number is 1-based, increasing by 1 in each revision.driverCalls the page class's driver method.A class's driver should implement any complex behavior the page class requires, such as database updates, querying for information, or complex calculations. A WWW::Kontent::Request object must be passed in to this method.adapterCalls the page class's adapter method.The adapter is called by the renderer when it wants to retrieve the page's content; it should return a WWW::Kontent::Skeleton object containing content appropriate for the current mode. A WWW::Kontent::Request object must be passed in to this method.modelistCalls the page class's modelist method. The modelist method should return an array containing all the modes supported by the class.WWW::Kontent::SavedRevisionRepresents a revision retrieved from the database. Store authors should write a class which inherits from this. Its attributes should be assumed to be immutable.MethodsreviseReturns a Draft object with the same attributes as this revision, except with the rev: attributes omitted. The draft should have the revision number passed into this method.resolveCalls the page class's resolve method, which by default calls the page's default_resolve method. This method takes a page name and returns the child page with that name.createCalls the page class's create method, which by default calls the page's default_create method. This method takes a page name and returns a DraftPage object for it. The DraftPage's revision must be committed before it will appear in the backing store.pool($module)Returns a pool in the current store with the module name $module.WWW::Kontent::DraftRevisionThis class represents an uncommitted draft revision. Store authors should inherit from this class.MethodscommitWrites the draft revision (and the page, if it is also a draft) into the backing store.WWW::Kontent::PoolThis class represents a pool of unversioned data tied to a particular store. Store authors should inherit from this class.Requirements:· Perl Requirements: · Perl


WWW::Kontent::Store Related Software