<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Dynamic Data-Driven Drop Downs for List Properties</title>
	<atom:link href="http://blogs.alfresco.com/wp/jbarmash/2008/08/08/dynamic-data-driven-drop-downs-for-list-properties/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.alfresco.com/wp/jbarmash/2008/08/08/dynamic-data-driven-drop-downs-for-list-properties/</link>
	<description>Alfresco in the Real World</description>
	<lastBuildDate>Sat, 11 Dec 2010 00:48:44 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
	<item>
		<title>By: Carl Nordenfelt</title>
		<link>http://blogs.alfresco.com/wp/jbarmash/2008/08/08/dynamic-data-driven-drop-downs-for-list-properties/#comment-128</link>
		<dc:creator>Carl Nordenfelt</dc:creator>
		<pubDate>Tue, 25 Nov 2008 12:56:52 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.alfresco.com/jbarmash/?p=6#comment-128</guid>
		<description>Hi
I think a way to avoid the static ServiceRegistry would be to inject it from the JSF component generator in the same way as the node is set for the constraint. This means that you will not have it declared in the Spring bean but dynamically set when JSF renders the component.

//Carl</description>
		<content:encoded><![CDATA[<p>Hi<br />
I think a way to avoid the static ServiceRegistry would be to inject it from the JSF component generator in the same way as the node is set for the constraint. This means that you will not have it declared in the Spring bean but dynamically set when JSF renders the component.</p>
<p>//Carl</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jean Barmash &#187; Blog Archive &#187; Implementing Cascading DropDowns For Editing Properties</title>
		<link>http://blogs.alfresco.com/wp/jbarmash/2008/08/08/dynamic-data-driven-drop-downs-for-list-properties/#comment-81</link>
		<dc:creator>Jean Barmash &#187; Blog Archive &#187; Implementing Cascading DropDowns For Editing Properties</dc:creator>
		<pubDate>Sun, 17 Aug 2008 13:41:29 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.alfresco.com/jbarmash/?p=6#comment-81</guid>
		<description>[...] Jean Barmash Alfresco in the Real World      &#171; Dynamic Data-Driven Drop Downs for List Properties [...]</description>
		<content:encoded><![CDATA[<p>[...] Jean Barmash Alfresco in the Real World      &laquo; Dynamic Data-Driven Drop Downs for List Properties [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Löfgren</title>
		<link>http://blogs.alfresco.com/wp/jbarmash/2008/08/08/dynamic-data-driven-drop-downs-for-list-properties/#comment-79</link>
		<dc:creator>Peter Löfgren</dc:creator>
		<pubDate>Thu, 14 Aug 2008 04:13:55 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.alfresco.com/jbarmash/?p=6#comment-79</guid>
		<description>Hi Jean, and thanks for sharing.
As you mentioned, this not only makes it possible for dynamic drop-downs, but also for securing the data in them. Sometimes revealing just the existence of a property value can be to much, you may use your system so that you let subcontractors in and they should not know of each other &#039;assets&#039;. Or this new highly confidential project where you want to have the project id as one property.

I&#039;ve added to your code  so that the value property can be set dynamically
    public void setListvalueProperty(String newlistvalueprop)
    {
        listvalueprop = QName.createQName(newlistvalueprop);
    }
In your model definition then add next to the query parameter

{http://www.alfresco.org/model/content/1.0}name


Next was to make the query sort, you most likely want a list that sort in some way. I made it sort on the dynamic property above.

(in the getSearchResult() add )

        SearchParameters sp = new SearchParameters();
        sp.addStore(storeRef);
        sp.setLanguage(SearchService.LANGUAGE_LUCENE);
        sp.setQuery(finalQuery);
        sp.addSort(&quot;@&quot;+this.listvalueprop.toString(), true);

        ResultSet resultSet = getServiceRegistry().getSearchService().query(sp);
        NodeService nodeSvc = getServiceRegistry().getNodeService();

        List allowedValues = new ArrayList();
        for (ResultSetRow row : resultSet)
        {
            allowedValues.add((String)nodeSvc.getProperty(row.getNodeRef(), this.listvalueprop));
        }
(...)
Next is to figure out how to extend to have the description different than the stored value, let the users know what &#039;XYZ&#039; stands for, and display &#039;XYZ -  Explanation&#039; in the dropdown but still store &#039;XYZ&#039;.

//Peter Löfgren</description>
		<content:encoded><![CDATA[<p>Hi Jean, and thanks for sharing.<br />
As you mentioned, this not only makes it possible for dynamic drop-downs, but also for securing the data in them. Sometimes revealing just the existence of a property value can be to much, you may use your system so that you let subcontractors in and they should not know of each other &#8216;assets&#8217;. Or this new highly confidential project where you want to have the project id as one property.</p>
<p>I&#8217;ve added to your code  so that the value property can be set dynamically<br />
    public void setListvalueProperty(String newlistvalueprop)<br />
    {<br />
        listvalueprop = QName.createQName(newlistvalueprop);<br />
    }<br />
In your model definition then add next to the query parameter</p>
<p>{http://www.alfresco.org/model/content/1.0}name</p>
<p>Next was to make the query sort, you most likely want a list that sort in some way. I made it sort on the dynamic property above.</p>
<p>(in the getSearchResult() add )</p>
<p>        SearchParameters sp = new SearchParameters();<br />
        sp.addStore(storeRef);<br />
        sp.setLanguage(SearchService.LANGUAGE_LUCENE);<br />
        sp.setQuery(finalQuery);<br />
        sp.addSort(&#8220;@&#8221;+this.listvalueprop.toString(), true);</p>
<p>        ResultSet resultSet = getServiceRegistry().getSearchService().query(sp);<br />
        NodeService nodeSvc = getServiceRegistry().getNodeService();</p>
<p>        List allowedValues = new ArrayList();<br />
        for (ResultSetRow row : resultSet)<br />
        {<br />
            allowedValues.add((String)nodeSvc.getProperty(row.getNodeRef(), this.listvalueprop));<br />
        }<br />
(&#8230;)<br />
Next is to figure out how to extend to have the description different than the stored value, let the users know what &#8216;XYZ&#8217; stands for, and display &#8216;XYZ &#8211;  Explanation&#8217; in the dropdown but still store &#8216;XYZ&#8217;.</p>
<p>//Peter Löfgren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alfresco dynamic list constraints example &#124; ecmarchitect.com</title>
		<link>http://blogs.alfresco.com/wp/jbarmash/2008/08/08/dynamic-data-driven-drop-downs-for-list-properties/#comment-78</link>
		<dc:creator>Alfresco dynamic list constraints example &#124; ecmarchitect.com</dc:creator>
		<pubDate>Wed, 13 Aug 2008 15:03:18 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.alfresco.com/jbarmash/?p=6#comment-78</guid>
		<description>[...] Barmash has published an example showing how to do dynamic list constraints for Alfresco properties. His example accepts a Lucene [...]</description>
		<content:encoded><![CDATA[<p>[...] Barmash has published an example showing how to do dynamic list constraints for Alfresco properties. His example accepts a Lucene [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

