As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
Hi,
how can i add document preview feature into SearchResultPropertyLink?
Reards
janaka
Follow these steps...
thanks dave. i use NodePreviewService and PropertyLink. it is working.
i have one issue , i need to pass mimetype with node otherwise title of dialogbox is empty.
how to pass that node? i have used following, but node is not working please correct this.
{
name: "alfresco/renderers/PropertyLink",
config: {
propertyToRender: "displayName",
publishTopic: "ALF_SHOW_NODE_PREVIEW",
publishPayload: {
node:{
mimetype:"{mimeTypes}"
}
If you look at the JSDoc for the SHOW_NODE_PREVIEW topic you'll see that it expects either a "node" or "nodeRef" parameter in the payload. By default the PropertyLink will publish the currentItem (that is the search result) when clicked (you can stop it publishing the currentItem by configuring "useCurrentItemAsPayload" to be false. You should not need to configure a publishPayload at all.
Can you clarify how it is not working. I think that the issue may be that the NodePreviewService is not actually present in the default faceted search page so you should add it to the model.jsonModel.services array in your extension.
Once you've done this, if it's still not working you should use the pub/sub log (accessed from the "Debug Menu" of Share) to confirm that the subscription is being created and that the correct publication is being made.
Hi dave,
i have used my own aikau dashlet and render document details by using alfSearchResult. Also i have used 'PropertyLink' for 'displayName' column and NodePreviewService as service. publishTopic in 'PropertyLink' is 'ALF_SHOW_NODE_PREVIEW'. i set payload as follow and set useCurrentItemAsPayload to be false. it can pass necessary parameter (node,nodeRef,displayName) into function of service. then it can properly popup document , when click on particular document.
mimetype:"{mimetype}"
},
nodeRef: "{nodeRef}",
displayName:"{displayName}"
I'm still not sure I understand the issue... as I stated before, you shouldn't need to configure a publishPayload (as you just need the nodeRef at the root of the payload which the currentItem already has) as the NodePreviewService will just load the full metadata for the node (providing that the DocumentService is also on the page).
However, if you do wish to configure a payload it is essential that you have configured:
publishPayloadType: "PROCESS",
publishPayloadModifiers: ["processCurrentItemTokens"]
...as this is what will enable you to use token substitution in the payload.
Can you confirm that you have done this please?
i have used following propertyLink. it is working. if i does not use publishPayload, it is unable to fill node with meta data (return node is undefined) . therefore i can not see title of popup dialog
useCurrentItemAsPayload: false,
publishPayloadModifiers: ["processCurrentItemTokens"],
What is the value of the currentItem for the PropertyLink? You will probably need to add a breakpoint to this to find out... I don't understand why it does not contain the attributes required if you are rendering search results.
here i added screen shot to show which attribute is available with payload and this, When i have used following 'PropertyLink' without 'publishPayload' . then i can see filled node under this.currentItem object. but To get mimetype, payload.node should be filled , when click on link.
please confirm whether i have referenced correct attribute of PropertyLink
publishGlobal: true,
useCurrentItemAsPayload: true
What you're actually showing in that screenshot is the currentItem temporarily assigned to the NodePreviewService (a currentItem is assigned temporaily in the showPreview function)... this appears to contain the full metadata for a node so must have been retrieved via the DocumentService when a payload was provided that just contained a nodeRef attribute (because the search API doesn't return full node metadata). This currentItem will be a remnant of the last time a preview was shown.
What I'm actually interested in is the payload object that is just clipped out of the screenshot you've pasted - this contains the information on the current request for a preview.
What is interesting about this is that it looks like you've already got through the code path to load the metadata for a node based on a supplied node preview so you should have at least seen a preview successfully generated previously!
Hi dave ,
when i tested this document preview on apple PC , i can see particular document on popup dialog. but tool bar is just shown and invisible .
OSX ver. 10.11.6firefox 49.0.2
OK, that does seem strange... it looks like you're just showing the raw PDF.js output in a dialog without going through the outer AlfDocumentPreview widget - is this possible? We do have unit tests that cover these capabilities and they are used in and tested in production and an issue such as this hasn't been reported.
Are you getting this purely through the NodePreviewService or are you going via some other mechanism? What custom code is being used?
Unfortunately it is very difficult to provide any meaningful assistance without being able to see your code. What debugging steps have you taken? Are any errors being shown in the browser console?
What version of Alfresco / Aikau are you using here?