Service Managing WIKI based contents.
Class Wiki( instance ) from \ Service(( instance))
This Wiki service resolves plugin requests in wiki texts by generating a Nest.emit message named "wiki_plugin_
As plugin defitions are application (wiki) globals, the instance of the wiki and its configuration are irrilevant. The wiki plugin handler just need to generate a string reply that is inserted in its place in the final rendered page.
The function is invoked as
function wiki_plugin_<name>( parms, node, standout, page )
where params, node and standout are the Falcon wiki renderer parameters:
The Nest system defines the following plugins, which are registered as the wiki service is loaded:
This service adds a javascript function in the Nest.headings called function nest_wiki_insertText( text, mode ), where text is the text to be inserted, and mode can be 'image', 'file' or null. Calling this function results in the desired text (possibly a link to an internal file or image) to be inserted at the current cursor position in the text area having the CSS id nest_wiki_area.
The function can be called back by the Uploader service.
Note: Nest.headings must be properly called for this to work.
Methods | |
getBlank | Returns a blank page that can be used to fill the update parameters. |
getPage | Returns the full record of the given page. |
initialize | Initializes the wiki system, creating the entity through the data manager. |
linkDelete | Returns the link that requests to delete the current page. |
linkGoToPage | Returns the link that needed to follow a page. |
linkMody | Returns the link that requests to modify the current page. |
plugin | Loads a plugin and returns its result. |
removePage | Removes a page. |
setEntities | Creates the entities in a data manager. |
updatePage | Updates (or creates) a page with new contents. |
Returns a blank page that can be used to fill the update parameters.
getBlank()
Return | A blank page record. |
Returns the full record of the given page.
getPage( page_name )
page_name | The id of the page to be retreived. |
Return | The page data on success, nil on failure. |
Initializes the wiki system, creating the entity through the data manager.
initialize( ename )
ename | The name of the entity to be created. |
Returns the link that requests to delete the current page.
linkDelete( [wid],[page] )
wid | The ID of the wiki page to be handled, or nil for current page. |
page | If given, ask to handle the request to the given page ID. |
Return | The href to follow to delete the current wiki page. |
Returns the link that needed to follow a page.
linkGoToPage( wid, [page] )
page | If given, ask to handle the request to the given page ID. |
Return | The href to follow to modify the current wiki page. |
Returns the link that requests to modify the current page.
linkMody( [wid],[page] )
wid | The ID of the wiki page to be handled, or nil for current page. |
page | If given, ask to handle the request to the given page ID. |
Return | The href to follow to modify the current wiki page. |
Loads a plugin and returns its result.
plugin( page_name, pname, params, node, sout, page )
page_name | The page to be removed. |
Return | true on success, false if the page cannot be created. |
Removes a page.
removePage( page_name )
page_name | The page to be removed. |
Return | true on success, false if the page cannot be created. |
Creates the entities in a data manager.
setEntities( dm, ename )
dm | The datamanager under which the WIKI entities are to be published. |
ename | The name of the entity. |
Updates (or creates) a page with new contents.
updatePage( pageEntry )
pageEntry | The page entry to be sent to the db. | ||
Return | true on success, false if the page cannot be created. | ||
Raise |
|
if the pageEntry.comp_cnt value is not valorized, compiles automatically the wiki content.
On success sends an "fmwiki_pupd" message.