10-28-2016 04:49 AM
Hi,
how can i add document preview feature into SearchResultPropertyLink?
Reards
janaka
10-28-2016 05:23 AM
Follow these steps...
10-28-2016 08:31 AM
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}"
}
}
}
10-28-2016 08:40 AM
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.
10-28-2016 01:45 PM
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.
publishPayload: {
node:{
mimetype:"{mimetype}"
},
nodeRef: "{nodeRef}",
displayName:"{displayName}"
}
10-31-2016 05:54 AM
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?
10-31-2016 01:26 PM
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
{
name: "alfresco/renderers/PropertyLink",
config: {
propertyToRender: "displayName",
publishTopic: "ALF_SHOW_NODE_PREVIEW",
useCurrentItemAsPayload: false,
publishPayloadType: "PROCESS",
publishPayloadModifiers: ["processCurrentItemTokens"],
publishPayload: {
node:{
mimetype:"{mimetype}"
},
nodeRef: "{nodeRef}",
displayName:"{displayName}"
}
}
}
10-31-2016 03:33 PM
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.
11-01-2016 12:42 AM
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
{
name: "alfresco/renderers/PropertyLink",
config: {
publishGlobal: true,
propertyToRender: "displayName",
publishTopic: "ALF_SHOW_NODE_PREVIEW",
useCurrentItemAsPayload: true
}
}
11-01-2016 04:19 AM
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!
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.