You can generate a link to an attachment in sdm through pam using the following:
first run a soap invoke against SDM. The invoke payload will look like this
<impl:getBopsid xmlns:impl="http://www.ca.com/UnicenterServicePlus/ServiceDesk">
<sid>sid__</sid>
<contact>contact__</contact>
</impl:getBopsid>
This gets you the BOPSID for the link.
Next you'll want to select the attachments from SDM. This is done via:
This gets you the original file names...
Next you'll run a javascript to treat the two previous calls. It looks like this:
Process.BaseXML = convertXml(applyXPath(Process['SEL_Attmnts'].SoapResponseBody, "
var xpGetAttribute = function (attrId, xml) {
var xpath = "
return applyXPath(xml, xpath);
}
Process.attachments = applyXPath(Process.BaseXML, "
Process.links = '<ul>';
var bopsid = Process.Invoke_Service_Desk_Web_Servic_1.getBopsidReturn;
var sid = Process.Invoke_Service_Desk_Web_Servic_1.ServiceDeskSessionID;
for (i = 0; i < Process.attachments.length; i++) {
var attXML = Process.attachments[i];
var name = xpGetAttribute('attmnt.orig_file_name', attXML);
var attid = xpGetAttribute('attmnt', attXML);
var fid = Math.random();
var NX_WEB_CGI_URL = Process.ConfDS.att_NX_WEB_CGI_URL;
var NX_SERVLET_SERVER_URL = Process.ConfDS.att_NX_SERVLET_SERVER_URL;
var att_repository_server = Process.ConfDS.att_repository_server;
var szLink = NX_WEB_CGI_URL+"?OP=LINK_WITH_BOPSID+URL="+NX_SERVLET_SERVER_URL+"/CAisd/UploadServlet?AttmntId="+attid+"%26Bpsid=%25bopsid%26retURL="+NX_WEB_CGI_URL+"?OP=DISPLAY_FORM%2BHTMPL=attmnt_download_done.htmpl%26ServerName="+att_repository_server;
Process.links += '<li><a href="'+szLink+'">'+ name + '</a></li>';
}
Process.links += '</ul>'
Done!