Jerry Niu Hace 15 años This is awesome Ray. Thanks for the explanation and sample code! Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Jerry Niu Hace 15 años Thanks Jerry! Por favor identifíquese para votar. Contestar como... Cancelar
Ray Augé Jerry Niu Hace 15 años Thanks Jerry! Por favor identifíquese para votar. Contestar como... Cancelar
James Min Hace 15 años Wow... Now that's cool. Por favor identifíquese para votar. Contestar como... Cancelar
Tobias S. Käfer Hace 15 años Nice feature!In (since) which version is that available?GreatsTobias Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Tobias S. Käfer Hace 15 años It's currently in trunk, and should be in 5.0.2. Por favor identifíquese para votar. Contestar como... Cancelar Alvaro Del Castillo Ray Augé Hace 15 años Ray, I would update the title of the blog post to something like (Liferay Portal 5.0.2) because currently you can not use Expandos with any LRP released and the first experience from a developer trying it could be that it does not work. 5.0.2 is around the corner but ...Really nice article in any case and a very useful feature, Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Alvaro Del Castillo Hace 15 años It's updated now.Thanks Alvaro! Por favor identifíquese para votar. Contestar como... Cancelar
Ray Augé Tobias S. Käfer Hace 15 años It's currently in trunk, and should be in 5.0.2. Por favor identifíquese para votar. Contestar como... Cancelar Alvaro Del Castillo Ray Augé Hace 15 años Ray, I would update the title of the blog post to something like (Liferay Portal 5.0.2) because currently you can not use Expandos with any LRP released and the first experience from a developer trying it could be that it does not work. 5.0.2 is around the corner but ...Really nice article in any case and a very useful feature, Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Alvaro Del Castillo Hace 15 años It's updated now.Thanks Alvaro! Por favor identifíquese para votar. Contestar como... Cancelar
Alvaro Del Castillo Ray Augé Hace 15 años Ray, I would update the title of the blog post to something like (Liferay Portal 5.0.2) because currently you can not use Expandos with any LRP released and the first experience from a developer trying it could be that it does not work. 5.0.2 is around the corner but ...Really nice article in any case and a very useful feature, Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Alvaro Del Castillo Hace 15 años It's updated now.Thanks Alvaro! Por favor identifíquese para votar. Contestar como... Cancelar
Ray Augé Alvaro Del Castillo Hace 15 años It's updated now.Thanks Alvaro! Por favor identifíquese para votar. Contestar como... Cancelar
Gabor Nagy Hace 15 años Great work Ray, thanks! I was searching for a solution extend dynamically Liferay tables and I found your solution. You show an example with new table, column, etc. But what about adding an expando column/value to an existing table? Is it possible? I tried to add an expando column 'foo' to user_ table and store value 'bar' for the specified user as the following way:User user = UserLocalServiceUtil.getUserByEmailAddress(...);ExpandoTable table = ExpandoTableLocalServiceUtil.addTable(PortalUtil.getClassNameId(user.getClass().getName()), "user_");if(table!=null) { ExpandoColumn column = ExpandoColumnLocalServiceUtil.getColumn(table.getTableId(), "foo"); if(column!=null){ ExpandoValueLocalServiceUtil.addValue(column.getColumnId(), user.getUSerId(), user.getUserId(), "bar"); }}Is this correct? I'm afraid the second parameter of addValue (rowid) isn't correct, but what should I write there? And what about the third parameter (classPK), is that right? classPK is the primary key of the user?If my code/idea is correct, I would like to ask you about deleting a "parent" record. I'll try to explain what I think :-) I put the value 'bar' into expando table for the user Joe Blogs. When I delete Joe Blogs from Liferay the 'bar' value from expando tables will not be deleted. Is this right? Should I delete manually expando records? There isn't a way to do this automatically? Do you have any idea? Or I misunderstood the whole expando-thing? :-)Thanks,Gabor Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Gabor Nagy Hace 15 años Hello Gabor,The API has changed slightly. Have a look at:http://lportal.svn.sourceforge.net/svnroot/lportal/portal/trunk/portal-impl/src/com/liferay/portlet/expando/service/impl/ExpandoValueLocalServiceImpl.javayou'll notice that the final API is a little more intuitive and easier to work with. Also, the final (stable) API will officially be available in the upcomming 5.0.2 release, due out next week. For example, you don't need to worry about rowIds as these are more for internal management than external (though it is available for use in iterating over table rows...).Also, at least for users, any ExpandoValue associated directly with the User object and referenced by User's primary key will be deleted when the user is deleted, regardless of what table it's in... so you can have 100 tables associated with the User class and when a user is deleted... all the values associated with that user, in every table, go with it.HTH! Por favor identifíquese para votar. Contestar como... Cancelar Gabor Nagy Ray Augé Hace 15 años Thank you Ray! It sounds good! We waiting for 5.0.2 :-)However, I found a solution for delete problem. I added this line to portal/ext.properties:value.object.listener.com.liferay.portal.model.User=com.liferay.portal.model.UserListener,com.liferay.portal.model.MyUserListenerThen I created a new class MyUserListener and in onAfterRemove method:User user = (User)model;ExpandoValueLocalServiceUtil.deleteValues(PortalUtil.getClassNameId(user.getClass().getName()), user.getUserId());This removes all records belonging to the deleted user.But, I'll take a look at the new API and rewrite my code with the official solution. Por favor identifíquese para votar. Contestar como... Cancelar
Ray Augé Gabor Nagy Hace 15 años Hello Gabor,The API has changed slightly. Have a look at:http://lportal.svn.sourceforge.net/svnroot/lportal/portal/trunk/portal-impl/src/com/liferay/portlet/expando/service/impl/ExpandoValueLocalServiceImpl.javayou'll notice that the final API is a little more intuitive and easier to work with. Also, the final (stable) API will officially be available in the upcomming 5.0.2 release, due out next week. For example, you don't need to worry about rowIds as these are more for internal management than external (though it is available for use in iterating over table rows...).Also, at least for users, any ExpandoValue associated directly with the User object and referenced by User's primary key will be deleted when the user is deleted, regardless of what table it's in... so you can have 100 tables associated with the User class and when a user is deleted... all the values associated with that user, in every table, go with it.HTH! Por favor identifíquese para votar. Contestar como... Cancelar Gabor Nagy Ray Augé Hace 15 años Thank you Ray! It sounds good! We waiting for 5.0.2 :-)However, I found a solution for delete problem. I added this line to portal/ext.properties:value.object.listener.com.liferay.portal.model.User=com.liferay.portal.model.UserListener,com.liferay.portal.model.MyUserListenerThen I created a new class MyUserListener and in onAfterRemove method:User user = (User)model;ExpandoValueLocalServiceUtil.deleteValues(PortalUtil.getClassNameId(user.getClass().getName()), user.getUserId());This removes all records belonging to the deleted user.But, I'll take a look at the new API and rewrite my code with the official solution. Por favor identifíquese para votar. Contestar como... Cancelar
Gabor Nagy Ray Augé Hace 15 años Thank you Ray! It sounds good! We waiting for 5.0.2 :-)However, I found a solution for delete problem. I added this line to portal/ext.properties:value.object.listener.com.liferay.portal.model.User=com.liferay.portal.model.UserListener,com.liferay.portal.model.MyUserListenerThen I created a new class MyUserListener and in onAfterRemove method:User user = (User)model;ExpandoValueLocalServiceUtil.deleteValues(PortalUtil.getClassNameId(user.getClass().getName()), user.getUserId());This removes all records belonging to the deleted user.But, I'll take a look at the new API and rewrite my code with the official solution. Por favor identifíquese para votar. Contestar como... Cancelar
b v j Hace 15 años Thanks for the post. I initially approached this as an "oh carp, yet another thing to learn about Liferay". Well, I'm glad I read through your post. Journal templates are fantastic! There was some initial confusion about default variables. I discovered the JT VM instances get initialized differently than regular portlet VM instances. For example, getting the user id was a bit difficult and I finally pulled it from the request tree. It would probably be beneficial to provide privileged based access to services instead of using hard filters in the boot properties file. Nonetheless, it was all a worthwhile experience that exposed some great functionality!Is it possible to create reusable VM libraries within the JT paradigm? Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé b v j Hace 15 años It is possible in Journal to create reusable VM libraries. You simply place your library code in standalone JTs (JT's not associated with any JStructure). Then you can refer to these "library templates" directly from others using the VM #parse method. The only catch is that you must prepend the name of the Template with "$journalTemplatesPath".e.g.#parse ("$journalTemplatesPath/MY_VM_LIB") Por favor identifíquese para votar. Contestar como... Cancelar b v j Ray Augé Hace 15 años Perfect - thank you. Por favor identifíquese para votar. Contestar como... Cancelar
Ray Augé b v j Hace 15 años It is possible in Journal to create reusable VM libraries. You simply place your library code in standalone JTs (JT's not associated with any JStructure). Then you can refer to these "library templates" directly from others using the VM #parse method. The only catch is that you must prepend the name of the Template with "$journalTemplatesPath".e.g.#parse ("$journalTemplatesPath/MY_VM_LIB") Por favor identifíquese para votar. Contestar como... Cancelar b v j Ray Augé Hace 15 años Perfect - thank you. Por favor identifíquese para votar. Contestar como... Cancelar
b v j Ray Augé Hace 15 años Perfect - thank you. Por favor identifíquese para votar. Contestar como... Cancelar
Josh Asbury Hace 15 años Thanks for this, Ray! I have just gotten around to playing with this functionality, and it's awesome. Question, though: is it possible in the current model to return only rows that have been created by the signed-in user? I am looking at:public java.util.List<com.liferay.portlet.expando.model.ExpandoRow> getRows( long tableId, int start, int end) throws com.liferay.portal.SystemException;and don't think I see a way to extract that data. I have modified your code slightly to add the current user ID as a column.Thanks! Por favor identifíquese para votar. Contestar como... Cancelar nidhi singh Josh Asbury Hace 15 años Hi Ray!I am using UserGroupLocalService in VM file.I want to get userGroupId from the usergroup table which in database, but in UserGroupLocalService does'nt have any method for getting userGroupId.$userGroupLocalService.getUserUserGroups()how will i get?please help me.thanks Por favor identifíquese para votar. Contestar como... Cancelar
nidhi singh Josh Asbury Hace 15 años Hi Ray!I am using UserGroupLocalService in VM file.I want to get userGroupId from the usergroup table which in database, but in UserGroupLocalService does'nt have any method for getting userGroupId.$userGroupLocalService.getUserUserGroups()how will i get?please help me.thanks Por favor identifíquese para votar. Contestar como... Cancelar
Thomas Kellerer Hace 15 años I'm trying to use this feature to display data that is saved to the database through a "Request Form". I retrieved the generated table name (109_INSTANCE_98OX_201, basically the instance-id of the portlet) from the EXPANDOTABLE table, but when trying to access the table it fails. Basically the #set ($accountsTable = $expandoTableLocalService.getTable($accountsTableName, $accountsTableName))does not work even though $accountsTableName contains the correct table name I veried that the feature itself was working by creating a table manually through the API.What am I missing? Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Thomas Kellerer Hace 15 años Try:#set ($accountsTable = $expandoTableLocalService.getTable("com.liferay.portlet.webform.util.WebFormUtil", $accountsTableName)) Por favor identifíquese para votar. Contestar como... Cancelar Thomas Kellerer Ray Augé Hace 15 años Great that worked, thanks a lot Por favor identifíquese para votar. Contestar como... Cancelar Jonas Yuan Ray Augé Hace 15 años Hi Ray, great!On question, do the attribute name and value support locale?It was notified that portlet 139 Expando was applied on users and organizations. Logically, it should be possible to apply portlet 139 Expando on user groups, communities, roles, etc. Is it right?Thanks Jonas Yuan Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Jonas Yuan Hace 15 años If there exists a localization for the attribute name it will be used. Thus you can localize the names by adding the key to the locale files. The values themselves are not localized.Custom attributes can be applied to any entity generated via service builder, as such the Expando portlet can be used to manage those. No changes are required to the portlet, juswt create a portletURL as you find in the User and Organization management. Por favor identifíquese para votar. Contestar como... Cancelar Jonas Yuan Ray Augé Hace 15 años Hi Ray, Thank you! How about custom types in custom attributes? That is, adding custom types (Image Gallery images and Document Library documents) in custom attributes (Expando).http://issues.liferay.com/browse/LPS-2087Any comments or suggestions? Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Jonas Yuan Hace 15 años - Editado Why don't you just store a reference to one of those types?e.g. a custom attribute called "favorite-pic" of type string stores an url to the image, or of type long, stores the primaryKey of the image, etc... All you need to provide is the selection and rendering logic. Both very easy to implement based on existing examples. Por favor identifíquese para votar. Contestar como... Cancelar Thomas Kellerer Ray Augé Hace 15 años Hi, I tried this again with 5.2.1, and it does not seem to work any longer. I have a webform and data is submitted. So I looked up the generated table in the database (EXPANDOTABLE). The entry there gave me the tableanme: 1_WAR_webformportlet_INSTANCE_y0Ik_2But the following code does not return a rowcount:#set ($tableName = "1_WAR_webformportlet_INSTANCE_y0Ik_2")#set ($tableType = "com.liferay.portlet.webform.util.WebFormUtil")#set ($rowCount = $expandoRowLocalService.getRowsCount($tableType, $tableName))what am I missing here? Por favor identifíquese para votar. Contestar como... Cancelar Thomas Kellerer Thomas Kellerer Hace 15 años I found my error. Apparently the table type has change fromcom.liferay.portlet.webform.util.WebFormUtilto com.liferay.webform.util.WebFormUtilNow it's working again Por favor identifíquese para votar. Contestar como... Cancelar
Ray Augé Thomas Kellerer Hace 15 años Try:#set ($accountsTable = $expandoTableLocalService.getTable("com.liferay.portlet.webform.util.WebFormUtil", $accountsTableName)) Por favor identifíquese para votar. Contestar como... Cancelar Thomas Kellerer Ray Augé Hace 15 años Great that worked, thanks a lot Por favor identifíquese para votar. Contestar como... Cancelar Jonas Yuan Ray Augé Hace 15 años Hi Ray, great!On question, do the attribute name and value support locale?It was notified that portlet 139 Expando was applied on users and organizations. Logically, it should be possible to apply portlet 139 Expando on user groups, communities, roles, etc. Is it right?Thanks Jonas Yuan Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Jonas Yuan Hace 15 años If there exists a localization for the attribute name it will be used. Thus you can localize the names by adding the key to the locale files. The values themselves are not localized.Custom attributes can be applied to any entity generated via service builder, as such the Expando portlet can be used to manage those. No changes are required to the portlet, juswt create a portletURL as you find in the User and Organization management. Por favor identifíquese para votar. Contestar como... Cancelar Jonas Yuan Ray Augé Hace 15 años Hi Ray, Thank you! How about custom types in custom attributes? That is, adding custom types (Image Gallery images and Document Library documents) in custom attributes (Expando).http://issues.liferay.com/browse/LPS-2087Any comments or suggestions? Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Jonas Yuan Hace 15 años - Editado Why don't you just store a reference to one of those types?e.g. a custom attribute called "favorite-pic" of type string stores an url to the image, or of type long, stores the primaryKey of the image, etc... All you need to provide is the selection and rendering logic. Both very easy to implement based on existing examples. Por favor identifíquese para votar. Contestar como... Cancelar Thomas Kellerer Ray Augé Hace 15 años Hi, I tried this again with 5.2.1, and it does not seem to work any longer. I have a webform and data is submitted. So I looked up the generated table in the database (EXPANDOTABLE). The entry there gave me the tableanme: 1_WAR_webformportlet_INSTANCE_y0Ik_2But the following code does not return a rowcount:#set ($tableName = "1_WAR_webformportlet_INSTANCE_y0Ik_2")#set ($tableType = "com.liferay.portlet.webform.util.WebFormUtil")#set ($rowCount = $expandoRowLocalService.getRowsCount($tableType, $tableName))what am I missing here? Por favor identifíquese para votar. Contestar como... Cancelar Thomas Kellerer Thomas Kellerer Hace 15 años I found my error. Apparently the table type has change fromcom.liferay.portlet.webform.util.WebFormUtilto com.liferay.webform.util.WebFormUtilNow it's working again Por favor identifíquese para votar. Contestar como... Cancelar
Thomas Kellerer Ray Augé Hace 15 años Great that worked, thanks a lot Por favor identifíquese para votar. Contestar como... Cancelar
Jonas Yuan Ray Augé Hace 15 años Hi Ray, great!On question, do the attribute name and value support locale?It was notified that portlet 139 Expando was applied on users and organizations. Logically, it should be possible to apply portlet 139 Expando on user groups, communities, roles, etc. Is it right?Thanks Jonas Yuan Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Jonas Yuan Hace 15 años If there exists a localization for the attribute name it will be used. Thus you can localize the names by adding the key to the locale files. The values themselves are not localized.Custom attributes can be applied to any entity generated via service builder, as such the Expando portlet can be used to manage those. No changes are required to the portlet, juswt create a portletURL as you find in the User and Organization management. Por favor identifíquese para votar. Contestar como... Cancelar Jonas Yuan Ray Augé Hace 15 años Hi Ray, Thank you! How about custom types in custom attributes? That is, adding custom types (Image Gallery images and Document Library documents) in custom attributes (Expando).http://issues.liferay.com/browse/LPS-2087Any comments or suggestions? Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Jonas Yuan Hace 15 años - Editado Why don't you just store a reference to one of those types?e.g. a custom attribute called "favorite-pic" of type string stores an url to the image, or of type long, stores the primaryKey of the image, etc... All you need to provide is the selection and rendering logic. Both very easy to implement based on existing examples. Por favor identifíquese para votar. Contestar como... Cancelar
Ray Augé Jonas Yuan Hace 15 años If there exists a localization for the attribute name it will be used. Thus you can localize the names by adding the key to the locale files. The values themselves are not localized.Custom attributes can be applied to any entity generated via service builder, as such the Expando portlet can be used to manage those. No changes are required to the portlet, juswt create a portletURL as you find in the User and Organization management. Por favor identifíquese para votar. Contestar como... Cancelar Jonas Yuan Ray Augé Hace 15 años Hi Ray, Thank you! How about custom types in custom attributes? That is, adding custom types (Image Gallery images and Document Library documents) in custom attributes (Expando).http://issues.liferay.com/browse/LPS-2087Any comments or suggestions? Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Jonas Yuan Hace 15 años - Editado Why don't you just store a reference to one of those types?e.g. a custom attribute called "favorite-pic" of type string stores an url to the image, or of type long, stores the primaryKey of the image, etc... All you need to provide is the selection and rendering logic. Both very easy to implement based on existing examples. Por favor identifíquese para votar. Contestar como... Cancelar
Jonas Yuan Ray Augé Hace 15 años Hi Ray, Thank you! How about custom types in custom attributes? That is, adding custom types (Image Gallery images and Document Library documents) in custom attributes (Expando).http://issues.liferay.com/browse/LPS-2087Any comments or suggestions? Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Jonas Yuan Hace 15 años - Editado Why don't you just store a reference to one of those types?e.g. a custom attribute called "favorite-pic" of type string stores an url to the image, or of type long, stores the primaryKey of the image, etc... All you need to provide is the selection and rendering logic. Both very easy to implement based on existing examples. Por favor identifíquese para votar. Contestar como... Cancelar
Ray Augé Jonas Yuan Hace 15 años - Editado Why don't you just store a reference to one of those types?e.g. a custom attribute called "favorite-pic" of type string stores an url to the image, or of type long, stores the primaryKey of the image, etc... All you need to provide is the selection and rendering logic. Both very easy to implement based on existing examples. Por favor identifíquese para votar. Contestar como... Cancelar
Thomas Kellerer Ray Augé Hace 15 años Hi, I tried this again with 5.2.1, and it does not seem to work any longer. I have a webform and data is submitted. So I looked up the generated table in the database (EXPANDOTABLE). The entry there gave me the tableanme: 1_WAR_webformportlet_INSTANCE_y0Ik_2But the following code does not return a rowcount:#set ($tableName = "1_WAR_webformportlet_INSTANCE_y0Ik_2")#set ($tableType = "com.liferay.portlet.webform.util.WebFormUtil")#set ($rowCount = $expandoRowLocalService.getRowsCount($tableType, $tableName))what am I missing here? Por favor identifíquese para votar. Contestar como... Cancelar Thomas Kellerer Thomas Kellerer Hace 15 años I found my error. Apparently the table type has change fromcom.liferay.portlet.webform.util.WebFormUtilto com.liferay.webform.util.WebFormUtilNow it's working again Por favor identifíquese para votar. Contestar como... Cancelar
Thomas Kellerer Thomas Kellerer Hace 15 años I found my error. Apparently the table type has change fromcom.liferay.portlet.webform.util.WebFormUtilto com.liferay.webform.util.WebFormUtilNow it's working again Por favor identifíquese para votar. Contestar como... Cancelar
nidhi singh Hace 15 años Hi Ray,I read this blog, and create new table user in expando it has 2 coulumn userid and points,but i want to map userid of this table to userID of user table.when we delete any user in liferay, same user is also deleted in expando user table.how will i do please reply Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé nidhi singh Hace 15 años When you set the className of the table to 'com.liferay.portal.model.User' and the primaryKey to that of a given user, the data will be deleted when the user is deleted automatically. Por favor identifíquese para votar. Contestar como... Cancelar
Ray Augé nidhi singh Hace 15 años When you set the className of the table to 'com.liferay.portal.model.User' and the primaryKey to that of a given user, the data will be deleted when the user is deleted automatically. Por favor identifíquese para votar. Contestar como... Cancelar
auditya manikanta vadrevu Hace 15 años HI RAY,iam trying expandos thing in portal 5.1.1 but it is not performing well.there is no error in code, i have copied the template as specifed.when i click save the values are not saving. and there is no error in logs also .what can be the problem? Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé auditya manikanta vadrevu Hace 15 años The API has changed slightly. (I have not updated the Post, sorry!)Try:$expandoValueServiceUtil.addValue( $className, $tableName, $columnName, $classPK, $columnValue) Por favor identifíquese para votar. Contestar como... Cancelar
Ray Augé auditya manikanta vadrevu Hace 15 años The API has changed slightly. (I have not updated the Post, sorry!)Try:$expandoValueServiceUtil.addValue( $className, $tableName, $columnName, $classPK, $columnValue) Por favor identifíquese para votar. Contestar como... Cancelar
Thomas Kellerer Hace 15 años After getting it to work with 5.2 I have a problem with caching. I can see four entries in the database but the template only shows 3 of them. The "Cacheable" attribute is disabled for my VM template, but I even restarted Liferay but still can't see the new row. Is there another level of caching? But after restarting the server all those caches should be empty, right? Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Thomas Kellerer Hace 15 años I'll have to test this. Can you file a bug and provide a minimal test case? Thanks! Por favor identifíquese para votar. Contestar como... Cancelar Thomas Kellerer Ray Augé Hace 15 años Thanks for the answer. It's hard do create a test case (because some rows are show) but I'll try. Is there anything I can turn on in Liferay to debug that in my environment? e.g. log messages to find out what's going on? Por favor identifíquese para votar. Contestar como... Cancelar Chris Whittle Ray Augé Hace 15 años This is very cool.. we are hoping to use it to replace some of our sharepoint lists... my problem is when I copy the template you have and try to use it in a content it doesn't show.. all my other do... am I missing a step? (Using 5.1.2) Por favor identifíquese para votar. Contestar como... Cancelar Chris Whittle Chris Whittle Hace 15 años nevermind I missed the structure.... Heres the rub now... It renders but when I hit the create button it thinks and the does nothing... Por favor identifíquese para votar. Contestar como... Cancelar Chris Whittle Chris Whittle Hace 15 años nevermind I missed the structure.... Heres the rub now... It renders but when I hit the create button it thinks and the does nothing... Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Chris Whittle Hace 15 años Not exactly sure what you mean. Can you clarify? Por favor identifíquese para votar. Contestar como... Cancelar
Ray Augé Thomas Kellerer Hace 15 años I'll have to test this. Can you file a bug and provide a minimal test case? Thanks! Por favor identifíquese para votar. Contestar como... Cancelar Thomas Kellerer Ray Augé Hace 15 años Thanks for the answer. It's hard do create a test case (because some rows are show) but I'll try. Is there anything I can turn on in Liferay to debug that in my environment? e.g. log messages to find out what's going on? Por favor identifíquese para votar. Contestar como... Cancelar Chris Whittle Ray Augé Hace 15 años This is very cool.. we are hoping to use it to replace some of our sharepoint lists... my problem is when I copy the template you have and try to use it in a content it doesn't show.. all my other do... am I missing a step? (Using 5.1.2) Por favor identifíquese para votar. Contestar como... Cancelar Chris Whittle Chris Whittle Hace 15 años nevermind I missed the structure.... Heres the rub now... It renders but when I hit the create button it thinks and the does nothing... Por favor identifíquese para votar. Contestar como... Cancelar Chris Whittle Chris Whittle Hace 15 años nevermind I missed the structure.... Heres the rub now... It renders but when I hit the create button it thinks and the does nothing... Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Chris Whittle Hace 15 años Not exactly sure what you mean. Can you clarify? Por favor identifíquese para votar. Contestar como... Cancelar
Thomas Kellerer Ray Augé Hace 15 años Thanks for the answer. It's hard do create a test case (because some rows are show) but I'll try. Is there anything I can turn on in Liferay to debug that in my environment? e.g. log messages to find out what's going on? Por favor identifíquese para votar. Contestar como... Cancelar
Chris Whittle Ray Augé Hace 15 años This is very cool.. we are hoping to use it to replace some of our sharepoint lists... my problem is when I copy the template you have and try to use it in a content it doesn't show.. all my other do... am I missing a step? (Using 5.1.2) Por favor identifíquese para votar. Contestar como... Cancelar Chris Whittle Chris Whittle Hace 15 años nevermind I missed the structure.... Heres the rub now... It renders but when I hit the create button it thinks and the does nothing... Por favor identifíquese para votar. Contestar como... Cancelar Chris Whittle Chris Whittle Hace 15 años nevermind I missed the structure.... Heres the rub now... It renders but when I hit the create button it thinks and the does nothing... Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Chris Whittle Hace 15 años Not exactly sure what you mean. Can you clarify? Por favor identifíquese para votar. Contestar como... Cancelar
Chris Whittle Chris Whittle Hace 15 años nevermind I missed the structure.... Heres the rub now... It renders but when I hit the create button it thinks and the does nothing... Por favor identifíquese para votar. Contestar como... Cancelar
Chris Whittle Chris Whittle Hace 15 años nevermind I missed the structure.... Heres the rub now... It renders but when I hit the create button it thinks and the does nothing... Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Chris Whittle Hace 15 años Not exactly sure what you mean. Can you clarify? Por favor identifíquese para votar. Contestar como... Cancelar
Ray Augé Chris Whittle Hace 15 años Not exactly sure what you mean. Can you clarify? Por favor identifíquese para votar. Contestar como... Cancelar
delang j Hace 15 años im confused to set pagination, could you explain more details. Por favor identifíquese para votar. Contestar como... Cancelar
delang j Hace 15 años hi ray,why it didnt works on my office's computer(linux) but perfectly works on my personal computer(window) and my friend's computer(linux).the table name,column name perfectly created but i cant insert any value. Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé delang j Hace 15 años hmm... Which version of the portal. We had a small API change in a latter version of 5.1 (I know API changes are bad... but it was a sever limitation which incurred the change, I suspect that's the problem). Por favor identifíquese para votar. Contestar como... Cancelar delang j Ray Augé Hace 15 años problem solved. i just playing with the codes.LOL.what about pagination, im big confused how to implement it Por favor identifíquese para votar. Contestar como... Cancelar
Ray Augé delang j Hace 15 años hmm... Which version of the portal. We had a small API change in a latter version of 5.1 (I know API changes are bad... but it was a sever limitation which incurred the change, I suspect that's the problem). Por favor identifíquese para votar. Contestar como... Cancelar delang j Ray Augé Hace 15 años problem solved. i just playing with the codes.LOL.what about pagination, im big confused how to implement it Por favor identifíquese para votar. Contestar como... Cancelar
delang j Ray Augé Hace 15 años problem solved. i just playing with the codes.LOL.what about pagination, im big confused how to implement it Por favor identifíquese para votar. Contestar como... Cancelar
delang j Hace 15 años what about to display 10 latest data only Por favor identifíquese para votar. Contestar como... Cancelar
Peter Mesotten Hace 15 años Apparently (and logically), Users' and Organizations' Custom Attributes are implemented with Expandos. For a Project, we need custom attributes on other entities such as events and communities as well.I've already managed to create an expandotable that refers to f.e. the CalEvent class and added fields to it. Now I want to include this extra fields in the form of the Create Event page. I found the <liferay-ui:custom-attribute-list /> JSP tag, but, f.e. for CalEvent, where do I put this tag, and will the service layer know what to do with the "extra" inputfields? Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Peter Mesotten Hace 15 años The service layer will automatically know what to do with the input fields as far as collecting them and passing them along to the service implementation layer... But unfortunately, it appears that the operation to persist them was not called in the add/update methods, specifically w.r.t. CalEvent.What version are you using? It's simple to patch, add these two lines later in the add/update methods: ExpandoBridge expandoBridge = event.getExpandoBridge(); expandoBridge.setAttributes(serviceContext); Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Ray Augé Hace 15 años I'll have to audit all the services which have support for this, but aren't persisting the custom attributes. Por favor identifíquese para votar. Contestar como... Cancelar
Ray Augé Peter Mesotten Hace 15 años The service layer will automatically know what to do with the input fields as far as collecting them and passing them along to the service implementation layer... But unfortunately, it appears that the operation to persist them was not called in the add/update methods, specifically w.r.t. CalEvent.What version are you using? It's simple to patch, add these two lines later in the add/update methods: ExpandoBridge expandoBridge = event.getExpandoBridge(); expandoBridge.setAttributes(serviceContext); Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Ray Augé Hace 15 años I'll have to audit all the services which have support for this, but aren't persisting the custom attributes. Por favor identifíquese para votar. Contestar como... Cancelar
Ray Augé Ray Augé Hace 15 años I'll have to audit all the services which have support for this, but aren't persisting the custom attributes. Por favor identifíquese para votar. Contestar como... Cancelar
Peter Mesotten Hace 15 años Thanks alot for your quick response. I'm using 5.2.1.I tried using <liferay-ui:custom-attribute-list ... /> in edit_event.jsp and it showed the expando fields, awesome! Values are not yet persisted like you said. But where exactly should I put your lines of code? I'm pretty new to Liferay development...Thanks in advance! Very exciting this Expando stuff Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Peter Mesotten Hace 15 años I'd have to say just before the comment:// SocialBut I've already committed the fix to the CalEvent service here http://issues.liferay.com/browse/LPS-2317and requested for backport to 5.2.x. Por favor identifíquese para votar. Contestar como... Cancelar
Ray Augé Peter Mesotten Hace 15 años I'd have to say just before the comment:// SocialBut I've already committed the fix to the CalEvent service here http://issues.liferay.com/browse/LPS-2317and requested for backport to 5.2.x. Por favor identifíquese para votar. Contestar como... Cancelar
Max Gabrielsson Hace 15 años This is exactly what I'm looking for!I get "No ExpandoColumn exists with the primary key 0" when I use ExpandoColumnLocalServiceUtil.addColumn(...) and (Since I am not logged in during the startup hook) "PermissionChecker not initialized" when I use ExpandoColumnServiceUtil.addColumn(...)Is there a way to create Custom Attributes during the startup hook?Here is the code://in startupaction.javaaddAttribute(myUser, "myStringAttribute", 15, "default");//in myUtilClass.javapublic static void addAttribute(User liferayUser, String name, int type, Serializable defaultValue) throws PortalException { //String className = liferayUser.getClass().getName(); String className = com.liferay.portal.model.User.class.getName(); try { ExpandoTable table = null; try { table = ExpandoTableLocalServiceUtil.getDefaultTable( className); } catch (NoSuchTableException nste) { table = ExpandoTableLocalServiceUtil.addDefaultTable( className); } ExpandoColumnLocalServiceUtil.addColumn( table.getTableId(), name, type, defaultValue); } catch (Exception e) { if (e instanceof PortalException) { throw (PortalException)e; } else { } } } Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Max Gabrielsson Hace 15 años To start, which version of the portal are you using? Por favor identifíquese para votar. Contestar como... Cancelar Max Gabrielsson Ray Augé Hace 15 años I use 5.2.1. Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Max Gabrielsson Hace 15 años Great! You can reduce all that code by alot using the convenience API called ExpandoBridge.liferayUser.getExpandoBridge().addAttribute(name, type, defaultValue);If you don't have a user at that time, use:ExpandoBridge eb = new ExpandoBridgeImpl(User.class.getName(), 0);eb.addAttribute(name, type, defaultValue);Later to get/set those values for any user simply:Object attr = someUser.getExpandoBridge().getAttribute(name);someUser.getExpandoBridge().setAttribute(name, someValue); Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Ray Augé Hace 15 años This is the API that "Custom Attributes" are based on. Por favor identifíquese para votar. Contestar como... Cancelar Max Gabrielsson Ray Augé Hace 15 años Many thanks for your answer Ray!But I still got the problem with the PermissionChecker not initialized. After I create the appropriate role and user in the startupaction.java (on application.startup.events) i try the:liferayUser.getExpandoBridge().addAttribute(name, type, defaultValue); Which gives the PrincipalException: PermissionChecker not initialized. Also the:ExpandoBridge eb = new ExpandoBridgeImpl(User.class.getName(), 0);eb.addAttribute(name, type, defaultValue); <------------- gives the same exception.Is it possible to create custom attributes in the startupaction hook? Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Max Gabrielsson Hace 15 años It should be! We're doing that very thing in the project I'm currently tasked on. Por favor identifíquese para votar. Contestar como... Cancelar Alexey Kakunin Ray Augé Hace 14 años Hi! I meet same problem in Liferay 5.2.3 - I'm trying to add new attribute (in my case for BlogsEntry) in portlet StartUpAction (configured via hooks-propeties).I'm doing very similar: ExpandoBridgeImpl blogExpandoBridge = new ExpandoBridgeImpl(BlogsEntry.class.getName()); // shareWith if (blogExpandoBridge.hasAttribute("shareWith")) { _log.debug("attribute shareWith already exists"); } else { _log.info("adding shareWith attribute"); blogExpandoBridge.addAttribute("shareWith"); }But got PermissionChecker is not initialized exception. I think it happens, because during adding new column Liferay tried to identify - is current user allowed to add expando columns, but, since this code exeucted in StartUpAction - no current user and as result - no any PermissionChecker.Any solution for this?BTW - Expando looks like a great solution which should resolve many problems for extending default liferay objects! Por favor identifíquese para votar. Contestar como... Cancelar Alexey Kakunin Alexey Kakunin Hace 14 años Probably, problem in fact, Expando has services, but has no LocalServices - as far as I understand - one of the biggest difference - LocalServices did not do permission checking.So, ExpandoServices always tried to do permission-checks, and in case they are called in (for example) startup action, since we do not have any user in context, permission checker is not initialized.Having Expando LocalServices will allow to perform Expando operations without permission checking (supposing all permissions are already checked on top-level) Por favor identifíquese para votar. Contestar como... Cancelar Alexey Kakunin Alexey Kakunin Hace 14 años uups - sorry! Exando has local services as well, and, as I expected - their usage allow o perform exapndo attributes operations without checking permissions (for example in startup event). Por favor identifíquese para votar. Contestar como... Cancelar Sven Ehlert Alexey Kakunin Hace 14 años Hi Alexey,I'm also trying to add an attribute in a Startup hook (Liferay 5.2.3) like in your example and I also got this PermissionChecker not initialized exception.I'm not really getting your later comments with the Local service. Have you been able to fix your problem using local service? If so, would you mind posting your code here?Thanks a lot! Por favor identifíquese para votar. Contestar como... Cancelar Harry Ostreicker Sven Ehlert Hace 14 años Hi Ray, brilliant blog thread!I have a simple question regarding posting data using the "web form" portlet and reading the entries using the velocity template approach.My Web Form portlet instance works well and I can see all of the data in the Expando tables. But I'm trying to create a very simple way to read these values into a table with pagination using a velocity template.Any ideas how I can accomplish this using the last portion of your code here?Thanks!-HarryO Por favor identifíquese para votar. Contestar como... Cancelar
Ray Augé Max Gabrielsson Hace 15 años To start, which version of the portal are you using? Por favor identifíquese para votar. Contestar como... Cancelar Max Gabrielsson Ray Augé Hace 15 años I use 5.2.1. Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Max Gabrielsson Hace 15 años Great! You can reduce all that code by alot using the convenience API called ExpandoBridge.liferayUser.getExpandoBridge().addAttribute(name, type, defaultValue);If you don't have a user at that time, use:ExpandoBridge eb = new ExpandoBridgeImpl(User.class.getName(), 0);eb.addAttribute(name, type, defaultValue);Later to get/set those values for any user simply:Object attr = someUser.getExpandoBridge().getAttribute(name);someUser.getExpandoBridge().setAttribute(name, someValue); Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Ray Augé Hace 15 años This is the API that "Custom Attributes" are based on. Por favor identifíquese para votar. Contestar como... Cancelar Max Gabrielsson Ray Augé Hace 15 años Many thanks for your answer Ray!But I still got the problem with the PermissionChecker not initialized. After I create the appropriate role and user in the startupaction.java (on application.startup.events) i try the:liferayUser.getExpandoBridge().addAttribute(name, type, defaultValue); Which gives the PrincipalException: PermissionChecker not initialized. Also the:ExpandoBridge eb = new ExpandoBridgeImpl(User.class.getName(), 0);eb.addAttribute(name, type, defaultValue); <------------- gives the same exception.Is it possible to create custom attributes in the startupaction hook? Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Max Gabrielsson Hace 15 años It should be! We're doing that very thing in the project I'm currently tasked on. Por favor identifíquese para votar. Contestar como... Cancelar Alexey Kakunin Ray Augé Hace 14 años Hi! I meet same problem in Liferay 5.2.3 - I'm trying to add new attribute (in my case for BlogsEntry) in portlet StartUpAction (configured via hooks-propeties).I'm doing very similar: ExpandoBridgeImpl blogExpandoBridge = new ExpandoBridgeImpl(BlogsEntry.class.getName()); // shareWith if (blogExpandoBridge.hasAttribute("shareWith")) { _log.debug("attribute shareWith already exists"); } else { _log.info("adding shareWith attribute"); blogExpandoBridge.addAttribute("shareWith"); }But got PermissionChecker is not initialized exception. I think it happens, because during adding new column Liferay tried to identify - is current user allowed to add expando columns, but, since this code exeucted in StartUpAction - no current user and as result - no any PermissionChecker.Any solution for this?BTW - Expando looks like a great solution which should resolve many problems for extending default liferay objects! Por favor identifíquese para votar. Contestar como... Cancelar Alexey Kakunin Alexey Kakunin Hace 14 años Probably, problem in fact, Expando has services, but has no LocalServices - as far as I understand - one of the biggest difference - LocalServices did not do permission checking.So, ExpandoServices always tried to do permission-checks, and in case they are called in (for example) startup action, since we do not have any user in context, permission checker is not initialized.Having Expando LocalServices will allow to perform Expando operations without permission checking (supposing all permissions are already checked on top-level) Por favor identifíquese para votar. Contestar como... Cancelar Alexey Kakunin Alexey Kakunin Hace 14 años uups - sorry! Exando has local services as well, and, as I expected - their usage allow o perform exapndo attributes operations without checking permissions (for example in startup event). Por favor identifíquese para votar. Contestar como... Cancelar Sven Ehlert Alexey Kakunin Hace 14 años Hi Alexey,I'm also trying to add an attribute in a Startup hook (Liferay 5.2.3) like in your example and I also got this PermissionChecker not initialized exception.I'm not really getting your later comments with the Local service. Have you been able to fix your problem using local service? If so, would you mind posting your code here?Thanks a lot! Por favor identifíquese para votar. Contestar como... Cancelar Harry Ostreicker Sven Ehlert Hace 14 años Hi Ray, brilliant blog thread!I have a simple question regarding posting data using the "web form" portlet and reading the entries using the velocity template approach.My Web Form portlet instance works well and I can see all of the data in the Expando tables. But I'm trying to create a very simple way to read these values into a table with pagination using a velocity template.Any ideas how I can accomplish this using the last portion of your code here?Thanks!-HarryO Por favor identifíquese para votar. Contestar como... Cancelar
Max Gabrielsson Ray Augé Hace 15 años I use 5.2.1. Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Max Gabrielsson Hace 15 años Great! You can reduce all that code by alot using the convenience API called ExpandoBridge.liferayUser.getExpandoBridge().addAttribute(name, type, defaultValue);If you don't have a user at that time, use:ExpandoBridge eb = new ExpandoBridgeImpl(User.class.getName(), 0);eb.addAttribute(name, type, defaultValue);Later to get/set those values for any user simply:Object attr = someUser.getExpandoBridge().getAttribute(name);someUser.getExpandoBridge().setAttribute(name, someValue); Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Ray Augé Hace 15 años This is the API that "Custom Attributes" are based on. Por favor identifíquese para votar. Contestar como... Cancelar Max Gabrielsson Ray Augé Hace 15 años Many thanks for your answer Ray!But I still got the problem with the PermissionChecker not initialized. After I create the appropriate role and user in the startupaction.java (on application.startup.events) i try the:liferayUser.getExpandoBridge().addAttribute(name, type, defaultValue); Which gives the PrincipalException: PermissionChecker not initialized. Also the:ExpandoBridge eb = new ExpandoBridgeImpl(User.class.getName(), 0);eb.addAttribute(name, type, defaultValue); <------------- gives the same exception.Is it possible to create custom attributes in the startupaction hook? Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Max Gabrielsson Hace 15 años It should be! We're doing that very thing in the project I'm currently tasked on. Por favor identifíquese para votar. Contestar como... Cancelar Alexey Kakunin Ray Augé Hace 14 años Hi! I meet same problem in Liferay 5.2.3 - I'm trying to add new attribute (in my case for BlogsEntry) in portlet StartUpAction (configured via hooks-propeties).I'm doing very similar: ExpandoBridgeImpl blogExpandoBridge = new ExpandoBridgeImpl(BlogsEntry.class.getName()); // shareWith if (blogExpandoBridge.hasAttribute("shareWith")) { _log.debug("attribute shareWith already exists"); } else { _log.info("adding shareWith attribute"); blogExpandoBridge.addAttribute("shareWith"); }But got PermissionChecker is not initialized exception. I think it happens, because during adding new column Liferay tried to identify - is current user allowed to add expando columns, but, since this code exeucted in StartUpAction - no current user and as result - no any PermissionChecker.Any solution for this?BTW - Expando looks like a great solution which should resolve many problems for extending default liferay objects! Por favor identifíquese para votar. Contestar como... Cancelar Alexey Kakunin Alexey Kakunin Hace 14 años Probably, problem in fact, Expando has services, but has no LocalServices - as far as I understand - one of the biggest difference - LocalServices did not do permission checking.So, ExpandoServices always tried to do permission-checks, and in case they are called in (for example) startup action, since we do not have any user in context, permission checker is not initialized.Having Expando LocalServices will allow to perform Expando operations without permission checking (supposing all permissions are already checked on top-level) Por favor identifíquese para votar. Contestar como... Cancelar Alexey Kakunin Alexey Kakunin Hace 14 años uups - sorry! Exando has local services as well, and, as I expected - their usage allow o perform exapndo attributes operations without checking permissions (for example in startup event). Por favor identifíquese para votar. Contestar como... Cancelar Sven Ehlert Alexey Kakunin Hace 14 años Hi Alexey,I'm also trying to add an attribute in a Startup hook (Liferay 5.2.3) like in your example and I also got this PermissionChecker not initialized exception.I'm not really getting your later comments with the Local service. Have you been able to fix your problem using local service? If so, would you mind posting your code here?Thanks a lot! Por favor identifíquese para votar. Contestar como... Cancelar Harry Ostreicker Sven Ehlert Hace 14 años Hi Ray, brilliant blog thread!I have a simple question regarding posting data using the "web form" portlet and reading the entries using the velocity template approach.My Web Form portlet instance works well and I can see all of the data in the Expando tables. But I'm trying to create a very simple way to read these values into a table with pagination using a velocity template.Any ideas how I can accomplish this using the last portion of your code here?Thanks!-HarryO Por favor identifíquese para votar. Contestar como... Cancelar
Ray Augé Max Gabrielsson Hace 15 años Great! You can reduce all that code by alot using the convenience API called ExpandoBridge.liferayUser.getExpandoBridge().addAttribute(name, type, defaultValue);If you don't have a user at that time, use:ExpandoBridge eb = new ExpandoBridgeImpl(User.class.getName(), 0);eb.addAttribute(name, type, defaultValue);Later to get/set those values for any user simply:Object attr = someUser.getExpandoBridge().getAttribute(name);someUser.getExpandoBridge().setAttribute(name, someValue); Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Ray Augé Hace 15 años This is the API that "Custom Attributes" are based on. Por favor identifíquese para votar. Contestar como... Cancelar Max Gabrielsson Ray Augé Hace 15 años Many thanks for your answer Ray!But I still got the problem with the PermissionChecker not initialized. After I create the appropriate role and user in the startupaction.java (on application.startup.events) i try the:liferayUser.getExpandoBridge().addAttribute(name, type, defaultValue); Which gives the PrincipalException: PermissionChecker not initialized. Also the:ExpandoBridge eb = new ExpandoBridgeImpl(User.class.getName(), 0);eb.addAttribute(name, type, defaultValue); <------------- gives the same exception.Is it possible to create custom attributes in the startupaction hook? Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Max Gabrielsson Hace 15 años It should be! We're doing that very thing in the project I'm currently tasked on. Por favor identifíquese para votar. Contestar como... Cancelar Alexey Kakunin Ray Augé Hace 14 años Hi! I meet same problem in Liferay 5.2.3 - I'm trying to add new attribute (in my case for BlogsEntry) in portlet StartUpAction (configured via hooks-propeties).I'm doing very similar: ExpandoBridgeImpl blogExpandoBridge = new ExpandoBridgeImpl(BlogsEntry.class.getName()); // shareWith if (blogExpandoBridge.hasAttribute("shareWith")) { _log.debug("attribute shareWith already exists"); } else { _log.info("adding shareWith attribute"); blogExpandoBridge.addAttribute("shareWith"); }But got PermissionChecker is not initialized exception. I think it happens, because during adding new column Liferay tried to identify - is current user allowed to add expando columns, but, since this code exeucted in StartUpAction - no current user and as result - no any PermissionChecker.Any solution for this?BTW - Expando looks like a great solution which should resolve many problems for extending default liferay objects! Por favor identifíquese para votar. Contestar como... Cancelar Alexey Kakunin Alexey Kakunin Hace 14 años Probably, problem in fact, Expando has services, but has no LocalServices - as far as I understand - one of the biggest difference - LocalServices did not do permission checking.So, ExpandoServices always tried to do permission-checks, and in case they are called in (for example) startup action, since we do not have any user in context, permission checker is not initialized.Having Expando LocalServices will allow to perform Expando operations without permission checking (supposing all permissions are already checked on top-level) Por favor identifíquese para votar. Contestar como... Cancelar Alexey Kakunin Alexey Kakunin Hace 14 años uups - sorry! Exando has local services as well, and, as I expected - their usage allow o perform exapndo attributes operations without checking permissions (for example in startup event). Por favor identifíquese para votar. Contestar como... Cancelar Sven Ehlert Alexey Kakunin Hace 14 años Hi Alexey,I'm also trying to add an attribute in a Startup hook (Liferay 5.2.3) like in your example and I also got this PermissionChecker not initialized exception.I'm not really getting your later comments with the Local service. Have you been able to fix your problem using local service? If so, would you mind posting your code here?Thanks a lot! Por favor identifíquese para votar. Contestar como... Cancelar Harry Ostreicker Sven Ehlert Hace 14 años Hi Ray, brilliant blog thread!I have a simple question regarding posting data using the "web form" portlet and reading the entries using the velocity template approach.My Web Form portlet instance works well and I can see all of the data in the Expando tables. But I'm trying to create a very simple way to read these values into a table with pagination using a velocity template.Any ideas how I can accomplish this using the last portion of your code here?Thanks!-HarryO Por favor identifíquese para votar. Contestar como... Cancelar
Ray Augé Ray Augé Hace 15 años This is the API that "Custom Attributes" are based on. Por favor identifíquese para votar. Contestar como... Cancelar
Max Gabrielsson Ray Augé Hace 15 años Many thanks for your answer Ray!But I still got the problem with the PermissionChecker not initialized. After I create the appropriate role and user in the startupaction.java (on application.startup.events) i try the:liferayUser.getExpandoBridge().addAttribute(name, type, defaultValue); Which gives the PrincipalException: PermissionChecker not initialized. Also the:ExpandoBridge eb = new ExpandoBridgeImpl(User.class.getName(), 0);eb.addAttribute(name, type, defaultValue); <------------- gives the same exception.Is it possible to create custom attributes in the startupaction hook? Por favor identifíquese para votar. Contestar como... Cancelar Ray Augé Max Gabrielsson Hace 15 años It should be! We're doing that very thing in the project I'm currently tasked on. Por favor identifíquese para votar. Contestar como... Cancelar Alexey Kakunin Ray Augé Hace 14 años Hi! I meet same problem in Liferay 5.2.3 - I'm trying to add new attribute (in my case for BlogsEntry) in portlet StartUpAction (configured via hooks-propeties).I'm doing very similar: ExpandoBridgeImpl blogExpandoBridge = new ExpandoBridgeImpl(BlogsEntry.class.getName()); // shareWith if (blogExpandoBridge.hasAttribute("shareWith")) { _log.debug("attribute shareWith already exists"); } else { _log.info("adding shareWith attribute"); blogExpandoBridge.addAttribute("shareWith"); }But got PermissionChecker is not initialized exception. I think it happens, because during adding new column Liferay tried to identify - is current user allowed to add expando columns, but, since this code exeucted in StartUpAction - no current user and as result - no any PermissionChecker.Any solution for this?BTW - Expando looks like a great solution which should resolve many problems for extending default liferay objects! Por favor identifíquese para votar. Contestar como... Cancelar Alexey Kakunin Alexey Kakunin Hace 14 años Probably, problem in fact, Expando has services, but has no LocalServices - as far as I understand - one of the biggest difference - LocalServices did not do permission checking.So, ExpandoServices always tried to do permission-checks, and in case they are called in (for example) startup action, since we do not have any user in context, permission checker is not initialized.Having Expando LocalServices will allow to perform Expando operations without permission checking (supposing all permissions are already checked on top-level) Por favor identifíquese para votar. Contestar como... Cancelar Alexey Kakunin Alexey Kakunin Hace 14 años uups - sorry! Exando has local services as well, and, as I expected - their usage allow o perform exapndo attributes operations without checking permissions (for example in startup event). Por favor identifíquese para votar. Contestar como... Cancelar Sven Ehlert Alexey Kakunin Hace 14 años Hi Alexey,I'm also trying to add an attribute in a Startup hook (Liferay 5.2.3) like in your example and I also got this PermissionChecker not initialized exception.I'm not really getting your later comments with the Local service. Have you been able to fix your problem using local service? If so, would you mind posting your code here?Thanks a lot! Por favor identifíquese para votar. Contestar como... Cancelar Harry Ostreicker Sven Ehlert Hace 14 años Hi Ray, brilliant blog thread!I have a simple question regarding posting data using the "web form" portlet and reading the entries using the velocity template approach.My Web Form portlet instance works well and I can see all of the data in the Expando tables. But I'm trying to create a very simple way to read these values into a table with pagination using a velocity template.Any ideas how I can accomplish this using the last portion of your code here?Thanks!-HarryO Por favor identifíquese para votar. Contestar como... Cancelar
Ray Augé Max Gabrielsson Hace 15 años It should be! We're doing that very thing in the project I'm currently tasked on. Por favor identifíquese para votar. Contestar como... Cancelar Alexey Kakunin Ray Augé Hace 14 años Hi! I meet same problem in Liferay 5.2.3 - I'm trying to add new attribute (in my case for BlogsEntry) in portlet StartUpAction (configured via hooks-propeties).I'm doing very similar: ExpandoBridgeImpl blogExpandoBridge = new ExpandoBridgeImpl(BlogsEntry.class.getName()); // shareWith if (blogExpandoBridge.hasAttribute("shareWith")) { _log.debug("attribute shareWith already exists"); } else { _log.info("adding shareWith attribute"); blogExpandoBridge.addAttribute("shareWith"); }But got PermissionChecker is not initialized exception. I think it happens, because during adding new column Liferay tried to identify - is current user allowed to add expando columns, but, since this code exeucted in StartUpAction - no current user and as result - no any PermissionChecker.Any solution for this?BTW - Expando looks like a great solution which should resolve many problems for extending default liferay objects! Por favor identifíquese para votar. Contestar como... Cancelar Alexey Kakunin Alexey Kakunin Hace 14 años Probably, problem in fact, Expando has services, but has no LocalServices - as far as I understand - one of the biggest difference - LocalServices did not do permission checking.So, ExpandoServices always tried to do permission-checks, and in case they are called in (for example) startup action, since we do not have any user in context, permission checker is not initialized.Having Expando LocalServices will allow to perform Expando operations without permission checking (supposing all permissions are already checked on top-level) Por favor identifíquese para votar. Contestar como... Cancelar Alexey Kakunin Alexey Kakunin Hace 14 años uups - sorry! Exando has local services as well, and, as I expected - their usage allow o perform exapndo attributes operations without checking permissions (for example in startup event). Por favor identifíquese para votar. Contestar como... Cancelar Sven Ehlert Alexey Kakunin Hace 14 años Hi Alexey,I'm also trying to add an attribute in a Startup hook (Liferay 5.2.3) like in your example and I also got this PermissionChecker not initialized exception.I'm not really getting your later comments with the Local service. Have you been able to fix your problem using local service? If so, would you mind posting your code here?Thanks a lot! Por favor identifíquese para votar. Contestar como... Cancelar Harry Ostreicker Sven Ehlert Hace 14 años Hi Ray, brilliant blog thread!I have a simple question regarding posting data using the "web form" portlet and reading the entries using the velocity template approach.My Web Form portlet instance works well and I can see all of the data in the Expando tables. But I'm trying to create a very simple way to read these values into a table with pagination using a velocity template.Any ideas how I can accomplish this using the last portion of your code here?Thanks!-HarryO Por favor identifíquese para votar. Contestar como... Cancelar
Alexey Kakunin Ray Augé Hace 14 años Hi! I meet same problem in Liferay 5.2.3 - I'm trying to add new attribute (in my case for BlogsEntry) in portlet StartUpAction (configured via hooks-propeties).I'm doing very similar: ExpandoBridgeImpl blogExpandoBridge = new ExpandoBridgeImpl(BlogsEntry.class.getName()); // shareWith if (blogExpandoBridge.hasAttribute("shareWith")) { _log.debug("attribute shareWith already exists"); } else { _log.info("adding shareWith attribute"); blogExpandoBridge.addAttribute("shareWith"); }But got PermissionChecker is not initialized exception. I think it happens, because during adding new column Liferay tried to identify - is current user allowed to add expando columns, but, since this code exeucted in StartUpAction - no current user and as result - no any PermissionChecker.Any solution for this?BTW - Expando looks like a great solution which should resolve many problems for extending default liferay objects! Por favor identifíquese para votar. Contestar como... Cancelar Alexey Kakunin Alexey Kakunin Hace 14 años Probably, problem in fact, Expando has services, but has no LocalServices - as far as I understand - one of the biggest difference - LocalServices did not do permission checking.So, ExpandoServices always tried to do permission-checks, and in case they are called in (for example) startup action, since we do not have any user in context, permission checker is not initialized.Having Expando LocalServices will allow to perform Expando operations without permission checking (supposing all permissions are already checked on top-level) Por favor identifíquese para votar. Contestar como... Cancelar Alexey Kakunin Alexey Kakunin Hace 14 años uups - sorry! Exando has local services as well, and, as I expected - their usage allow o perform exapndo attributes operations without checking permissions (for example in startup event). Por favor identifíquese para votar. Contestar como... Cancelar Sven Ehlert Alexey Kakunin Hace 14 años Hi Alexey,I'm also trying to add an attribute in a Startup hook (Liferay 5.2.3) like in your example and I also got this PermissionChecker not initialized exception.I'm not really getting your later comments with the Local service. Have you been able to fix your problem using local service? If so, would you mind posting your code here?Thanks a lot! Por favor identifíquese para votar. Contestar como... Cancelar Harry Ostreicker Sven Ehlert Hace 14 años Hi Ray, brilliant blog thread!I have a simple question regarding posting data using the "web form" portlet and reading the entries using the velocity template approach.My Web Form portlet instance works well and I can see all of the data in the Expando tables. But I'm trying to create a very simple way to read these values into a table with pagination using a velocity template.Any ideas how I can accomplish this using the last portion of your code here?Thanks!-HarryO Por favor identifíquese para votar. Contestar como... Cancelar
Alexey Kakunin Alexey Kakunin Hace 14 años Probably, problem in fact, Expando has services, but has no LocalServices - as far as I understand - one of the biggest difference - LocalServices did not do permission checking.So, ExpandoServices always tried to do permission-checks, and in case they are called in (for example) startup action, since we do not have any user in context, permission checker is not initialized.Having Expando LocalServices will allow to perform Expando operations without permission checking (supposing all permissions are already checked on top-level) Por favor identifíquese para votar. Contestar como... Cancelar Alexey Kakunin Alexey Kakunin Hace 14 años uups - sorry! Exando has local services as well, and, as I expected - their usage allow o perform exapndo attributes operations without checking permissions (for example in startup event). Por favor identifíquese para votar. Contestar como... Cancelar Sven Ehlert Alexey Kakunin Hace 14 años Hi Alexey,I'm also trying to add an attribute in a Startup hook (Liferay 5.2.3) like in your example and I also got this PermissionChecker not initialized exception.I'm not really getting your later comments with the Local service. Have you been able to fix your problem using local service? If so, would you mind posting your code here?Thanks a lot! Por favor identifíquese para votar. Contestar como... Cancelar Harry Ostreicker Sven Ehlert Hace 14 años Hi Ray, brilliant blog thread!I have a simple question regarding posting data using the "web form" portlet and reading the entries using the velocity template approach.My Web Form portlet instance works well and I can see all of the data in the Expando tables. But I'm trying to create a very simple way to read these values into a table with pagination using a velocity template.Any ideas how I can accomplish this using the last portion of your code here?Thanks!-HarryO Por favor identifíquese para votar. Contestar como... Cancelar
Alexey Kakunin Alexey Kakunin Hace 14 años uups - sorry! Exando has local services as well, and, as I expected - their usage allow o perform exapndo attributes operations without checking permissions (for example in startup event). Por favor identifíquese para votar. Contestar como... Cancelar Sven Ehlert Alexey Kakunin Hace 14 años Hi Alexey,I'm also trying to add an attribute in a Startup hook (Liferay 5.2.3) like in your example and I also got this PermissionChecker not initialized exception.I'm not really getting your later comments with the Local service. Have you been able to fix your problem using local service? If so, would you mind posting your code here?Thanks a lot! Por favor identifíquese para votar. Contestar como... Cancelar Harry Ostreicker Sven Ehlert Hace 14 años Hi Ray, brilliant blog thread!I have a simple question regarding posting data using the "web form" portlet and reading the entries using the velocity template approach.My Web Form portlet instance works well and I can see all of the data in the Expando tables. But I'm trying to create a very simple way to read these values into a table with pagination using a velocity template.Any ideas how I can accomplish this using the last portion of your code here?Thanks!-HarryO Por favor identifíquese para votar. Contestar como... Cancelar
Sven Ehlert Alexey Kakunin Hace 14 años Hi Alexey,I'm also trying to add an attribute in a Startup hook (Liferay 5.2.3) like in your example and I also got this PermissionChecker not initialized exception.I'm not really getting your later comments with the Local service. Have you been able to fix your problem using local service? If so, would you mind posting your code here?Thanks a lot! Por favor identifíquese para votar. Contestar como... Cancelar Harry Ostreicker Sven Ehlert Hace 14 años Hi Ray, brilliant blog thread!I have a simple question regarding posting data using the "web form" portlet and reading the entries using the velocity template approach.My Web Form portlet instance works well and I can see all of the data in the Expando tables. But I'm trying to create a very simple way to read these values into a table with pagination using a velocity template.Any ideas how I can accomplish this using the last portion of your code here?Thanks!-HarryO Por favor identifíquese para votar. Contestar como... Cancelar
Harry Ostreicker Sven Ehlert Hace 14 años Hi Ray, brilliant blog thread!I have a simple question regarding posting data using the "web form" portlet and reading the entries using the velocity template approach.My Web Form portlet instance works well and I can see all of the data in the Expando tables. But I'm trying to create a very simple way to read these values into a table with pagination using a velocity template.Any ideas how I can accomplish this using the last portion of your code here?Thanks!-HarryO Por favor identifíquese para votar. Contestar como... Cancelar