Forums de discussion

Upload file in DMS without request object

Raunak Singh, modifié il y a 6 années.

Upload file in DMS without request object

New Member Publications: 8 Date d'inscription: 16/05/17 Publications récentes
Hi, I want to know that without request object, is it feasible and recommended to upload file into Liferay DMS? If yes, then how is it done?
thumbnail
David H Nebinger, modifié il y a 6 années.

RE: Upload file in DMS without request object

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
Raunak Singh:
Hi, I want to know that without request object, is it feasible and recommended to upload file into Liferay DMS? If yes, then how is it done?


What? What do you mean, "without request object"?

You realize that the whole foundation of the web protocol is based off of an incoming request that needs to be processed, right?
Raunak Singh, modifié il y a 6 années.

RE: Upload file in DMS without request object

New Member Publications: 8 Date d'inscription: 16/05/17 Publications récentes
David H Nebinger:

What? What do you mean, "without request object"?

"Without request object", I meant that I need to upload documents using a scheduler. As far as I know, Scheduler does not have page context so the request object would not be formed in this case. When we upload any document in liferay, we provide repository information and user information from themedisplay object which is not possible without portlet request. So, is there any other way of achieving the same.

I have tried one approach using OOTB json web services but getting exception while hitting that service through postman. I have posted the question here.

Thanks in advance.
thumbnail
David H Nebinger, modifié il y a 6 années.

RE: Upload file in DMS without request object

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
Why are you trying to fake an external request?

Just build a scheduled job within Liferay to scan and upload using the local service APIs.
Raunak Singh, modifié il y a 6 années.

RE: Upload file in DMS without request object

New Member Publications: 8 Date d'inscription: 16/05/17 Publications récentes
David H Nebinger:
Just build a scheduled job within Liferay to scan and upload using the local service APIs.

This is understood. My question is how. How do i get repository id and folder id in scheduler if i do not have themedisplay object? Please tell if there are any other method of getting repository information?
thumbnail
David H Nebinger, modifié il y a 6 années.

RE: Upload file in DMS without request object

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
From a scheduled jobs perspective, aren't these pretty much constants? I mean, you know where the files are going, right?
Raunak Singh, modifié il y a 6 années.

RE: Upload file in DMS without request object

New Member Publications: 8 Date d'inscription: 16/05/17 Publications récentes
Thanks David. I will give it a try.