Fórumok
Get data from existing Liferay tables using Expando.
Anand Abhyankar, módosítva 14 év-val korábban
Get data from existing Liferay tables using Expando.
Junior Member Bejegyzések: 57 Csatlakozás dátuma: 2008.03.26. Legújabb bejegyzések
Hello All,
How can get data from existing Liferay tables using expando.
I have read Ray's blog about expando, but it gives info about creating new expando tables.
I want to access Liferay's default tables, with out creating my own table using expando.
Please guide me.
Thanks in advance.
How can get data from existing Liferay tables using expando.
I have read Ray's blog about expando, but it gives info about creating new expando tables.
I want to access Liferay's default tables, with out creating my own table using expando.
Please guide me.
Thanks in advance.
Tomas Polesovsky, módosítva 14 év-val korábban
RE: Get data from existing Liferay tables using Expando.
Liferay Master Bejegyzések: 676 Csatlakozás dátuma: 2009.02.13. Legújabb bejegyzések
Hi,
using
you get all expando table definitions.
Using
you get all columns defined for Organization entity in the default table.
Using
you get all rows for Organization in the default table.
Using
you get all values for Organization with ID 'classPK' in the default table.
using
List<expandotable> expandoTables = ExpandoTableLocalServiceUtil
.getExpandoTables(getStart(), getEnd());
</expandotable>
you get all expando table definitions.
Using
String modelResource = "com.liferay.portal.model.Organization";
List<expandocolumn> columns = ExpandoColumnLocalServiceUtil
.getDefaultTableColumns(modelResource);
</expandocolumn>
you get all columns defined for Organization entity in the default table.
Using
String modelResource = "com.liferay.portal.model.Organization";
String expandoTableName = ExpandoTableConstants.DEFAULT_TABLE_NAME;
List<expandorow> expandoRows = ExpandoRowLocalServiceUtil
.getRows(modelResource, expandoTableName, getStart(), getEnd());
</expandorow>
you get all rows for Organization in the default table.
Using
String modelResource = "com.liferay.portal.model.Organization";
String expandoTableName = ExpandoTableConstants.DEFAULT_TABLE_NAME;
long classPK = 0; // ID OF ORGANIZATION
List<expandovalue> values = ExpandoValueLocalServiceUtil
.getRowValues(modelResource, expandoTableName, classPK,
QueryUtil.ALL_POS, QueryUtil.ALL_POS);
</expandovalue>
you get all values for Organization with ID 'classPK' in the default table.
Anand Abhyankar, módosítva 14 év-val korábban
RE: Get data from existing Liferay tables using Expando.
Junior Member Bejegyzések: 57 Csatlakozás dátuma: 2008.03.26. Legújabb bejegyzések
Thanks Tomas Polesovsky for quick your reply.
How can we write a 'template' for this, so that we can have table details in a web-content' ?
Thanks in advance
How can we write a 'template' for this, so that we can have table details in a web-content' ?
Thanks in advance
Tomas Polesovsky, módosítva 14 év-val korábban
RE: Get data from existing Liferay tables using Expando.
Liferay Master Bejegyzések: 676 Csatlakozás dátuma: 2009.02.13. Legújabb bejegyzések
I don't know which details you want. Maybe you can use the custom-attribute-list tag:
I am sorry but I don't understand your "detail template". I don't see your problem here, maybe you could explain it?
<liferay-ui:custom-attribute-list className="com.liferay.portal.model.Organization" classPK="0" editable="<%= true %>" label="<%= true %>" />
I am sorry but I don't understand your "detail template". I don't see your problem here, maybe you could explain it?
Anand Abhyankar, módosítva 14 év-val korábban
RE: Get data from existing Liferay tables using Expando.
Junior Member Bejegyzések: 57 Csatlakozás dátuma: 2008.03.26. Legújabb bejegyzések
Thanks Tomas Polesovsky for you reply!
Just to clarify, as a regular web-content (aka Journal Content) need the template and structure, how can I get data from existing tables using template (vm) ?
For example, if I want to list of users from the user_ table of liferay in web-content, how can I achieve this?
Thanks in advance.
Just to clarify, as a regular web-content (aka Journal Content) need the template and structure, how can I get data from existing tables using template (vm) ?
For example, if I want to list of users from the user_ table of liferay in web-content, how can I achieve this?
Thanks in advance.
Harish Kumar, módosítva 11 év-val korábban
RE: Get data from existing Liferay tables using Expando.
Expert Bejegyzések: 483 Csatlakozás dátuma: 2010.07.31. Legújabb bejegyzések
Hi Anand,
Just create bare bone structure and associate a template with it. Now you put your code inside the template. Here is the sample code -
Create a web content by making use of above structure.
HTH
I want to list of users from the user_ table of liferay in web-content, how can I achieve this?
Just create bare bone structure and associate a template with it. Now you put your code inside the template. Here is the sample code -
#set($userLocalService=$serviceLocator.findService("com.liferay.portal.service.UserLocalService"))
#set($userList=$userLocalService.getUsers(-1,-1))
Make sure to override this property in portal-ext.properties
#
# Input a comma delimited list of variables which are restricted from the
# context in Velocity based Journal templates.
#
journal.template.velocity.restricted.variables=
Create a web content by making use of above structure.
HTH
Ishan Sahore, módosítva 11 év-val korábban
RE: Get data from existing Liferay tables using Expando.
Junior Member Bejegyzések: 56 Csatlakozás dátuma: 2012.04.26. Legújabb bejegyzésekTomáš Polešovský:
Hi,
usingList<expandotable> expandoTables = ExpandoTableLocalServiceUtil .getExpandoTables(getStart(), getEnd()); </expandotable>
you get all expando table definitions.
Hi Tomas,
My Eclipse IDE does not recognise getStart() and getEnd() methods.
Can you elaborate what all imports I need to do.
Thanks,
Ishan.
Harish Kumar, módosítva 11 év-val korábban
RE: Get data from existing Liferay tables using Expando.
Expert Bejegyzések: 483 Csatlakozás dátuma: 2010.07.31. Legújabb bejegyzések
Hi Ishan
getStart() and getEnd() denotes the start and last index here. You can pass -1 for both to get the full list.
HTH
getStart() and getEnd() denotes the start and last index here. You can pass -1 for both to get the full list.
HTH
Ishan Sahore, módosítva 11 év-val korábban
RE: Get data from existing Liferay tables using Expando.
Junior Member Bejegyzések: 56 Csatlakozás dátuma: 2012.04.26. Legújabb bejegyzésekHarish Kumar:
Hi Ishan
getStart() and getEnd() denotes the start and last index here. You can pass -1 for both to get the full list.
HTH
Thanks Harish,
I did what u said. It worked.
I am curious to know where do these methods getStart() and getEnd() come from.
Tomáš Polešovský, módosítva 11 év-val korábban
RE: Get data from existing Liferay tables using Expando.
Liferay Master Bejegyzések: 676 Csatlakozás dátuma: 2009.02.13. Legújabb bejegyzések
Hi Ishan,
I copied it somewhere from portal sources. -1 means QueryUtil.ALL_POS.
-- tom +
I copied it somewhere from portal sources. -1 means QueryUtil.ALL_POS.
-- tom +