This page (revision-29) was last changed on 17-Dec-2012 18:37 by Jochen Reutelshöfer

This page was created on 17-Dec-2012 17:06 by Jochen Reutelshöfer

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Page revision history

Version Date Modified Size Author Changes ... Change note
29 17-Dec-2012 18:37 4 KB Jochen Reutelshöfer to previous
28 17-Dec-2012 18:35 4 KB Jochen Reutelshöfer to previous | to last
27 17-Dec-2012 18:32 3 KB Jochen Reutelshöfer to previous | to last
26 17-Dec-2012 17:54 3 KB Jochen Reutelshöfer to previous | to last
25 17-Dec-2012 17:53 3 KB Jochen Reutelshöfer to previous | to last
24 17-Dec-2012 17:51 3 KB Jochen Reutelshöfer to previous | to last
23 17-Dec-2012 17:50 2 KB Jochen Reutelshöfer to previous | to last
22 17-Dec-2012 17:49 2 KB Jochen Reutelshöfer to previous | to last
21 17-Dec-2012 17:47 2 KB Jochen Reutelshöfer to previous | to last

Page References

Incoming links Outgoing links

Version management

Difference between version and

At line 16 added one line
!! Finding a section from a given section id
At line 18 added 8 lines
Each section has an id that is unique wiki-wide. When having such an id, the corresponding section object can be retrieved using the following method of the class Sections:
%%prettify
{{{
public static Section<?> getSection(String id) {
}}}
/%
At line 23 changed one line
* Never modify section objects directly
* Never modify section text contents directly
At line 34 added one line
* In sum: section objects should be considered to be read only objects
At line 33 changed 2 lines
/%Beside the context of the user, that is responsible for triggering these changes, a map is passed. This map contains all the change operations that are supposed to be applied on the wiki pages source(s). The keys of this map are section ids of existing sections.
The value for each id is the new content string, the old section should be replaced with. After modifying the content as specified by this map of replacements, this method will take care of all additional organizational issues (e.g., persistence, parsing, compilation, message handling, event handling).
/%
Beside the context of the user, that is responsible for triggering these changes, a map is passed. This map contains all the change operations that are supposed to be applied on the wiki pages source(s). The keys of this map are section ids of existing sections.
The value for each id is the new content string, the old section should be replaced with. After modifying the content as specified by this map of replacements, this method will take care of all additional organizational issues (e.g., persistence, parsing, compilation, message handling, event handling). Then, the updated version of the section tree can be accessed in the common way, e.g., by starting at the root section of an article.
At line 49 added 22 lines
!! Using the section store to store information
Often information for a particular section needs to be preserved for later use, e.g., by an extension of an other kind.
Using the store is quite simple. Any Object can be stored for a specific section id and a (unique) store key, representing the purpose of this information.
The method you should use to store something is:
%%prettify
{{{
KnowWEUtils.storeObject(KnowWEArticle article, Section<?> s, String key, Object o)
}}}
/%
The method to look up stored information is:
%%prettify
{{{
KnowWEUtils.getStoredObject(KnowWEArticle article, Section<?> s, String key)
}}}
/%
* Be sure that you use the identical section for lookup as for storing (e.g., not a father or child section)!
* The store will survive page-edits if this particular section does not change
* The store for a section will be reseted when the section has changed via page edit