Foren
fetching recordsetid in ddl
dave ch, geändert vor 11 Jahren.
fetching recordsetid in ddl
Regular Member Beiträge: 161 Beitrittsdatum: 07.02.12 Neueste Beiträge
Hi all,
I want to get recordSetId from results . How to fetch it?
if (searchTerms.isAdvancedSearch()) {
results = DDLRecordSetLocalServiceUtil.search(company.getCompanyId(), scopeGroupId, searchTerms.getName(), searchTerms.getDescription(), DDLRecordSetConstants.SCOPE_DYNAMIC_DATA_LISTS, searchTerms.isAndOperator(), searchContainer.getStart(), searchContainer.getEnd(), searchContainer.getOrderByComparator());
total = DDLRecordSetLocalServiceUtil.searchCount(company.getCompanyId(), scopeGroupId, searchTerms.getName(), searchTerms.getDescription(), DDLRecordSetConstants.SCOPE_DYNAMIC_DATA_LISTS, searchTerms.isAndOperator());
}
else {
results = DDLRecordSetLocalServiceUtil.search(company.getCompanyId(), scopeGroupId, searchTerms.getKeywords(), DDLRecordSetConstants.SCOPE_DYNAMIC_DATA_LISTS, searchContainer.getStart(), searchContainer.getEnd(), searchContainer.getOrderByComparator());
total = DDLRecordSetLocalServiceUtil.searchCount(company.getCompanyId(), scopeGroupId, searchTerms.getKeywords(), DDLRecordSetConstants.SCOPE_DYNAMIC_DATA_LISTS);
}
SOP of results is:
[{uuid=639aa0b1-3855-4edb-bb53-78431be1abe7, recordSetId=29603, groupId=1, companyId=10154, userId=1, userName=Site Admin, createDate=2012-07-23 06:08:33.014, modifiedDate=2012-07-23 06:08:33.014, DDMStructureId=23569, recordSetKey=29602, name=<?xml version='1.0' encoding='UTF-8'?><root available-locales="en_US" default-locale="en_US"><Name language-id="en_US">aaaaaaaaaaaa</Name></root>, description=<?xml version='1.0' encoding='UTF-8'?><root available-locales="en_US" default-locale="en_US"><Description language-id="en_US">aaaaaaaaaaaaaaa</Description></root>, minDisplayRows=20, scope=0}
I want to get recordSetId from results . How to fetch it?
if (searchTerms.isAdvancedSearch()) {
results = DDLRecordSetLocalServiceUtil.search(company.getCompanyId(), scopeGroupId, searchTerms.getName(), searchTerms.getDescription(), DDLRecordSetConstants.SCOPE_DYNAMIC_DATA_LISTS, searchTerms.isAndOperator(), searchContainer.getStart(), searchContainer.getEnd(), searchContainer.getOrderByComparator());
total = DDLRecordSetLocalServiceUtil.searchCount(company.getCompanyId(), scopeGroupId, searchTerms.getName(), searchTerms.getDescription(), DDLRecordSetConstants.SCOPE_DYNAMIC_DATA_LISTS, searchTerms.isAndOperator());
}
else {
results = DDLRecordSetLocalServiceUtil.search(company.getCompanyId(), scopeGroupId, searchTerms.getKeywords(), DDLRecordSetConstants.SCOPE_DYNAMIC_DATA_LISTS, searchContainer.getStart(), searchContainer.getEnd(), searchContainer.getOrderByComparator());
total = DDLRecordSetLocalServiceUtil.searchCount(company.getCompanyId(), scopeGroupId, searchTerms.getKeywords(), DDLRecordSetConstants.SCOPE_DYNAMIC_DATA_LISTS);
}
SOP of results is:
[{uuid=639aa0b1-3855-4edb-bb53-78431be1abe7, recordSetId=29603, groupId=1, companyId=10154, userId=1, userName=Site Admin, createDate=2012-07-23 06:08:33.014, modifiedDate=2012-07-23 06:08:33.014, DDMStructureId=23569, recordSetKey=29602, name=<?xml version='1.0' encoding='UTF-8'?><root available-locales="en_US" default-locale="en_US"><Name language-id="en_US">aaaaaaaaaaaa</Name></root>, description=<?xml version='1.0' encoding='UTF-8'?><root available-locales="en_US" default-locale="en_US"><Description language-id="en_US">aaaaaaaaaaaaaaa</Description></root>, minDisplayRows=20, scope=0}
Jitendra Rajput, geändert vor 11 Jahren.
RE: fetching recordsetid in ddl
Liferay Master Beiträge: 875 Beitrittsdatum: 07.01.11 Neueste Beiträge
Search method will return List of DDLRecordSet . So first of all you need to iterate your list and then you can get recordSetId from DDLRecordSet object
dave ch, geändert vor 11 Jahren.
RE: fetching recordsetid in ddl
Regular Member Beiträge: 161 Beitrittsdatum: 07.02.12 Neueste Beiträge
Thank you Jitendra for your quick response.
Could you please provide me with how to iterate the list and how to get recordSetId from DDLRecordSet object ..
Thanks in advance
Could you please provide me with how to iterate the list and how to get recordSetId from DDLRecordSet object ..
Thanks in advance
Amit Doshi, geändert vor 11 Jahren.
RE: fetching recordsetid in ddl
Liferay Master Beiträge: 550 Beitrittsdatum: 29.12.10 Neueste Beiträge
Hi Dave,
Please check this link.
Nicely mentioned all the things as per your requirement.
Thanks & Regards,
Amit Doshi
Please check this link.
Nicely mentioned all the things as per your requirement.
Thanks & Regards,
Amit Doshi
dave ch, geändert vor 11 Jahren.
RE: fetching recordsetid in ddl
Regular Member Beiträge: 161 Beitrittsdatum: 07.02.12 Neueste Beiträge
Thanks all,
I am getting stuck on how to iterate results to fetch the recordSetId, from my list.
May any body plz show me the way to implement it.
Thanks in advance.
Dave
I am getting stuck on how to iterate results to fetch the recordSetId, from my list.
May any body plz show me the way to implement it.
Thanks in advance.
Dave
Amit Doshi, geändert vor 11 Jahren.
RE: fetching recordsetid in ddl
Liferay Master Beiträge: 550 Beitrittsdatum: 29.12.10 Neueste Beiträge
Hi dave,
Sorry for focusing late on it.
I think you are able to get the List. So you can easily iterate as shown in my previous link.
Please check as below :-
You can refer DDLRecord and DDLRecordModel class in order to retrive more Values.
Thanks & Regards,
Amit Doshi
Sorry for focusing late on it.
I think you are able to get the List. So you can easily iterate as shown in my previous link.
Please check as below :-
#foreach($record in $records)
$recordsetId = $record.getRecordSetId();
#end
You can refer DDLRecord and DDLRecordModel class in order to retrive more Values.
Thanks & Regards,
Amit Doshi
dave ch, geändert vor 11 Jahren.
RE: fetching recordsetid in ddl
Regular Member Beiträge: 161 Beitrittsdatum: 07.02.12 Neueste Beiträge
#foreach($record in $records)
$recordsetId = $record.getRecordSetId();
#end
Hi Amit
Thanks for your input.
But i need to get recordsetid in my jsp.
Amit Doshi, geändert vor 11 Jahren.
RE: fetching recordsetid in ddl
Liferay Master Beiträge: 550 Beitrittsdatum: 29.12.10 Neueste Beiträge
Hi Dave,
You can use TAG Library or Scriptlet on it in order to fetch the record. And also make user you imported all the classes in jsp pages.
Regards,
Amit Doshi
You can use TAG Library or Scriptlet on it in order to fetch the record. And also make user you imported all the classes in jsp pages.
Regards,
Amit Doshi
dave ch, geändert vor 11 Jahren.
RE: fetching recordsetid in ddl
Regular Member Beiträge: 161 Beitrittsdatum: 07.02.12 Neueste Beiträge
You can use TAG Library or Scriptlet on it in order to fetch the record. And also make user you imported all the classes in jsp pages.
Hi Amit,
My requirement is i need to fetch recorddetId from results, the above code is related to vm , i need to fetch in my existing jsp.
Actually i need to iterate my list and then i can get recordSetId from DDLRecordSet object .
regards
dave
dave ch, geändert vor 11 Jahren.
RE: fetching recordsetid in ddl
Regular Member Beiträge: 161 Beitrittsdatum: 07.02.12 Neueste Beiträge
Hi,
This is my code from which i am trying to fetch my RecordSetId from the List but its not working. Could any body please help me find out where i am wrong ..
Thanks in advance..
Dave
This is my code from which i am trying to fetch my RecordSetId from the List but its not working. Could any body please help me find out where i am wrong ..
if (searchTerms.isAdvancedSearch()) {
results = DDLRecordSetLocalServiceUtil.search(company.getCompanyId(), scopeGroupId, searchTerms.getName(), searchTerms.getDescription(), DDLRecordSetConstants.SCOPE_DYNAMIC_DATA_LISTS, searchTerms.isAndOperator(), searchContainer.getStart(), searchContainer.getEnd(), searchContainer.getOrderByComparator());
total = DDLRecordSetLocalServiceUtil.searchCount(company.getCompanyId(), scopeGroupId, searchTerms.getName(), searchTerms.getDescription(), DDLRecordSetConstants.SCOPE_DYNAMIC_DATA_LISTS, searchTerms.isAndOperator());
else {
results = DDLRecordSetLocalServiceUtil.search(company.getCompanyId(), scopeGroupId, searchTerms.getKeywords(), DDLRecordSetConstants.SCOPE_DYNAMIC_DATA_LISTS, searchContainer.getStart(), searchContainer.getEnd(), searchContainer.getOrderByComparator());
total = DDLRecordSetLocalServiceUtil.searchCount(company.getCompanyId(), scopeGroupId, searchTerms.getKeywords(), DDLRecordSetConstants.SCOPE_DYNAMIC_DATA_LISTS);
int count= DDLRecordLocalServiceUtil.getRecordVersionsCount(recordId);
List<ddlrecord> results = DDLRecordLocalServiceUtil.getDDLRecords(0, count);
List resultRows = searchContainer.getResultRows();
for (int i = 0; i < results.size(); i++) {
resultRows = (List)results.get(i);
Long recId = resultRows.getRecordSetId() ;
System.out.println(recId);</ddlrecord>
Thanks in advance..
Dave
Amit Doshi, geändert vor 11 Jahren.
RE: fetching recordsetid in ddl
Liferay Master Beiträge: 550 Beitrittsdatum: 29.12.10 Neueste Beiträge
Hi Dave,
Instead of trying to fetch from DDLRecordSetLocalServiceUtil try directly from the DDLRecordLocalServiceUtil.
Here is the Pseudo-code:-
List<com.liferay.portlet.dynamicdatalists.model.DDLRecord> ddlRecords= DDLRecordLocalServiceUtil.getDDLRecords(-1,-1);
for each(DDLRecord ddlrecord:ddlRecords)
{
System.out.println(ddlrecord.getRecordSetId());
}
Hope now it is more clear.
Thanks & Regards,
Amit Doshi
Instead of trying to fetch from DDLRecordSetLocalServiceUtil try directly from the DDLRecordLocalServiceUtil.
Here is the Pseudo-code:-
List<com.liferay.portlet.dynamicdatalists.model.DDLRecord> ddlRecords= DDLRecordLocalServiceUtil.getDDLRecords(-1,-1);
for each(DDLRecord ddlrecord:ddlRecords)
{
System.out.println(ddlrecord.getRecordSetId());
}
Hope now it is more clear.
Thanks & Regards,
Amit Doshi
dave ch, geändert vor 11 Jahren.
RE: fetching recordsetid in ddl (Antwort)
Regular Member Beiträge: 161 Beitrittsdatum: 07.02.12 Neueste Beiträge
Here is the way i solved it:
regards
Dave
List<ddlrecordset> ddlrecordSet = DDLRecordSetLocalServiceUtil.search(company.getCompanyId(), scopeGroupId, searchTerms.getKeywords(), DDLRecordSetConstants.SCOPE_DYNAMIC_DATA_LISTS, searchContainer.getStart(), searchContainer.getEnd(), searchContainer.getOrderByComparator());
results = DDLRecordSetLocalServiceUtil.search(company.getCompanyId(), scopeGroupId, searchTerms.getKeywords(), DDLRecordSetConstants.SCOPE_DYNAMIC_DATA_LISTS, searchContainer.getStart(), searchContainer.getEnd(), searchContainer.getOrderByComparator());
total = DDLRecordSetLocalServiceUtil.searchCount(company.getCompanyId(), scopeGroupId, searchTerms.getKeywords(), DDLRecordSetConstants.SCOPE_DYNAMIC_DATA_LISTS);
System.out.println("ddlrecordSet "+ddlrecordSet);</ddlrecordset>
regards
Dave