[Hippo-cms7-user] Hippo Forge Properties plugin documentation

Jeroen Hoffman j.hoffman at onehippo.com
Thu Sep 20 10:28:20 CEST 2012


FYI it's updated, see http://properties.forge.onehippo.org/sitecode.html.


On 19-09-12 14:35, Jeroen Hoffman wrote:
> David,
>
> Thanks for your contribution here!
>
> Now that I read this page again, it seems that documentation on the
> <properties:property /> jsp tag is also missing from that page so it needs an
> update anyway.
>
> Tnx
> Jeroen
>
>
>
> On 19-09-12 14:04, David Martin wrote:
>> Hi,
>>
>> I just want to report some typos in Hippo Forge Properties plugin.
>> On page called "HST Site code", the code contains some mistakes. Here is a valid
>> version, if someone can edit the documentation:
>>
>> // get the manager
>> final ComponentManager componentManager = (ComponentManager)
>> this.getDefaultClientComponentManager();
>> final PropertiesManager propertiesManager =
>> componentManager.getComponent(PropertiesManager.class.getName());
>> final HippoBean baseBean = this.getSiteContentBaseBean(request);
>>
>> // retrieve one document bean by the configured default name
>> final PropertiesBean defaultPropertiesBean =
>> propertiesManager.getPropertiesBean(baseBean);
>> final Map<String, String> defaultLabels =
>> PropertiesUtil.toMap(defaultPropertiesBean);
>> request.setAttribute("labels", defaultLabels);
>>
>> // .. OR retrieve one document bean by path parameter
>> final String labelsPath = this.getParameter("labelsPath", request);
>> final PropertiesBean propertiesBean =
>> propertiesManager.getPropertiesBean(labelsPath, baseBean);
>> final Map<String, String> labels = PropertiesUtil.toMap(propertiesBean);
>> request.setAttribute("labels", defaultLabels);
>>
>> // .. OR retrieve multiple documents bean by paths
>> final List<String> labelsPaths = Arrays.asList("common", "specific");
>> final List<PropertiesBean> propertiesBeans =
>> propertiesManager.getPropertiesBeans(labelsPaths, baseBean);
>> final Map<String, String> allLabels =
>> PropertiesUtil.toMap(propertiesBeans);
>> request.setAttribute("labels", allLabels);
>>
>> Not a big deal, but it can help...
>>
>> --
>> David
>>
>>
>>
>> _______________________________________________
>> Hippo-cms7-user mailing list and forums
>> http://www.onehippo.org/cms7/support/forums.html



More information about the Hippo-cms7-user mailing list