Jorge Ferrer 14 Years Ago Thanks for the post Ray, it's great.Could you add this info and update the following wiki page too?http://www.liferay.com/community/wiki/-/wiki/Main/Developing+with+Expando Please sign in to reply. Reply as... Cancel
Stephen Skinner 13 Years Ago Ray - you're the best; I always learn a ton from your examples. If you ever feel like a few days of consulting in beautiful downtown Kingston (Ontario) let me know! Please sign in to reply. Reply as... Cancel Ray Augé Stephen Skinner 13 Years Ago That's funny since I'm in the beautiful Sudbury region (Ontario) And thanks! Please sign in to reply. Reply as... Cancel Christian De Vera Talampas Ray Augé 13 Years Ago Hi!How do i sort say $rows (from #set ($rows = $expandoRowLocalService.getRows($accountsTableId, $start, $end)))? I want to sort "balance" in descending order. Is there a way? The sorter tool seems not working for me.Thanks Please sign in to reply. Reply as... Cancel Ray Augé Christian De Vera Talampas 13 Years Ago Hmm, this is tougher. In fact it's one of the 2 toughest things I have yet to introduce; an integrated way to do filtering and sorting. Both of these I have ideas for, but they might not appear until 6.1 (unless I decide to do it as a plugin before so it can be used in 5.2).Until then, you will have to do the sorting, post query, the old fashioned way (get all the results, and then sort them after the fact using a custom comparator implementation) and hopefully you're data set is not too massive. Please sign in to reply. Reply as... Cancel Christian De Vera Talampas Ray Augé 13 Years Ago thanks ray! i'll keep that in mind. Please sign in to reply. Reply as... Cancel
Ray Augé Stephen Skinner 13 Years Ago That's funny since I'm in the beautiful Sudbury region (Ontario) And thanks! Please sign in to reply. Reply as... Cancel Christian De Vera Talampas Ray Augé 13 Years Ago Hi!How do i sort say $rows (from #set ($rows = $expandoRowLocalService.getRows($accountsTableId, $start, $end)))? I want to sort "balance" in descending order. Is there a way? The sorter tool seems not working for me.Thanks Please sign in to reply. Reply as... Cancel Ray Augé Christian De Vera Talampas 13 Years Ago Hmm, this is tougher. In fact it's one of the 2 toughest things I have yet to introduce; an integrated way to do filtering and sorting. Both of these I have ideas for, but they might not appear until 6.1 (unless I decide to do it as a plugin before so it can be used in 5.2).Until then, you will have to do the sorting, post query, the old fashioned way (get all the results, and then sort them after the fact using a custom comparator implementation) and hopefully you're data set is not too massive. Please sign in to reply. Reply as... Cancel Christian De Vera Talampas Ray Augé 13 Years Ago thanks ray! i'll keep that in mind. Please sign in to reply. Reply as... Cancel
Christian De Vera Talampas Ray Augé 13 Years Ago Hi!How do i sort say $rows (from #set ($rows = $expandoRowLocalService.getRows($accountsTableId, $start, $end)))? I want to sort "balance" in descending order. Is there a way? The sorter tool seems not working for me.Thanks Please sign in to reply. Reply as... Cancel Ray Augé Christian De Vera Talampas 13 Years Ago Hmm, this is tougher. In fact it's one of the 2 toughest things I have yet to introduce; an integrated way to do filtering and sorting. Both of these I have ideas for, but they might not appear until 6.1 (unless I decide to do it as a plugin before so it can be used in 5.2).Until then, you will have to do the sorting, post query, the old fashioned way (get all the results, and then sort them after the fact using a custom comparator implementation) and hopefully you're data set is not too massive. Please sign in to reply. Reply as... Cancel Christian De Vera Talampas Ray Augé 13 Years Ago thanks ray! i'll keep that in mind. Please sign in to reply. Reply as... Cancel
Ray Augé Christian De Vera Talampas 13 Years Ago Hmm, this is tougher. In fact it's one of the 2 toughest things I have yet to introduce; an integrated way to do filtering and sorting. Both of these I have ideas for, but they might not appear until 6.1 (unless I decide to do it as a plugin before so it can be used in 5.2).Until then, you will have to do the sorting, post query, the old fashioned way (get all the results, and then sort them after the fact using a custom comparator implementation) and hopefully you're data set is not too massive. Please sign in to reply. Reply as... Cancel Christian De Vera Talampas Ray Augé 13 Years Ago thanks ray! i'll keep that in mind. Please sign in to reply. Reply as... Cancel
Christian De Vera Talampas Ray Augé 13 Years Ago thanks ray! i'll keep that in mind. Please sign in to reply. Reply as... Cancel
Ashish Gupta 13 Years Ago Hi Ray, Great article, helped me understand Expando quite a bit, but I do have a different but related question about searching based on custom attributes, I created another thread for it. Here's the link <a href=http://www.liferay.com/community/forums/-/message_boards/message/5807724/maximized#_19_message_5807724> Search documents by custom field values</A>Would you have any idea on how to do this ? Thanks -Ashish Please sign in to reply. Reply as... Cancel
Flavel --------- 13 Years Ago I tried the new Expando code for 6.0.5 just for kicks. Everything appeared on the page appropriately and in the database. I went to click the add accounts button, but it just refreshes the page (doesn't actually let me add an account). Was there a different structure I should be using besides: Name = "Basic", Added a row called "content" of type "text". Thanks again for the example. Please sign in to reply. Reply as... Cancel Ray Augé Flavel --------- 13 Years Ago You must make sure that on the Template configuration to uncheck "Cacheable"! Please sign in to reply. Reply as... Cancel Flavel --------- Ray Augé 13 Years Ago Gah! Right when I saw "Cacheable" I realized I had seen this in other places and forums. Works like a charm now, Thanks! Please sign in to reply. Reply as... Cancel Christophe Cariou Flavel --------- 12 Years Ago Hi Ray,I have the same need as A. Gupta :How can we use extended attributes in a lucene search ? Please sign in to reply. Reply as... Cancel Ray Augé Christophe Cariou 12 Years Ago Custom fields are indexed using a namespace (so as they won't collide with actual entity fields).The encoding is "expando/custom_fields/<fieldName>".So, if you wanted to search for a specific custom field's value you could do:+(+companyId:12345 +expando/custom_fields/favoriteColor:blue)Note that in 6.0.x (the next SP) and in 6.1 we have custom field searching enabled for all fields on all indexed entities enabled by default (so when you do a basic keyword search, it will also search on expando fields). Also (in those versions), in the basic search, if you were to perform a keyword search including the encoded <fieldName>, like this:expando/custom_fields/favoriteColor:blueit would also work. Realizing that this is not so user friendly it does mean that if you were to add a input field that passed a value for this field and then added it encoded this way to the "keywords" variable used in the search, it would work as you expect. Please sign in to reply. Reply as... Cancel
Ray Augé Flavel --------- 13 Years Ago You must make sure that on the Template configuration to uncheck "Cacheable"! Please sign in to reply. Reply as... Cancel Flavel --------- Ray Augé 13 Years Ago Gah! Right when I saw "Cacheable" I realized I had seen this in other places and forums. Works like a charm now, Thanks! Please sign in to reply. Reply as... Cancel Christophe Cariou Flavel --------- 12 Years Ago Hi Ray,I have the same need as A. Gupta :How can we use extended attributes in a lucene search ? Please sign in to reply. Reply as... Cancel Ray Augé Christophe Cariou 12 Years Ago Custom fields are indexed using a namespace (so as they won't collide with actual entity fields).The encoding is "expando/custom_fields/<fieldName>".So, if you wanted to search for a specific custom field's value you could do:+(+companyId:12345 +expando/custom_fields/favoriteColor:blue)Note that in 6.0.x (the next SP) and in 6.1 we have custom field searching enabled for all fields on all indexed entities enabled by default (so when you do a basic keyword search, it will also search on expando fields). Also (in those versions), in the basic search, if you were to perform a keyword search including the encoded <fieldName>, like this:expando/custom_fields/favoriteColor:blueit would also work. Realizing that this is not so user friendly it does mean that if you were to add a input field that passed a value for this field and then added it encoded this way to the "keywords" variable used in the search, it would work as you expect. Please sign in to reply. Reply as... Cancel
Flavel --------- Ray Augé 13 Years Ago Gah! Right when I saw "Cacheable" I realized I had seen this in other places and forums. Works like a charm now, Thanks! Please sign in to reply. Reply as... Cancel Christophe Cariou Flavel --------- 12 Years Ago Hi Ray,I have the same need as A. Gupta :How can we use extended attributes in a lucene search ? Please sign in to reply. Reply as... Cancel Ray Augé Christophe Cariou 12 Years Ago Custom fields are indexed using a namespace (so as they won't collide with actual entity fields).The encoding is "expando/custom_fields/<fieldName>".So, if you wanted to search for a specific custom field's value you could do:+(+companyId:12345 +expando/custom_fields/favoriteColor:blue)Note that in 6.0.x (the next SP) and in 6.1 we have custom field searching enabled for all fields on all indexed entities enabled by default (so when you do a basic keyword search, it will also search on expando fields). Also (in those versions), in the basic search, if you were to perform a keyword search including the encoded <fieldName>, like this:expando/custom_fields/favoriteColor:blueit would also work. Realizing that this is not so user friendly it does mean that if you were to add a input field that passed a value for this field and then added it encoded this way to the "keywords" variable used in the search, it would work as you expect. Please sign in to reply. Reply as... Cancel
Christophe Cariou Flavel --------- 12 Years Ago Hi Ray,I have the same need as A. Gupta :How can we use extended attributes in a lucene search ? Please sign in to reply. Reply as... Cancel Ray Augé Christophe Cariou 12 Years Ago Custom fields are indexed using a namespace (so as they won't collide with actual entity fields).The encoding is "expando/custom_fields/<fieldName>".So, if you wanted to search for a specific custom field's value you could do:+(+companyId:12345 +expando/custom_fields/favoriteColor:blue)Note that in 6.0.x (the next SP) and in 6.1 we have custom field searching enabled for all fields on all indexed entities enabled by default (so when you do a basic keyword search, it will also search on expando fields). Also (in those versions), in the basic search, if you were to perform a keyword search including the encoded <fieldName>, like this:expando/custom_fields/favoriteColor:blueit would also work. Realizing that this is not so user friendly it does mean that if you were to add a input field that passed a value for this field and then added it encoded this way to the "keywords" variable used in the search, it would work as you expect. Please sign in to reply. Reply as... Cancel
Ray Augé Christophe Cariou 12 Years Ago Custom fields are indexed using a namespace (so as they won't collide with actual entity fields).The encoding is "expando/custom_fields/<fieldName>".So, if you wanted to search for a specific custom field's value you could do:+(+companyId:12345 +expando/custom_fields/favoriteColor:blue)Note that in 6.0.x (the next SP) and in 6.1 we have custom field searching enabled for all fields on all indexed entities enabled by default (so when you do a basic keyword search, it will also search on expando fields). Also (in those versions), in the basic search, if you were to perform a keyword search including the encoded <fieldName>, like this:expando/custom_fields/favoriteColor:blueit would also work. Realizing that this is not so user friendly it does mean that if you were to add a input field that passed a value for this field and then added it encoded this way to the "keywords" variable used in the search, it would work as you expect. Please sign in to reply. Reply as... Cancel