CA Service Management

 View Only
Expand all | Collapse all

Need a link to SDM Request Attachments from a PAM IRF or Email

  • 1.  Need a link to SDM Request Attachments from a PAM IRF or Email

    Posted Jun 22, 2016 05:17 PM

    There is a similar question to this already at: https://communities.ca.com/thread/241689547#comments But there is no answer provided other than I should be asking it here. I need to produce a list of links within a PAM IRF & generated email to SDM Request Attachments. I'm already looping through the attachments and getting all of the pertenant information regarding them (ids, file names etc).

     

    I attempted to do something similar to what is being discussed here:

    Downloading attachment using CA Upload servlet using following link

     

    But am having no success. I get a bpsid using the getBopsidResponse SDM Invoke call and place it in there along with a session ID and end up with a link that looks like this:

    https://myhost:8443/CAisd/UploadServlet?AttmntId=420764&Bpsid=1069794953&retURL=http://myhost/CAisd/pdmweb.exe?SID=1942889762+FID=1234567890

     

    This appears to be the same servlet that is used out of the box with SDM and seems to be similar in how the popup window works when you click on one of the attachments within the details page on a request having attachments only that in my case I end up downloading the UploadServlet file or am staring at a blank white screen.

     

    My prototype work flow looks like this:

     

     

     

    And so I wrote a processing script that looks like this:

    Process.BaseXML = convertXml(applyXPath(Process['SEL_Attmnts'].SoapResponseBody,"//doSelectReturn")).text_;
    var xpGetAttribute = function (attrId,xml) {
      var xpath = "//AttrName[text()='" + attrId + "']/following-sibling::AttrValue/text()";
      return applyXPath(xml, xpath);
    }
    Process.attachments = applyXPath(Process.BaseXML,"//UDSObject",true,true);
    //loop the attachments
    Process.links = '<ul>';
    
    var bopsid = Process.Invoke_Service_Desk_Web_Servic_1.getBopsidReturn;
    var sid = Process.Invoke_Service_Desk_Web_Servic_1.ServiceDeskSessionID;
    var host = 'MyHost';
    
    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 szlink = "http://"+host+"/CAisd/UploadServlet?AttmntId=" + attid + "&Bpsid=" + bopsid + "&retURL=http://"+host +"/CAisd/pdmweb.exe?SID=" + sid + "+FID=" + fid
      
      
      Process.links += '<li><a href="'+szlink+'">'+i+': '+name+'</a></li>';
    }
    Process.links += '</ul>'
    

     

    Any help here would be greatly appreciated!

     

    Best Regards

     

    Joel-



  • 2.  Re: Need a link to SDM Request Attachments from a PAM IRF or Email

    Posted Jul 01, 2016 07:58 AM

    Hi Joel

    maybe this one helps. give it a try:

    <NX_WEB_CGI_URL>?OP=LINK_WITH_BOPSID+URL=<NX_SERVLET_SERVER_URL>/CAisd/UploadServlet?AttmntId=<attmnt_id>%26Bpsid=%25<bopsid>%26retURL=<NX_WEB_CGI_URL>?OP=DISPLAY_FORM%2BHTMPL=attmnt_download_done.htmpl%26ServerName=<repository-server>

     

     

    where you would need to substitute the following values:

    • <NX_WEB_CGI_URL>: your normal pdmweb.exe URL, pick it up from NX.env
    • <NX_SERVLET_SERVER_URL>: the servlet host and port, pick it up from NX.env as well
    • <attmnt_id>: the id of the attachment you would like display
    • <bopsid>: a valid bopsid
    • <repository-server>: the server name of the repository the attchment is stored in

     

    This has worked in my environment, to dowload attachment directly, of course in a browser

    Regards

    .............Michael



  • 3.  Re: Need a link to SDM Request Attachments from a PAM IRF or Email

    Posted Jul 01, 2016 08:47 AM

    I'll give it a whirl here this afternoon. Thank you!



  • 4.  Re: Need a link to SDM Request Attachments from a PAM IRF or Email

     
    Posted Jul 05, 2016 04:38 PM

    Hi j.barger - Did Michael_Mueller 's response help answer your question? If so please mark as Correct Answer. Thanks!



  • 5.  Re: Need a link to SDM Request Attachments from a PAM IRF or Email

    Posted Jul 08, 2016 12:12 PM

    Hi Chris,

     

    My apologies I'm working on 3 different areas of a fairly complicated workflow at the moment and havent had a chance to circle back around to this. I'm hoping to hit this here this afternoon.



  • 6.  Re: Need a link to SDM Request Attachments from a PAM IRF or Email

    Posted Jul 08, 2016 01:07 PM

    Hi Michael,

    This just takes me back to the service desk home page with a blank white content area. I checked a few times for valid data in the query string and it looks correct.

    After speaking with Michael N. he was saying the best approach is to build a separate application that provides access to the attachments?

     

    I ended up with this...

    https://myhost/CAisd/pdmweb.exe?OP=LINK_WITH_BOPSID+URL=http://myhost/CAisd/UploadServlet:8443/CAisd/UploadServlet?AttmntId=420853%26Bpsid=%251543435749%26retURL=https://myhost/CAisd/pdmweb.exe?OP=DISPLAY_FORM%2BHTMPL=attmnt_download_done.htmpl%26ServerName=myhost

     

     

    Best Regards,

     

    Joel-



  • 7.  Re: Need a link to SDM Request Attachments from a PAM IRF or Email

     
    Posted Jul 13, 2016 04:54 PM

    Hi j.barger - Were you able to check out Michael_Mueller's latest response? Thanks!



  • 8.  Re: Need a link to SDM Request Attachments from a PAM IRF or Email
    Best Answer

    Posted Jul 11, 2016 09:33 AM

    Hi Joel.

     

    sorry my mistake,so once again, hopefully correct now. The trick is not to pass a real bopsid in the Bpsid parameter but only a placeholder , which gets substituted by the LINK_WITH BOPSID operation:

     

    <NX_WEB_CGI_URL>?OP=LINK_WITH_BOPSID+URL=<NX_SERVLET_SERVER_URL>/CAisd/UploadServlet?AttmntId=<attmnt_id>%26Bpsid=%25bopsid%26retURL=<NX_WEB_CGI_URL>?OP=DISPLAY_FORM%2BHTMPL=attmnt_download_done.htmpl%26ServerName=<repository-server>

     

     

    where you would need to substitute the following values:

    • <NX_WEB_CGI_URL>: your normal pdmweb.exe URL, pick it up from NX.env
    • <NX_SERVLET_SERVER_URL>: the servlet host and port, pick it up from NX.env as well
    • <attmnt_id>: the id of the attachment you would like display
    • <repository-server>: the server name of the repository the attchment is stored in

     

    As you can see no real bopsid value in there anymore

    Sure if you fill in your values and copy this URL to your bowser, you will be asked for user/password.

    to avoid this authentication you may pass a real bopsid for the LINK_WITH_BOPSID operation, like:

     

    <NX_WEB_CGI_URL>?OP=LINK_WITH_BOPSID+BOPSID=<bopsid>+URL=<NX_SERVLET_SERVER_URL>/CAisd/UploadServlet?AttmntId=<attmnt_id>%26Bpsid=%25bopsid%26retURL=<NX_WEB_CGI_URL>?OP=DISPLAY_FORM%2BHTMPL=attmnt_download_done.htmpl%26ServerName=<repository-server>

     

     

    where you would need to substitute the following values:

    • <NX_WEB_CGI_URL>: your normal pdmweb.exe URL, pick it up from NX.env
    • <NX_SERVLET_SERVER_URL>: the servlet host and port, pick it up from NX.env as well
    • <attmnt_id>: the id of the attachment you would like display
    • <repository-server>: the server name of the repository the attchment is stored in
    • <bopsid>: a valid bopsid

     

    Hope this helps now and work for you as well

    Regards

    ...............Michael



  • 9.  Re: Need a link to SDM Request Attachments from a PAM IRF or Email

    Posted Jul 18, 2016 01:01 PM

    Hi Michael, I appreciate your help here but we're still getting sent to a white screen with this new URL.



  • 10.  Re: Need a link to SDM Request Attachments from a PAM IRF or Email

    Posted Jul 19, 2016 08:46 AM

    Hmm.I'm sorry to read this.

    I don't think that your problem is SDM version related because it works for me in 12.6 as well as in 14.1.

    If you only get a blank window, I would expect some error messsages in the logs , not that much in stdlog.x but in jsrvr.log and/or pdm_tomcat.log. One diffrence for sure between yours and mine system is, that I'm working with http, while you seems to need https. Nevertheless I don't think that the poblem is related to the protocoll.

    Let me know about the messages in the logs...If there are any

    Kind Regards

    ............Michael



  • 11.  Re: Need a link to SDM Request Attachments from a PAM IRF or Email

    Posted Jul 19, 2016 01:05 PM

    Hi Michael,

     

    My apologies I must have had a typo in my url but It's working!. HUGE HELP and Thank you!!!



  • 12.  Re: Need a link to SDM Request Attachments from a PAM IRF or Email

    Posted Jul 19, 2016 04:08 PM

    That's great. Glad that it'sworking .Thanks for the feedback.

    Kind Regards

    ....Michael