I can't answer this question directly ; but I can give you some information I found out whilst looking into this - maybe this will be enough to get you started on this - or maybe somebody else can fill in the gaps.
Firstly: this article may be of use - it doesn't deal with CMIS attachments (just standard PRPC attachments) - but it might still shed some light on what needs to be done here :
In fact in that link above - I previously mentioned that there are different PRPC Classes (Data-WorkAttach-CMIS for instance) used for different types of PRPC attachments: further research shows that this isn't necessarily the case (and the later prhelps miss this section off as well).
It seems that even for CMIS attachments - instances of the 'Data-WorkAttach-File' are created; here are three screenshots - showing me having uploaded an attachment to CMIS (Alfresco Community Edition - using the ATOM connector) via PRPC:
Here's the same document as viewed directly in Afresco:
And back in PRPC - we can see that an Data-WorkAttach-File instance was created for this attachment:
If we take a look at the Page Data for this instance, we can see the CMIS coordinates for this document (amongst other things):
According to the 'View Definition' of the class DATA-WORKATTACH-FILE the keys for this Class are:
One to reference the work object ; and one to represent the attachment (it seems).
The 'pyContentLocation' appears to be the Alfresco / CMIS repository ID.
If this was a standard PRPC attachment; we would be able to directly download and decode (from 'base64') the content of the 'pyAttachStream' property - but there is an added step needed here, since the content is stored in the CMIS repository.
I ran a TRACER against my Pega7 Portal: and clicked on the download attachment link.
This shows quite a few Activities being fired off - but I think one of the most interest is this one:
I haven't worked out how to use this yet; but (rather nicely) this is well documented on the History Tab of the Activity ; I include this here for completeness:
Call the activity that will perform the CMIS getContentStream API method.
Activity Primary Page:
Call this activity using a primary page of a class that extends the CMIS-ServiceData class.
This optional parameter is the Service Name key value of the connector rule that will be used for invoking the service. This connector rule instance should belong to the class of the primary page passed to this activity. If this value is not provided on the parameter page, it will be retrieved from CMIS configuration data associated with the user's current application.
This required parameter is the name of the page that contains the request data for the CMIS service. The class of the page is specified on the Pages & Classes tab of this activity. Certain property values on the request page are required. Check the pyValidateInputs activity in the class of the request data page to see which property values are required.
This optional parameter is the name of the page that will contain the data returned from the CMIS service after the activity successfully completes. If not specified, the response data will be discarded.
This activity throws a runtime exception in the event that the required input data is not valid, or the CMIS connector fails when invoked.
Hopefully this might help you start off here - I will try and return to this post if I manage to work out the next steps here.
Thanks for your response, but I got confuse because when I look at Link-Attachment instances, there have Activity with ID pxDownloadCMISFile. At the step 10 and 11 description are "get object data stream from CMIS" and "download file using data stream". At step 11 have 2 variables, PRFileRef and PRFileName. Can I use those variabels and put it to iframe src or you have others method to view the attachment? if it can, how to do it?
Though, How about creating a binary file in the Pega environment and then referring it. I am not sure, whether I am going in right direction or not? Please forgive me for that, if I misled based on your requirement.
It just momentary stop the problem with upload to PRPC and have a warning from our DBA. He didn't want to make our DB become full just from files, so he ask me to upload and view the files to/from different server (storage server) and it's still stuck. I don't know how to make it.
Can you help me with, how to upload and view files to/from different server?