RE: How to call service class in command class?

thumbnail
Mahammad Ashik A, modified 6 Years ago. Junior Member Posts: 81 Join Date: 7/17/17 Recent Posts
Hi,

My requirement is while publishing data in ddl form then i need to generate qr code. So i have overridden BaseMVCActioncommand.

I have attached my code below




Component(immediate = true, property = { "javax.portlet.name=" + DDLControllerModulePortletKeys.DYNAMIC_DATA_LISTS,
        "javax.portlet.name=" + DDLControllerModulePortletKeys.DYNAMIC_DATA_LISTS_DISPLAY, "mvc.command.name=addRecord",
        "service.ranking:Integer=100" 
        
        }, service = MVCActionCommand.class)

public class DDLControllerModulePortlet extends BaseMVCActionCommand {

    protected void doProcessAction(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception{


//here i am performing some custom actions like qrcode generator

}
}


now i thiink i need to call ddlservice calss to store ddl data.
for e.g recordidset,companyId,formvalues etc.

How  i can achieve this???

Now i am not able to add any record to ddl table........

I am working liferay 7.1


Please help me..


Thanks in advance


thumbnail
Olaf Kock, modified 6 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
Mahammad Ashik A

My requirement is while publishing data in ddl form then i need to generate qr code. So i have overridden BaseMVCActioncommand.

The whole question sounds like you're generating the QR code before storing it - shouldn't you rather be generating it from the available data when you're showing the data, as the machine readable alternative to the actual data?
thumbnail
Mahammad Ashik A, modified 6 Years ago. Junior Member Posts: 81 Join Date: 7/17/17 Recent Posts
Thanks for your reply.

Yes, I am going to generate qr code before storing data. Because i need to generate qr code based on custom table Id. 

But i am storing qr code in other custom table. no need to expand ddl table.

​​​​​​​Thank You