Foren

Home » Liferay Portal » English » 3. Development

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
dave ch
fetching recordsetid in ddl
23. Juli 2012 04:17
Antwort

dave ch

Rang: Regular Member

Nachrichten: 164

Eintrittsdatum: 6. Februar 2012

Neue 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}
Jitendra Rajput
RE: fetching recordsetid in ddl
23. Juli 2012 04:46
Antwort

Jitendra Rajput

Rang: Liferay Master

Nachrichten: 858

Eintrittsdatum: 7. Januar 2011

Neue 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
RE: fetching recordsetid in ddl
23. Juli 2012 05:15
Antwort

dave ch

Rang: Regular Member

Nachrichten: 164

Eintrittsdatum: 6. Februar 2012

Neue 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
Amit Doshi
RE: fetching recordsetid in ddl
23. Juli 2012 06:32
Antwort

Amit Doshi

Rang: Liferay Master

Nachrichten: 549

Eintrittsdatum: 29. Dezember 2010

Neue Beiträge

Hi Dave,

Please check this link.

Nicely mentioned all the things as per your requirement.

Thanks & Regards,
Amit Doshi
dave ch
RE: fetching recordsetid in ddl
23. Juli 2012 23:28
Antwort

dave ch

Rang: Regular Member

Nachrichten: 164

Eintrittsdatum: 6. Februar 2012

Neue 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
Amit Doshi
RE: fetching recordsetid in ddl
24. Juli 2012 03:00
Antwort

Amit Doshi

Rang: Liferay Master

Nachrichten: 549

Eintrittsdatum: 29. Dezember 2010

Neue 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 :-

1
2
3#foreach($record in $records)
4
5$recordsetId = $record.getRecordSetId();
6
7#end


You can refer DDLRecord and DDLRecordModel class in order to retrive more Values.

Thanks & Regards,
Amit Doshi
dave ch
RE: fetching recordsetid in ddl
24. Juli 2012 03:16
Antwort

dave ch

Rang: Regular Member

Nachrichten: 164

Eintrittsdatum: 6. Februar 2012

Neue 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
RE: fetching recordsetid in ddl
24. Juli 2012 03:18
Antwort

Amit Doshi

Rang: Liferay Master

Nachrichten: 549

Eintrittsdatum: 29. Dezember 2010

Neue 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
dave ch
RE: fetching recordsetid in ddl
24. Juli 2012 04:06
Antwort

dave ch

Rang: Regular Member

Nachrichten: 164

Eintrittsdatum: 6. Februar 2012

Neue 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
RE: fetching recordsetid in ddl
24. Juli 2012 08:56
Antwort

dave ch

Rang: Regular Member

Nachrichten: 164

Eintrittsdatum: 6. Februar 2012

Neue 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 ..


 1if (searchTerms.isAdvancedSearch()) {
 2    results = DDLRecordSetLocalServiceUtil.search(company.getCompanyId(), scopeGroupId, searchTerms.getName(), searchTerms.getDescription(), DDLRecordSetConstants.SCOPE_DYNAMIC_DATA_LISTS, searchTerms.isAndOperator(), searchContainer.getStart(), searchContainer.getEnd(), searchContainer.getOrderByComparator());
 3    total = DDLRecordSetLocalServiceUtil.searchCount(company.getCompanyId(), scopeGroupId, searchTerms.getName(), searchTerms.getDescription(), DDLRecordSetConstants.SCOPE_DYNAMIC_DATA_LISTS, searchTerms.isAndOperator());
 4 
 5
 6else {
 7    results = DDLRecordSetLocalServiceUtil.search(company.getCompanyId(), scopeGroupId, searchTerms.getKeywords(), DDLRecordSetConstants.SCOPE_DYNAMIC_DATA_LISTS, searchContainer.getStart(), searchContainer.getEnd(), searchContainer.getOrderByComparator());
 8    total = DDLRecordSetLocalServiceUtil.searchCount(company.getCompanyId(), scopeGroupId, searchTerms.getKeywords(), DDLRecordSetConstants.SCOPE_DYNAMIC_DATA_LISTS);
 9   
10
11int count= DDLRecordLocalServiceUtil.getRecordVersionsCount(recordId);
12    List<DDLRecord> results = DDLRecordLocalServiceUtil.getDDLRecords(0, count);
13   
14    List resultRows = searchContainer.getResultRows();
15   
16   
17    for (int i = 0; i < results.size(); i++) {
18        resultRows = (List)results.get(i);
19       
20        Long  recId = resultRows.getRecordSetId() ;
21        System.out.println(recId);


Thanks in advance..

Dave
Amit Doshi
RE: fetching recordsetid in ddl
25. Juli 2012 03:53
Antwort

Amit Doshi

Rang: Liferay Master

Nachrichten: 549

Eintrittsdatum: 29. Dezember 2010

Neue 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
dave ch
RE: fetching recordsetid in ddl
25. Juli 2012 05:37
Antwort

dave ch

Rang: Regular Member

Nachrichten: 164

Eintrittsdatum: 6. Februar 2012

Neue Beiträge

Here is the way i solved it:
1
2List<DDLRecordSet> ddlrecordSet = DDLRecordSetLocalServiceUtil.search(company.getCompanyId(), scopeGroupId, searchTerms.getKeywords(), DDLRecordSetConstants.SCOPE_DYNAMIC_DATA_LISTS, searchContainer.getStart(), searchContainer.getEnd(), searchContainer.getOrderByComparator());
3    results = DDLRecordSetLocalServiceUtil.search(company.getCompanyId(), scopeGroupId, searchTerms.getKeywords(), DDLRecordSetConstants.SCOPE_DYNAMIC_DATA_LISTS, searchContainer.getStart(), searchContainer.getEnd(), searchContainer.getOrderByComparator());
4    total = DDLRecordSetLocalServiceUtil.searchCount(company.getCompanyId(), scopeGroupId, searchTerms.getKeywords(), DDLRecordSetConstants.SCOPE_DYNAMIC_DATA_LISTS);
5
6System.out.println("ddlrecordSet    "+ddlrecordSet);


regards

Dave