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 27 changed one line
Use the methods ''replaceSections'' provides by the Sections class.
Use the method ''replaceSections'' provided by the Sections class.
At line 35 changed 2 lines
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).
The method return a map containing a mapping from the old section ids to the corresponding new sections id, if structural equivalence is given. Not in every case this information is required by the caller.
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 47 added 24 lines
The method returns a map containing a mapping from the old section ids to the corresponding new sections id, if structural equivalence is given. Not in every case this information is required by the caller.
!! 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