This page (revision-14) was last changed on 17-Dec-2012 21:37 by Sebastian Furth

This page was created on 17-Dec-2012 15:20 by Daniel Zügner

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
14 17-Dec-2012 21:37 716 bytes Sebastian Furth to previous
13 17-Dec-2012 21:33 718 bytes Albrecht Striffler to previous | to last
12 17-Dec-2012 18:08 684 bytes constin to previous | to last
11 17-Dec-2012 18:08 683 bytes constin to previous | to last
10 17-Dec-2012 18:07 684 bytes constin to previous | to last
9 17-Dec-2012 18:06 684 bytes constin to previous | to last
8 17-Dec-2012 18:05 685 bytes constin to previous | to last
7 17-Dec-2012 18:05 686 bytes constin to previous | to last
6 17-Dec-2012 17:37 688 bytes constin to previous | to last
5 17-Dec-2012 17:35 682 bytes constin to previous | to last
4 17-Dec-2012 16:30 651 bytes Christian Henninger to previous | to last
3 17-Dec-2012 15:58 653 bytes Christian Henninger to previous | to last
2 17-Dec-2012 15:25 1 KB Daniel Zügner to previous | to last
1 17-Dec-2012 15:20 1 KB Daniel Zügner to last

Page References

Incoming links Outgoing links

Version management

Difference between version and

At line 1 changed 3 lines
%%(color: red)
__Deprecated! Needs review.__
%%
Section Store can be used to store and retrieve arbitrary objects from a Section. This can be obtained by calling:
At line 5 changed one line
Using the store is quite simple. Any Object can be stored for a specific KDOM-id and a (unique) key.
{{{storeObject(String key, Object object)}}}
The key identifys the object and is unique. You can use the key to regain the object by calling
{{{getObject(String key)}}} Note that if the key doesn't exist, the return value is __null__.
At line 7 changed 9 lines
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)
}}}%%
{{{storeObject(Article article, String key, Object object)}}}If you need multiple instances of an object, you can also store them with a reference to the article. To do that call: The other way round you can get the object back by calling {{{getObject(Article article, String key)}}}
At line 17 removed 3 lines
* 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
At line 10 added 3 lines
%%tags
howto SectionStore
%
At line 22 changed 30 lines
\\
\\
\\
__''Example is deprecated!''__
The following example is taken from the XMLSectionFinder:
%%prettify
{{{
KnowWEUtils.storeSectionInfo(article.getWeb(), article.getTitle(), sectionKDOMid, XMLSectionFinder.ATTRIBUTE_MAP_STORE_KEY, parameterMap);
}}}
Here the object ''parameterMap'' is stored for a given web, article-title, KDOM-id and a key.
The following method shows how this object can be retrieved again from the store:
{{{
public static Map<String, String> getAttributeMapFor(Section s) {
KnowWEArticle article = s.getArticle();
if (article != null) {
return (Map<String, String>) KnowWEUtils.getStoredObject(article.getWeb(),
article.getTitle(), s.getId(), XMLSectionFinder.ATTRIBUTE_MAP_STORE_KEY);
}
return null;
}
}}}
''Hint:'' Be sure to use the correct web, article-title, KDOM-id and key you've used to store the desired object.
<tags>HowTo</tags>
%%Todo
Review this page
%