TMACUL

http://www.servicedeskusers.com/Attachments_on_Configuration_Items_r12.

Blog Post created by TMACUL Champion on Jan 1, 2016

Attachments on Configuration Items r12

From SDU

Jump to: navigation, search

 

To make corrections or additions to this article, select the edit tab above.
To discuss or ask questions about this article, select the discussion tab above.

 

 

Overview

This article provides instructions for adding attachment capabilities to Configuration Items in CA Service Desk Manager.

Note: This customization is designed for r12.5 and above versions, providing an implementation of the previous Attachments on Configuration Items customization. The previous customization is targeted for r11.x and r12.0/r12.1 CA SDM version.

 

Procedures

SDM Schema customizations

Use the Web Screen Painter to add a new Table in the Schema Designer. The new table should be called zlrel_attachment_nrs and should have 2 fields:

Field nameType of Field
nrSREL to 'nr', required
attmntSREL to 'attmnt', required

Set the Function Group of this new table to "Configuration Item". Save the Schema changes in the Schema Designer and then choose 'File->Save and Publish' from the menu.

In order for the Schema changes to be applied, stop the CA Service Desk Manager service on the primary server and then execute 'pdm_publish' from a command prompt.

Before starting the CA Service Desk Manager service, create a new MAJ file in the $NX_ROOT/site/mods/majic folder, called z_nr_cis.maj. This file should contain the following lines:

//////////////////////////////////////////////////////////////////////// // Factory:   attmnt ////////////////////////////////////////////////////////////////////////   OBJECT attmnt { ATTRIBUTES Attachment { nrs BREL zlrel_attachment_nrs attmnt { LREL nr; } ; }; };   //////////////////////////////////////////////////////////////////////// // Factory:   nr ////////////////////////////////////////////////////////////////////////   OBJECT nr { ATTRIBUTES usp_owned_resource SECONDARY { attachments BREL zlrel_attachment_nrs nr { LREL attmnt; } ; }; };

Make sure the file has the .maj extension, otherwise it will not be processed by SDM.

Finally, start the CA Service Desk Manager service back on and make sure that there are no errors reported in the stdlogs.

Interface customizations

Configuration Item detail form

Customize the cmdbNotebook.htmpl form to add a new Tab to the Configuration Item detail form. The form contains the definition of all the Tabs that appear on the Configuration Item detail form, you can just insert the new Tab definition where desired, using the following code:

<PDM_MACRO NAME=TAB  title="Files" ID=Attachments SRC="OP=SHOW_DETAIL+HTMPL=xx_attmnt_tab.htmpl+FACTORY=nr+PERSID=$args.persistent_id+NO_DP=yes">

Attachments list form

Customize the list_attmnt_sd.htmpl form by adding lines in 2 places.

First, after the line
document.write('<input type="hidden" name="QBE.EQ.issues.iss.persistent_id" value="$args.QBE.EQ.issues.iss.persistent_id">');

the following code should be added

// Custom - enable the display of Attachments in a Tab on the Configuration Item detail form document.write('<input type="hidden" name="QBE.EQ.nrs.nr.id" value="$args.QBE.EQ.nr_list.nr.id">'); // END Custom

Second, after the line

case "chg": attmntAccess = "${ACCESS.FAC_chg:0}" - 0; break;

the following code should be added

// Custom - enable the display of Attachments in a Tab on the Configuration Item detail form case "nr": attmntAccess = "${ACCESS.FAC_nr:0}" - 0; break; // END Custom

The Attachment Tab form

Customize the xx_attmnt_tab.htmpl file.

1. Search for the following code fragment:

var attmntAccess = 0; switch ("$prop.factory") { case "cr":  attmntAccess = "${ACCESS.FAC_cr:0}" - 0; break; case "iss": attmntAccess = "${ACCESS.FAC_iss:0}" - 0; break; case "chg": attmntAccess = "${ACCESS.FAC_chg:0}" - 0; break; }

and replace it with

var attmntAccess = 0; switch ("$prop.factory") { case "cr":  attmntAccess = "${ACCESS.FAC_cr:0}" - 0; break; case "iss": attmntAccess = "${ACCESS.FAC_iss:0}" - 0; break; case "chg": attmntAccess = "${ACCESS.FAC_chg:0}" - 0; break; // Custom - enable the Attachments tab on the Configuration Item detail form case "nr": attmntAccess = "${ACCESS.FAC_nr:0}" - 0; break; // End Custom }

2. Towards the end of the file, after

<PDM_ELIF "$prop.factory" == "iss"> att_tab_url += "+QBE.EQ.issues.iss.persistent_id=$args.persistent_id";

add the following code:

<PDM_ELIF "$prop.factory" == "nr"> att_tab_url += "+QBE.EQ.nrs.nr.id=$args.id";

Clear the SDM web cache

Clear the SDM Webengine web cache by executing 'pdm_webcache' in a command prompt on the SD primary server. This will incorporate the interface customizations done in the previous steps and show them in the SDM web client.

Retrieved from "http://www.servicedeskusers.com/Attachments_on_Configuration_Items_r12"

This page was last modified 14:36, 1 October 2013.  This page has been accessed 4,853 times.  Content is available under Attribution-Noncommercial-Share Alike 3.0 Unported.   Disclaimers         

Outcomes