Xinsheng Robert Chen 13 Years Ago Hi, Jonas, good article! Please sign in to reply. Reply as... Cancel
Bavithra Rajendran 13 Years Ago Sir, Thanks for writing about this helpful feature! Please sign in to reply. Reply as... Cancel
Zankar Shah 13 Years Ago Hi Jonas!! Nice to read about custom attributes. However I always had this question. Is it better to have custom attributes or create an extra table if you want to add some fields to any liferay entities? Please sign in to reply. Reply as... Cancel Jonas X. Yuan Zankar Shah 13 Years Ago Hi Zankar, Thanks.Both approaches (having custom attributes or creating an extra table) have their own advantages and disadvantages. You may choose one of them based on requirements. Please sign in to reply. Reply as... Cancel teo ala Jonas X. Yuan 13 Years Ago Can any plz explain how to set custom attribute list values. Please sign in to reply. Reply as... Cancel Jonas X. Yuan teo ala 13 Years Ago Hi Teo, thanks. you may refer to details about usage of Custom Attributes from the book: http://www.amazon.com/Liferay-Portal-6-Enterprise-Intranets/dp/1849510385.or wiki pages.Hope that it helps, Please sign in to reply. Reply as... Cancel
Jonas X. Yuan Zankar Shah 13 Years Ago Hi Zankar, Thanks.Both approaches (having custom attributes or creating an extra table) have their own advantages and disadvantages. You may choose one of them based on requirements. Please sign in to reply. Reply as... Cancel teo ala Jonas X. Yuan 13 Years Ago Can any plz explain how to set custom attribute list values. Please sign in to reply. Reply as... Cancel Jonas X. Yuan teo ala 13 Years Ago Hi Teo, thanks. you may refer to details about usage of Custom Attributes from the book: http://www.amazon.com/Liferay-Portal-6-Enterprise-Intranets/dp/1849510385.or wiki pages.Hope that it helps, Please sign in to reply. Reply as... Cancel
teo ala Jonas X. Yuan 13 Years Ago Can any plz explain how to set custom attribute list values. Please sign in to reply. Reply as... Cancel Jonas X. Yuan teo ala 13 Years Ago Hi Teo, thanks. you may refer to details about usage of Custom Attributes from the book: http://www.amazon.com/Liferay-Portal-6-Enterprise-Intranets/dp/1849510385.or wiki pages.Hope that it helps, Please sign in to reply. Reply as... Cancel
Jonas X. Yuan teo ala 13 Years Ago Hi Teo, thanks. you may refer to details about usage of Custom Attributes from the book: http://www.amazon.com/Liferay-Portal-6-Enterprise-Intranets/dp/1849510385.or wiki pages.Hope that it helps, Please sign in to reply. Reply as... Cancel
Tomas Polesovsky 13 Years Ago Hi allJust FYI: You can't join Expando Hibernate entity with your entities. This means - you'll have problem when you try to create list of your entities with expando in one table. Moreover it is almost impossible to sort them (with paging) using expando column.See http://issues.liferay.com/browse/LPS-8292 Please sign in to reply. Reply as... Cancel Jonas X. Yuan Tomas Polesovsky 13 Years Ago Thanks, Tomas. The problem (http://issues.liferay.com/browse/LPS-8292) happens in both 5.2 (CE and EE SP1-4) and 6.0 (GA and EE). And moreover, portal core models are not accessible in Dynamic Query of Plugins SDK. Please sign in to reply. Reply as... Cancel Tomas Polesovsky Jonas X. Yuan 13 Years Ago Exactly that's it Thanks Jonas Please sign in to reply. Reply as... Cancel
Jonas X. Yuan Tomas Polesovsky 13 Years Ago Thanks, Tomas. The problem (http://issues.liferay.com/browse/LPS-8292) happens in both 5.2 (CE and EE SP1-4) and 6.0 (GA and EE). And moreover, portal core models are not accessible in Dynamic Query of Plugins SDK. Please sign in to reply. Reply as... Cancel Tomas Polesovsky Jonas X. Yuan 13 Years Ago Exactly that's it Thanks Jonas Please sign in to reply. Reply as... Cancel
Tomas Polesovsky Jonas X. Yuan 13 Years Ago Exactly that's it Thanks Jonas Please sign in to reply. Reply as... Cancel
Sandeep Nair 13 Years Ago Nice article. But i believe custom attribute shouldnt be created for the portlets that we develop, since it is a mess to use the same in jsp with huge tags. For custom portlet since it is developed by us, its lot easier to modify service.xml and add the column there and rebuild service. Custom attributes is good i guess only for core liferay models. Please sign in to reply. Reply as... Cancel Jonas X. Yuan Sandeep Nair 13 Years Ago - Edited Hi Sandeep, thanks. As a developer, I would agree with you to use custom asset model in pluginsAs a portal admin or content creator, I would never touch any Java code, but add additional fields in run-time. Thus custom attributes would be ideal approach. Do you agree?Best regards,Jonas Yuan Please sign in to reply. Reply as... Cancel Sandeep Nair Jonas X. Yuan 13 Years Ago Hmm true. But tht depends on size of the portlet too how big it is and number of custom attributes that we want. Suppose the portlet is very big with huge functionality and if there is a requirement to have less than 5 columns i would go for custom attribute. I would use custom attribute if its something in extension environment. As you see adding custom attribute still doesnt eliminate code writing. The main headache is updating the value, you have to update each column separately with class name and class pk. Whereas if its in model its quite easy. But it still depends on wht is the requirement. Please sign in to reply. Reply as... Cancel Jonas X. Yuan Sandeep Nair 13 Years Ago Thank you, Sandeep! It depends on what the requirement is ... :-) Both approaches (having custom attributes or adding extra columns) have their own advantages and disadvantages. Please sign in to reply. Reply as... Cancel
Jonas X. Yuan Sandeep Nair 13 Years Ago - Edited Hi Sandeep, thanks. As a developer, I would agree with you to use custom asset model in pluginsAs a portal admin or content creator, I would never touch any Java code, but add additional fields in run-time. Thus custom attributes would be ideal approach. Do you agree?Best regards,Jonas Yuan Please sign in to reply. Reply as... Cancel Sandeep Nair Jonas X. Yuan 13 Years Ago Hmm true. But tht depends on size of the portlet too how big it is and number of custom attributes that we want. Suppose the portlet is very big with huge functionality and if there is a requirement to have less than 5 columns i would go for custom attribute. I would use custom attribute if its something in extension environment. As you see adding custom attribute still doesnt eliminate code writing. The main headache is updating the value, you have to update each column separately with class name and class pk. Whereas if its in model its quite easy. But it still depends on wht is the requirement. Please sign in to reply. Reply as... Cancel Jonas X. Yuan Sandeep Nair 13 Years Ago Thank you, Sandeep! It depends on what the requirement is ... :-) Both approaches (having custom attributes or adding extra columns) have their own advantages and disadvantages. Please sign in to reply. Reply as... Cancel
Sandeep Nair Jonas X. Yuan 13 Years Ago Hmm true. But tht depends on size of the portlet too how big it is and number of custom attributes that we want. Suppose the portlet is very big with huge functionality and if there is a requirement to have less than 5 columns i would go for custom attribute. I would use custom attribute if its something in extension environment. As you see adding custom attribute still doesnt eliminate code writing. The main headache is updating the value, you have to update each column separately with class name and class pk. Whereas if its in model its quite easy. But it still depends on wht is the requirement. Please sign in to reply. Reply as... Cancel Jonas X. Yuan Sandeep Nair 13 Years Ago Thank you, Sandeep! It depends on what the requirement is ... :-) Both approaches (having custom attributes or adding extra columns) have their own advantages and disadvantages. Please sign in to reply. Reply as... Cancel
Jonas X. Yuan Sandeep Nair 13 Years Ago Thank you, Sandeep! It depends on what the requirement is ... :-) Both approaches (having custom attributes or adding extra columns) have their own advantages and disadvantages. Please sign in to reply. Reply as... Cancel
RoK . 13 Years Ago I need to add a custom field to Calendar Events. Calendar events can be used to create lists of future Conferences, Workshops, etc. The current implementation however does not support rich text to be entered in the event dialog. However, it is also not possible to add a rich text box using the Custom Fields. Will this be supported in future? Please sign in to reply. Reply as... Cancel Simon Gołębiewski RoK . 13 Years Ago RoK, this is not fault of Custom Fields. Custom Field will store any value you want (text=html). What you need to do is extend Calendar portlet with WYSIWYG editor (that will enables you to add HTML to event description) and then extend Calendar portlet view to not escape HTML tags. Please sign in to reply. Reply as... Cancel RoK . Simon Gołębiewski 13 Years Ago Thanks, but this is evident: when you are able to programme you can change everything (although i this is only restricted possible when using EE edition). i am looking from the perspective of the current userinterface options in the control panel. It would be better that a type 'html text' could be selected there. Please sign in to reply. Reply as... Cancel Jonas X. Yuan RoK . 13 Years Ago - Edited Hi Rok, custom fields only support simple types for now. Complex types will get supported later, likeAdding custom types (Image Gallery images and Document Library documents) in custom attributes (Expando)see http://issues.liferay.com/browse/LPS-2087. Please sign in to reply. Reply as... Cancel Jonas X. Yuan Simon Gołębiewski 13 Years Ago Thanks to Simon. Please sign in to reply. Reply as... Cancel Jonas X. Yuan RoK . 13 Years Ago - Edited Hi Rok, Thanks. custom fields are available to Calendar Events by default. You can use custom fields on any calendar events in Control Panel. Please sign in to reply. Reply as... Cancel
Simon Gołębiewski RoK . 13 Years Ago RoK, this is not fault of Custom Fields. Custom Field will store any value you want (text=html). What you need to do is extend Calendar portlet with WYSIWYG editor (that will enables you to add HTML to event description) and then extend Calendar portlet view to not escape HTML tags. Please sign in to reply. Reply as... Cancel RoK . Simon Gołębiewski 13 Years Ago Thanks, but this is evident: when you are able to programme you can change everything (although i this is only restricted possible when using EE edition). i am looking from the perspective of the current userinterface options in the control panel. It would be better that a type 'html text' could be selected there. Please sign in to reply. Reply as... Cancel Jonas X. Yuan RoK . 13 Years Ago - Edited Hi Rok, custom fields only support simple types for now. Complex types will get supported later, likeAdding custom types (Image Gallery images and Document Library documents) in custom attributes (Expando)see http://issues.liferay.com/browse/LPS-2087. Please sign in to reply. Reply as... Cancel Jonas X. Yuan Simon Gołębiewski 13 Years Ago Thanks to Simon. Please sign in to reply. Reply as... Cancel
RoK . Simon Gołębiewski 13 Years Ago Thanks, but this is evident: when you are able to programme you can change everything (although i this is only restricted possible when using EE edition). i am looking from the perspective of the current userinterface options in the control panel. It would be better that a type 'html text' could be selected there. Please sign in to reply. Reply as... Cancel Jonas X. Yuan RoK . 13 Years Ago - Edited Hi Rok, custom fields only support simple types for now. Complex types will get supported later, likeAdding custom types (Image Gallery images and Document Library documents) in custom attributes (Expando)see http://issues.liferay.com/browse/LPS-2087. Please sign in to reply. Reply as... Cancel
Jonas X. Yuan RoK . 13 Years Ago - Edited Hi Rok, custom fields only support simple types for now. Complex types will get supported later, likeAdding custom types (Image Gallery images and Document Library documents) in custom attributes (Expando)see http://issues.liferay.com/browse/LPS-2087. Please sign in to reply. Reply as... Cancel
Jonas X. Yuan Simon Gołębiewski 13 Years Ago Thanks to Simon. Please sign in to reply. Reply as... Cancel
Jonas X. Yuan RoK . 13 Years Ago - Edited Hi Rok, Thanks. custom fields are available to Calendar Events by default. You can use custom fields on any calendar events in Control Panel. Please sign in to reply. Reply as... Cancel
Abhay Doshi 13 Years Ago Great article Jonas. I am trying to enhance the account creation form using hooks. So in this respect, I have created a couple of custom fields for User. Now, how do I register them so that it works with the hook (create_account.jsp) ? Please sign in to reply. Reply as... Cancel
Ashish Renapurkar 12 Years Ago Hello Jonas Yuan,Thanks for guiding us in this context.Good work. Please sign in to reply. Reply as... Cancel
Antoine Comble 11 Years Ago Hi Jonas, i wanted to download your war example knowledge-base-portlet-6.0.6.1.war but when i clicked on it, i've a page not found. Can u give me another link ? thanks for advance Please sign in to reply. Reply as... Cancel
Pradip A Bhatt 10 Years Ago Hello All,I am using Liferay 6.1 CE version. I added my custom attribute in User entity from control panel. I want to add this my custom field in create_account.jsp hook page. I added like this way.<div class="exp-ctrl-holder"><liferay-ui:custom-attribute className="<%=User.class.getName()%>"classPK="<%=0%>" editable="<%=true%>" label="<%=true%>"name="user-default-group-name" />After that i am trying to getting this value in UserLocalService hook class which extends UserLocalServiceWrapper class - (hook). I find each value from this but can not able to get my custom field value. I am trying to get custom field value like this.String defaultGroup = (String) User.getExpandoBridge().getAttribute("defaultGroupName");log.info("Default Group Name :" + defaultGroup);But I am getting null value or default value which I set at the time of adding custom attribute. I can not find my entered value from jsp page.Please help me.Regards :Pradip Bhattpradip.bhatt@aspiresoftware.in Please sign in to reply. Reply as... Cancel