Forums de discussion

Document Library download link

Kevin Matthews, modifié il y a 7 années.

Document Library download link

Expert Publications: 253 Date d'inscription: 25/01/16 Publications récentes
Hi, I am having a problem with the document portlet Download link. I am using Liferay 7.0 GA3. I think al three issues below are related to the buggy download link highlighted inred. Can someone help me. I have attached the screens hots as to where this download link is located


Issue #1
After downloading the document from the workflow screen, if the user tries to approve the asset, the ‘Done’ button in the Approve screen doesn’t work. The approver has to sign out every time in order to approve it. O Download bug impacts multiple screens.

Issue #2
After going inside the document from Content -> Documents and Media, once we have downloaded a document using the ‘Download’ option, once a documment is downloaded we can’t download any other documents. The user has to log out and log back in order to download, assign or approve any asset in LifeRay.

Issue #3
The ‘Submit for Publication’ button doesn’t work after the user downloaded a document. The user has to log out and log back in to upload a docuement in LifeRay.


To get to the download link go to either your workflow screen select the view then click on info and you should see the download link inside the metadata information.

Thanks
Kevin
thumbnail
Juan Gonzalez, modifié il y a 7 années.

RE: Document Library download link

Liferay Legend Publications: 3089 Date d'inscription: 28/10/08 Publications récentes
Seems you are reproducing the same issue as this one:

https://web.liferay.com/community/forums/-/message_boards/message/85402876

That LPS will be in Liferay 7 GA4, which should be released pretty soon.
Kevin Matthews, modifié il y a 7 années.

RE: Document Library download link

Expert Publications: 253 Date d'inscription: 25/01/16 Publications récentes
Thanks for the response Juan . Do you know the exact date will Liferay 7 GA4 will be release?

Kevin
thumbnail
Juan Gonzalez, modifié il y a 7 années.

RE: Document Library download link

Liferay Legend Publications: 3089 Date d'inscription: 28/10/08 Publications récentes
Kevin Matthews:
Thanks for the response Juan . Do you know the exact date will Liferay 7 GA4 will be release?

Kevin


I am not Liferay employee anymore, but even still being, I couldn't make those temptative dates public. Those dates can vary a lot depending on problems found. You have the needed source changes in github though.
Kevin Matthews, modifié il y a 7 années.

RE: Document Library download link

Expert Publications: 253 Date d'inscription: 25/01/16 Publications récentes
Thanks, Juan.

Also, I wanted to find out if in GA4 is there going to be updates to the way how we customize workflow notification.

For example, I am having a difficult time customizing the email notification. I am trying to customize the following:

1. Currently in the workflow notification, the FROM Email is coming as "Liferay Portal Workflow Notifications <no-reply@liferay.com>" I would like to have the ability to change this to my own custom content

2. There is no subject in the email. I would like to insert my custom subject with dynamic data. For example “A request for document <dfileEntry.title>' is <dfileversion.status>

Could you tell me how to resolve this issue? I have attached my workflow definition file.

I was looking at this ticket https://issues.liferay.com/browse/LPS-36149. However, when I go tot edit a document to test the notification by putting the groovy script in my template, I am getting errors in my log

017-03-30 20:12:23:207 ERROR [default task-7][FileImpl:451] java.lang.NoSuchMethodError: org.apache.poi.hwpf.model.ListLevel.getRestart()S
java.lang.NoSuchMethodError: org.apache.poi.hwpf.model.ListLevel.getRestart()S
at org.apache.tika.parser.microsoft.ListManager.buildTuple(ListManager.java:108)
at org.apache.tika.parser.microsoft.ListManager.getFormattedNumber(ListManager.java:86)
at org.apache.tika.parser.microsoft.WordExtractor.handleParagraph(WordExtractor.java:277)
at org.apache.tika.parser.microsoft.WordExtractor.parse(WordExtractor.java:168)
at org.apache.tika.parser.microsoft.OfficeParser.parse(OfficeParser.java:146)
at org.apache.tika.parser.microsoft.OfficeParser.parse(OfficeParser.java:117)
at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280)
at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280)
at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:120)
at org.apache.tika.Tika.parseToString(Tika.java:465)
at org.apache.tika.Tika.parseToString(Tika.java:540)
at com.liferay.portal.util.FileImpl.extractText(FileImpl.java:429)
at com.liferay.portal.kernel.util.FileUtil.extractText(FileUtil.java:217)
at com.liferay.portal.kernel.search.DocumentImpl.addFile(DocumentImpl.java:199)
at com.liferay.portlet.documentlibrary.util.DLFileEntryIndexer.doGetDocument(DLFileEntryIndexer.java:387)
at com.liferay.portlet.documentlibrary.util.DLFileEntryIndexer.doGetDocument(DLFileEntryIndexer.java:99)
at com.liferay.portal.kernel.search.BaseIndexer.getDocument(BaseIndexer.java:174)
at com.liferay.portlet.documentlibrary.util.DLFileEntryIndexer.doReindex(DLFileEntryIndexer.java:510)
at com.liferay.portlet.documentlibrary.util.DLFileEntryIndexer.doReindex(DLFileEntryIndexer.java:522)
at com.liferay.portal.kernel.search.BaseIndexer.reindex(BaseIndexer.java:546)
at com.liferay.portal.search.buffer.NoAutoCommitIndexer.reindex(NoAutoCommitIndexer.java:273)
at sun.reflect.GeneratedMethodAccessor479.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.liferay.portal.search.buffer.IndexerRequest.execute(IndexerRequest.java:95)
at com.liferay.portal.search.internal.buffer.BaseIndexerRequestBufferExecutor.executeIndexerRequest(BaseIndexerRequestBufferExecutor.java:68)
at com.liferay.portal.search.internal.buffer.DefaultIndexerRequestBufferExecutor.execute(DefaultIndexerRequestBufferExecutor.java:68)
at com.liferay.portal.search.internal.buffer.BaseIndexerRequestBufferExecutor.execute(BaseIndexerRequestBufferExecutor.java:40)
at com.liferay.portal.search.internal.buffer.IndexerRequestBufferTransactionLifecycleListener.committed(IndexerRequestBufferTransactionLifecycleListener.java:46)
Kevin Matthews, modifié il y a 7 années.

RE: Document Library download link

Expert Publications: 253 Date d'inscription: 25/01/16 Publications récentes
Hi Juan, strangely enough I was able to get it working. I still dont know

<action>
<name>change-mail</name>
<script>
<![CDATA[
workflowContext.put("notificationSenderAddress", "no-reply@custom.com");
workflowContext.put("notificationSenderName", "custom subject");
workflowContext.put("notificationSubject", "custom subject");
]]>
</script>
<script-language>groovy</script-language>
<execution-type>onAssignment</execution-type>
</action>
thumbnail
Juan Gonzalez, modifié il y a 7 années.

RE: Document Library download link

Liferay Legend Publications: 3089 Date d'inscription: 28/10/08 Publications récentes
Kevin Matthews:
Hi Juan, strangely enough I was able to get it working. I still dont know

<action>
<name>change-mail</name>
<script>
<![CDATA[
workflowContext.put("notificationSenderAddress", "no-reply@custom.com");
workflowContext.put("notificationSenderName", "custom subject");
workflowContext.put("notificationSubject", "custom subject");
]]>
</script>
<script-language>groovy</script-language>
<execution-type>onAssignment</execution-type>
</action>


Good news then. Yes, that is the way it should be done (didn't remember when I added the comment here: https://issues.liferay.com/browse/LPS-36149?focusedCommentId=318669&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-318669).

About your previous problem, the only thing I found was fixed for 7 GA2, so it should happen in your case.
Kevin Matthews, modifié il y a 7 années.

RE: Document Library download link

Expert Publications: 253 Date d'inscription: 25/01/16 Publications récentes
Juan Gonzalez:
Kevin Matthews:
Hi Juan, strangely enough I was able to get it working. I still dont know

<action>
<name>change-mail</name>
<script>
<![CDATA[
workflowContext.put("notificationSenderAddress", "no-reply@custom.com");
workflowContext.put("notificationSenderName", "custom subject");
workflowContext.put("notificationSubject", "custom subject");
]]>
</script>
<script-language>groovy</script-language>
<execution-type>onAssignment</execution-type>
</action>


Good news then. Yes, that is the way it should be done (didn't remember when I added the comment here: https://issues.liferay.com/browse/LPS-36149?focusedCommentId=318669&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-318669).

About your previous problem, the only thing I found was fixed for 7 GA2, so it should happen in your case.


One more question. Do you know how to get dynamic values using the groovy script in the work definition file? For example, I would like to get the document name and version in the subject content, So the subject will contain -> Your pending document Appendix-a, version 1.3 is ready for review?
Kevin Matthews, modifié il y a 7 années.

RE: Document Library download link

Expert Publications: 253 Date d'inscription: 25/01/16 Publications récentes
Kevin Matthews:
Juan Gonzalez:
Kevin Matthews:
Hi Juan, strangely enough I was able to get it working. I still dont know

<action>
<name>change-mail</name>
<script>
<![CDATA[
workflowContext.put("notificationSenderAddress", "no-reply@custom.com");
workflowContext.put("notificationSenderName", "custom subject");
workflowContext.put("notificationSubject", "custom subject");
]]>
</script>
<script-language>groovy</script-language>
<execution-type>onAssignment</execution-type>
</action>


Good news then. Yes, that is the way it should be done (didn't remember when I added the comment here: https://issues.liferay.com/browse/LPS-36149?focusedCommentId=318669&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-318669).

About your previous problem, the only thing I found was fixed for 7 GA2, so it should happen in your case.


One more question. Do you know how to get dynamic values using the groovy script in the work definition file? For example, I would like to get the document name and version in the subject content, So the subject will contain -> Your pending document Appendix-a, version 1.3 is ready for review?



Ok I was able to figure it out. It seems you can import that package directly in the definition file as groovy is similar to java
<script>
<![CDATA[


import com.liferay.document.library.kernel.service.DLFileVersionLocalServiceUtil;
import com.liferay.document.library.kernel.service.DLFileEntryLocalServiceUtil;
import com.liferay.document.library.kernel.model.DLFileVersion;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.workflow.WorkflowConstants;
import com.liferay.portal.kernel.workflow.WorkflowHandler;
import com.liferay.portal.kernel.workflow.WorkflowHandlerRegistryUtil;
String title = null;

try {
long classPK = GetterUtil.getLong((String)workflowContext.get(WorkflowConstants.CONTEXT_ENTRY_CLASS_PK));
DLFileVersion fileVersion = DLFileVersionLocalServiceUtil.getFileVersion(classPK);
title = "Your request for asset '"+fileVersion.getTitle()+"' version '" +fileVersion.getVersion()+"' has been";

} catch (Exception e) {
e.printStackTrace();
}

String className = (String)workflowContext.get(WorkflowConstants.CONTEXT_ENTRY_CLASS_NAME);

workflowContext.put("notificationSenderAddress", "no-reply@test.com");
workflowContext.put("notificationSenderName", "Test Development Workflow Notifications");
workflowContext.put("notificationSubject", title);
]]>
</script>