Jerry Niu 16 年之前 This is awesome Ray. Thanks for the explanation and sample code! 请登录以投票。 以……回复 取消 Ray Augé Jerry Niu 16 年之前 Thanks Jerry! 请登录以投票。 以……回复 取消
Tobias S. Käfer 16 年之前 Nice feature!In (since) which version is that available?GreatsTobias 请登录以投票。 以……回复 取消 Ray Augé Tobias S. Käfer 16 年之前 It's currently in trunk, and should be in 5.0.2. 请登录以投票。 以……回复 取消 Alvaro Del Castillo Ray Augé 15 年之前 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, 请登录以投票。 以……回复 取消 Ray Augé Alvaro Del Castillo 15 年之前 It's updated now.Thanks Alvaro! 请登录以投票。 以……回复 取消
Ray Augé Tobias S. Käfer 16 年之前 It's currently in trunk, and should be in 5.0.2. 请登录以投票。 以……回复 取消 Alvaro Del Castillo Ray Augé 15 年之前 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, 请登录以投票。 以……回复 取消 Ray Augé Alvaro Del Castillo 15 年之前 It's updated now.Thanks Alvaro! 请登录以投票。 以……回复 取消
Alvaro Del Castillo Ray Augé 15 年之前 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, 请登录以投票。 以……回复 取消 Ray Augé Alvaro Del Castillo 15 年之前 It's updated now.Thanks Alvaro! 请登录以投票。 以……回复 取消
Gabor Nagy 15 年之前 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 请登录以投票。 以……回复 取消 Ray Augé Gabor Nagy 15 年之前 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! 请登录以投票。 以……回复 取消 Gabor Nagy Ray Augé 15 年之前 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. 请登录以投票。 以……回复 取消
Ray Augé Gabor Nagy 15 年之前 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! 请登录以投票。 以……回复 取消 Gabor Nagy Ray Augé 15 年之前 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. 请登录以投票。 以……回复 取消
Gabor Nagy Ray Augé 15 年之前 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. 请登录以投票。 以……回复 取消
b v j 15 年之前 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? 请登录以投票。 以……回复 取消 Ray Augé b v j 15 年之前 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") 请登录以投票。 以……回复 取消 b v j Ray Augé 15 年之前 Perfect - thank you. 请登录以投票。 以……回复 取消
Ray Augé b v j 15 年之前 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") 请登录以投票。 以……回复 取消 b v j Ray Augé 15 年之前 Perfect - thank you. 请登录以投票。 以……回复 取消
Josh Asbury 15 年之前 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! 请登录以投票。 以……回复 取消 nidhi singh Josh Asbury 15 年之前 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 请登录以投票。 以……回复 取消
nidhi singh Josh Asbury 15 年之前 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 请登录以投票。 以……回复 取消
Thomas Kellerer 15 年之前 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? 请登录以投票。 以……回复 取消 Ray Augé Thomas Kellerer 15 年之前 Try:#set ($accountsTable = $expandoTableLocalService.getTable("com.liferay.portlet.webform.util.WebFormUtil", $accountsTableName)) 请登录以投票。 以……回复 取消 Thomas Kellerer Ray Augé 15 年之前 Great that worked, thanks a lot 请登录以投票。 以……回复 取消 Jonas Yuan Ray Augé 15 年之前 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 请登录以投票。 以……回复 取消 Ray Augé Jonas Yuan 15 年之前 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. 请登录以投票。 以……回复 取消 Jonas Yuan Ray Augé 15 年之前 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? 请登录以投票。 以……回复 取消 Ray Augé Jonas Yuan 15 年之前 - 编辑过的 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. 请登录以投票。 以……回复 取消 Thomas Kellerer Ray Augé 15 年之前 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? 请登录以投票。 以……回复 取消 Thomas Kellerer Thomas Kellerer 15 年之前 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 请登录以投票。 以……回复 取消
Ray Augé Thomas Kellerer 15 年之前 Try:#set ($accountsTable = $expandoTableLocalService.getTable("com.liferay.portlet.webform.util.WebFormUtil", $accountsTableName)) 请登录以投票。 以……回复 取消 Thomas Kellerer Ray Augé 15 年之前 Great that worked, thanks a lot 请登录以投票。 以……回复 取消 Jonas Yuan Ray Augé 15 年之前 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 请登录以投票。 以……回复 取消 Ray Augé Jonas Yuan 15 年之前 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. 请登录以投票。 以……回复 取消 Jonas Yuan Ray Augé 15 年之前 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? 请登录以投票。 以……回复 取消 Ray Augé Jonas Yuan 15 年之前 - 编辑过的 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. 请登录以投票。 以……回复 取消 Thomas Kellerer Ray Augé 15 年之前 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? 请登录以投票。 以……回复 取消 Thomas Kellerer Thomas Kellerer 15 年之前 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 请登录以投票。 以……回复 取消
Jonas Yuan Ray Augé 15 年之前 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 请登录以投票。 以……回复 取消 Ray Augé Jonas Yuan 15 年之前 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. 请登录以投票。 以……回复 取消 Jonas Yuan Ray Augé 15 年之前 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? 请登录以投票。 以……回复 取消 Ray Augé Jonas Yuan 15 年之前 - 编辑过的 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. 请登录以投票。 以……回复 取消
Ray Augé Jonas Yuan 15 年之前 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. 请登录以投票。 以……回复 取消 Jonas Yuan Ray Augé 15 年之前 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? 请登录以投票。 以……回复 取消 Ray Augé Jonas Yuan 15 年之前 - 编辑过的 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. 请登录以投票。 以……回复 取消
Jonas Yuan Ray Augé 15 年之前 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? 请登录以投票。 以……回复 取消 Ray Augé Jonas Yuan 15 年之前 - 编辑过的 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. 请登录以投票。 以……回复 取消
Ray Augé Jonas Yuan 15 年之前 - 编辑过的 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. 请登录以投票。 以……回复 取消
Thomas Kellerer Ray Augé 15 年之前 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? 请登录以投票。 以……回复 取消 Thomas Kellerer Thomas Kellerer 15 年之前 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 请登录以投票。 以……回复 取消
Thomas Kellerer Thomas Kellerer 15 年之前 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 请登录以投票。 以……回复 取消
nidhi singh 15 年之前 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 请登录以投票。 以……回复 取消 Ray Augé nidhi singh 15 年之前 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. 请登录以投票。 以……回复 取消
Ray Augé nidhi singh 15 年之前 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. 请登录以投票。 以……回复 取消
auditya manikanta vadrevu 15 年之前 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? 请登录以投票。 以……回复 取消 Ray Augé auditya manikanta vadrevu 15 年之前 The API has changed slightly. (I have not updated the Post, sorry!)Try:$expandoValueServiceUtil.addValue( $className, $tableName, $columnName, $classPK, $columnValue) 请登录以投票。 以……回复 取消
Ray Augé auditya manikanta vadrevu 15 年之前 The API has changed slightly. (I have not updated the Post, sorry!)Try:$expandoValueServiceUtil.addValue( $className, $tableName, $columnName, $classPK, $columnValue) 请登录以投票。 以……回复 取消
Thomas Kellerer 15 年之前 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? 请登录以投票。 以……回复 取消 Ray Augé Thomas Kellerer 15 年之前 I'll have to test this. Can you file a bug and provide a minimal test case? Thanks! 请登录以投票。 以……回复 取消 Thomas Kellerer Ray Augé 15 年之前 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? 请登录以投票。 以……回复 取消 Chris Whittle Ray Augé 15 年之前 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) 请登录以投票。 以……回复 取消 Chris Whittle Chris Whittle 15 年之前 nevermind I missed the structure.... Heres the rub now... It renders but when I hit the create button it thinks and the does nothing... 请登录以投票。 以……回复 取消 Chris Whittle Chris Whittle 15 年之前 nevermind I missed the structure.... Heres the rub now... It renders but when I hit the create button it thinks and the does nothing... 请登录以投票。 以……回复 取消 Ray Augé Chris Whittle 15 年之前 Not exactly sure what you mean. Can you clarify? 请登录以投票。 以……回复 取消
Ray Augé Thomas Kellerer 15 年之前 I'll have to test this. Can you file a bug and provide a minimal test case? Thanks! 请登录以投票。 以……回复 取消 Thomas Kellerer Ray Augé 15 年之前 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? 请登录以投票。 以……回复 取消 Chris Whittle Ray Augé 15 年之前 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) 请登录以投票。 以……回复 取消 Chris Whittle Chris Whittle 15 年之前 nevermind I missed the structure.... Heres the rub now... It renders but when I hit the create button it thinks and the does nothing... 请登录以投票。 以……回复 取消 Chris Whittle Chris Whittle 15 年之前 nevermind I missed the structure.... Heres the rub now... It renders but when I hit the create button it thinks and the does nothing... 请登录以投票。 以……回复 取消 Ray Augé Chris Whittle 15 年之前 Not exactly sure what you mean. Can you clarify? 请登录以投票。 以……回复 取消
Thomas Kellerer Ray Augé 15 年之前 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? 请登录以投票。 以……回复 取消
Chris Whittle Ray Augé 15 年之前 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) 请登录以投票。 以……回复 取消 Chris Whittle Chris Whittle 15 年之前 nevermind I missed the structure.... Heres the rub now... It renders but when I hit the create button it thinks and the does nothing... 请登录以投票。 以……回复 取消 Chris Whittle Chris Whittle 15 年之前 nevermind I missed the structure.... Heres the rub now... It renders but when I hit the create button it thinks and the does nothing... 请登录以投票。 以……回复 取消 Ray Augé Chris Whittle 15 年之前 Not exactly sure what you mean. Can you clarify? 请登录以投票。 以……回复 取消
Chris Whittle Chris Whittle 15 年之前 nevermind I missed the structure.... Heres the rub now... It renders but when I hit the create button it thinks and the does nothing... 请登录以投票。 以……回复 取消
Chris Whittle Chris Whittle 15 年之前 nevermind I missed the structure.... Heres the rub now... It renders but when I hit the create button it thinks and the does nothing... 请登录以投票。 以……回复 取消 Ray Augé Chris Whittle 15 年之前 Not exactly sure what you mean. Can you clarify? 请登录以投票。 以……回复 取消
delang j 15 年之前 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. 请登录以投票。 以……回复 取消 Ray Augé delang j 15 年之前 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). 请登录以投票。 以……回复 取消 delang j Ray Augé 15 年之前 problem solved. i just playing with the codes.LOL.what about pagination, im big confused how to implement it 请登录以投票。 以……回复 取消
Ray Augé delang j 15 年之前 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). 请登录以投票。 以……回复 取消 delang j Ray Augé 15 年之前 problem solved. i just playing with the codes.LOL.what about pagination, im big confused how to implement it 请登录以投票。 以……回复 取消
delang j Ray Augé 15 年之前 problem solved. i just playing with the codes.LOL.what about pagination, im big confused how to implement it 请登录以投票。 以……回复 取消
Peter Mesotten 15 年之前 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? 请登录以投票。 以……回复 取消 Ray Augé Peter Mesotten 15 年之前 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); 请登录以投票。 以……回复 取消 Ray Augé Ray Augé 15 年之前 I'll have to audit all the services which have support for this, but aren't persisting the custom attributes. 请登录以投票。 以……回复 取消
Ray Augé Peter Mesotten 15 年之前 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); 请登录以投票。 以……回复 取消 Ray Augé Ray Augé 15 年之前 I'll have to audit all the services which have support for this, but aren't persisting the custom attributes. 请登录以投票。 以……回复 取消
Ray Augé Ray Augé 15 年之前 I'll have to audit all the services which have support for this, but aren't persisting the custom attributes. 请登录以投票。 以……回复 取消
Peter Mesotten 15 年之前 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 请登录以投票。 以……回复 取消 Ray Augé Peter Mesotten 15 年之前 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. 请登录以投票。 以……回复 取消
Ray Augé Peter Mesotten 15 年之前 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. 请登录以投票。 以……回复 取消
Max Gabrielsson 15 年之前 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 { } } } 请登录以投票。 以……回复 取消 Ray Augé Max Gabrielsson 15 年之前 To start, which version of the portal are you using? 请登录以投票。 以……回复 取消 Max Gabrielsson Ray Augé 15 年之前 I use 5.2.1. 请登录以投票。 以……回复 取消 Ray Augé Max Gabrielsson 15 年之前 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); 请登录以投票。 以……回复 取消 Ray Augé Ray Augé 15 年之前 This is the API that "Custom Attributes" are based on. 请登录以投票。 以……回复 取消 Max Gabrielsson Ray Augé 15 年之前 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? 请登录以投票。 以……回复 取消 Ray Augé Max Gabrielsson 15 年之前 It should be! We're doing that very thing in the project I'm currently tasked on. 请登录以投票。 以……回复 取消 Alexey Kakunin Ray Augé 14 年之前 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! 请登录以投票。 以……回复 取消 Alexey Kakunin Alexey Kakunin 14 年之前 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) 请登录以投票。 以……回复 取消 Alexey Kakunin Alexey Kakunin 14 年之前 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). 请登录以投票。 以……回复 取消 Sven Ehlert Alexey Kakunin 14 年之前 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! 请登录以投票。 以……回复 取消 Harry Ostreicker Sven Ehlert 14 年之前 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 请登录以投票。 以……回复 取消
Ray Augé Max Gabrielsson 15 年之前 To start, which version of the portal are you using? 请登录以投票。 以……回复 取消 Max Gabrielsson Ray Augé 15 年之前 I use 5.2.1. 请登录以投票。 以……回复 取消 Ray Augé Max Gabrielsson 15 年之前 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); 请登录以投票。 以……回复 取消 Ray Augé Ray Augé 15 年之前 This is the API that "Custom Attributes" are based on. 请登录以投票。 以……回复 取消 Max Gabrielsson Ray Augé 15 年之前 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? 请登录以投票。 以……回复 取消 Ray Augé Max Gabrielsson 15 年之前 It should be! We're doing that very thing in the project I'm currently tasked on. 请登录以投票。 以……回复 取消 Alexey Kakunin Ray Augé 14 年之前 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! 请登录以投票。 以……回复 取消 Alexey Kakunin Alexey Kakunin 14 年之前 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) 请登录以投票。 以……回复 取消 Alexey Kakunin Alexey Kakunin 14 年之前 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). 请登录以投票。 以……回复 取消 Sven Ehlert Alexey Kakunin 14 年之前 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! 请登录以投票。 以……回复 取消 Harry Ostreicker Sven Ehlert 14 年之前 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 请登录以投票。 以……回复 取消
Max Gabrielsson Ray Augé 15 年之前 I use 5.2.1. 请登录以投票。 以……回复 取消 Ray Augé Max Gabrielsson 15 年之前 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); 请登录以投票。 以……回复 取消 Ray Augé Ray Augé 15 年之前 This is the API that "Custom Attributes" are based on. 请登录以投票。 以……回复 取消 Max Gabrielsson Ray Augé 15 年之前 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? 请登录以投票。 以……回复 取消 Ray Augé Max Gabrielsson 15 年之前 It should be! We're doing that very thing in the project I'm currently tasked on. 请登录以投票。 以……回复 取消 Alexey Kakunin Ray Augé 14 年之前 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! 请登录以投票。 以……回复 取消 Alexey Kakunin Alexey Kakunin 14 年之前 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) 请登录以投票。 以……回复 取消 Alexey Kakunin Alexey Kakunin 14 年之前 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). 请登录以投票。 以……回复 取消 Sven Ehlert Alexey Kakunin 14 年之前 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! 请登录以投票。 以……回复 取消 Harry Ostreicker Sven Ehlert 14 年之前 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 请登录以投票。 以……回复 取消
Ray Augé Max Gabrielsson 15 年之前 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); 请登录以投票。 以……回复 取消 Ray Augé Ray Augé 15 年之前 This is the API that "Custom Attributes" are based on. 请登录以投票。 以……回复 取消 Max Gabrielsson Ray Augé 15 年之前 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? 请登录以投票。 以……回复 取消 Ray Augé Max Gabrielsson 15 年之前 It should be! We're doing that very thing in the project I'm currently tasked on. 请登录以投票。 以……回复 取消 Alexey Kakunin Ray Augé 14 年之前 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! 请登录以投票。 以……回复 取消 Alexey Kakunin Alexey Kakunin 14 年之前 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) 请登录以投票。 以……回复 取消 Alexey Kakunin Alexey Kakunin 14 年之前 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). 请登录以投票。 以……回复 取消 Sven Ehlert Alexey Kakunin 14 年之前 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! 请登录以投票。 以……回复 取消 Harry Ostreicker Sven Ehlert 14 年之前 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 请登录以投票。 以……回复 取消
Max Gabrielsson Ray Augé 15 年之前 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? 请登录以投票。 以……回复 取消 Ray Augé Max Gabrielsson 15 年之前 It should be! We're doing that very thing in the project I'm currently tasked on. 请登录以投票。 以……回复 取消 Alexey Kakunin Ray Augé 14 年之前 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! 请登录以投票。 以……回复 取消 Alexey Kakunin Alexey Kakunin 14 年之前 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) 请登录以投票。 以……回复 取消 Alexey Kakunin Alexey Kakunin 14 年之前 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). 请登录以投票。 以……回复 取消 Sven Ehlert Alexey Kakunin 14 年之前 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! 请登录以投票。 以……回复 取消 Harry Ostreicker Sven Ehlert 14 年之前 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 请登录以投票。 以……回复 取消
Ray Augé Max Gabrielsson 15 年之前 It should be! We're doing that very thing in the project I'm currently tasked on. 请登录以投票。 以……回复 取消 Alexey Kakunin Ray Augé 14 年之前 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! 请登录以投票。 以……回复 取消 Alexey Kakunin Alexey Kakunin 14 年之前 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) 请登录以投票。 以……回复 取消 Alexey Kakunin Alexey Kakunin 14 年之前 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). 请登录以投票。 以……回复 取消 Sven Ehlert Alexey Kakunin 14 年之前 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! 请登录以投票。 以……回复 取消 Harry Ostreicker Sven Ehlert 14 年之前 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 请登录以投票。 以……回复 取消
Alexey Kakunin Ray Augé 14 年之前 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! 请登录以投票。 以……回复 取消 Alexey Kakunin Alexey Kakunin 14 年之前 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) 请登录以投票。 以……回复 取消 Alexey Kakunin Alexey Kakunin 14 年之前 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). 请登录以投票。 以……回复 取消 Sven Ehlert Alexey Kakunin 14 年之前 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! 请登录以投票。 以……回复 取消 Harry Ostreicker Sven Ehlert 14 年之前 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 请登录以投票。 以……回复 取消
Alexey Kakunin Alexey Kakunin 14 年之前 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) 请登录以投票。 以……回复 取消 Alexey Kakunin Alexey Kakunin 14 年之前 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). 请登录以投票。 以……回复 取消 Sven Ehlert Alexey Kakunin 14 年之前 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! 请登录以投票。 以……回复 取消 Harry Ostreicker Sven Ehlert 14 年之前 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 请登录以投票。 以……回复 取消
Alexey Kakunin Alexey Kakunin 14 年之前 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). 请登录以投票。 以……回复 取消 Sven Ehlert Alexey Kakunin 14 年之前 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! 请登录以投票。 以……回复 取消 Harry Ostreicker Sven Ehlert 14 年之前 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 请登录以投票。 以……回复 取消
Sven Ehlert Alexey Kakunin 14 年之前 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! 请登录以投票。 以……回复 取消 Harry Ostreicker Sven Ehlert 14 年之前 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 请登录以投票。 以……回复 取消
Harry Ostreicker Sven Ehlert 14 年之前 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 请登录以投票。 以……回复 取消