Issue
Proper way to 'activate' portions of Personnel Import Utility (PIU) XSL files.
Product Line
Andover Continuum
Environment
CyberStation with PIU
Cause
Difficulty in getting transformation file to import records
Resolution
Transformation files used with the PIU are located in the \Continuum directory. These are XSL files and are built in a way that features are commented out in the file and those features can be 'activated' by uncommenting. XSL is a language for expressing style sheets. An XSL style sheet is a file that describes how to display an XML document of a given type.
When the XSL files are opened with Internet Explorer (IE) you see color-coding and bold text. The bold text is activated, the light grey is not. You can only view the code in IE, not edit it. Use an advanced text editor like Notepad ++ (https://notepad-plus-plus.org/) and you can easily see and edit the file to activate portions of it.
Note: Make sure when 'activating" the syntax option in the file by removing the leading - <!-- you also remove the trailing --> .
The following is what the file CSVToContinuumTransformation.xsl looks like.
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:TAC="http://www.tac.com/TAC"
extension-element-prefixes="msxsl"
exclude-result-prefixes="TAC">
<!--
- define the Javascript or C# or VBScript functions that you want to include within a msxsl:script element.
- language indicates the scripting language
- implements-prefix gives the namespace prefix that you declared for your function (i.e. TAC)
- Use the functions where ever you want. For example
<alias>
<xsl:value-of select="TAC:today()" />
</alias>
-->
<msxsl:script language="C#"
implements-prefix="TAC">
<!-- it's often helpful to use a CDATA section so you don't have to worry about escaping less-than signs or anything -->
<![CDATA[
public string today() {
return "abcdefs";
}
]]>
</msxsl:script>
<!--
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>-->
<xsl:template match="SourceUsers">
<SourceUsers>
<xsl:apply-templates select="SourceUser"/>
</SourceUsers>
</xsl:template>
<!-- Need to include only the mapped personnel attributes or if every thing everything is added remove the ones that are included below in XSLT tags-->
<xsl:template match="SourceUser">
<!-- You can declare variables, parameters -->
<xsl:param name="allPhoneNumbers" select="HomePhone"/>
<xsl:copy>
<xsl:copy-of select="ADA|Address|AllowEntEntEgr|Blood|CardNumber|CardType|City|Country|DateOfBirth|DefaultClearanceLevel|
Department|DepartmentCode|EmergencyContact|EmergencyPhone|EmpNumber|ExecutivePrivilege|ExpirationDate|EyeColor|
FirstName|HairColor|Height|HomePhone|Info1|Info2|Info3|Info4|Info5|Info6|JobTitle|LastName|LicenseNumber|
LostCard|MiddleName|NonABACardNumber|OfficeLocation|ParkingSticker|PIN|SecurityLevel|Sex|SiteCode|
SocSecNo|StateOfResidence|StartDate|Supervisor|VehicleInfo|Visitor|Weight|WorkPhone|Zip|FipsAgencyCode|FipsOrgId|
FipsSystemCode|FipsCredentialNumber|FipsCredentialSeries|FipsOrgId|FipsCredentialIssue|FipsOrgCategory|FipsPersonId|
FipsPersonOrgAssociation|FipsPivState|FipsPivControlled|FipsExpirationDate|PhotoFile|Signature|ResponseTransaction|State|FipsHmac"/>
<!--<Adding OwnerFolder to personnel object. This is must other wise it won't create or update any objects>-->
<OwnerFolder>Root\CardHolders</OwnerFolder>
<!--<Adding OwnerFolder to personnel object end>-->
<!--<Alias is necessary to create or update object and it should be unique in the system>-->
<Alias>
<!-- By default, we'll use the employeeNumber + samaccountname as an alias (16 chars max). -->
<!-- On newer systems, the logon name is userPrincipalName -->
<!-- One Way -->
<!-- <xsl:value-of select="concat(samaccountname,EmpNumber)"/> -->
<!--<xsl:value-of select="concat(FirstName,LastName)"/>-->
<!--In IDMS system Serial Number is a unique number. Use this as Alias added to a Character or
a group of characters to generate a valid alias. See the Example -->
<xsl:value-of select="concat(FirstName,LastName)"/>
<!--<xsl:choose>
<xsl:when test="string-length(EmpNumber)=0">
<xsl:value-of select="samaccountname"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat(LastName,EmpNumber)"/>
</xsl:otherwise>
</xsl:choose> -->
<!-- Other Ways -->
<!-- This option combines the last name and EmpNumber -->
<!--<xsl:value-of select="concat(substring(LastName,1,12),substring(EmpNumber,2,5))"/>-->
<!-- This option combines the EmpNumber last and first name from CyberStation -->
<!--<xsl:value-of select="concat(EmpNumber,FirstName,LastName)"/> -->
<!-- This option combines the last name and FirstName -->
<!--<xsl:value-of select="concat(LastName, FirstName)"/>-->
</Alias>
<!-- Example of using User defined functions -->
<!-- <alias>
<xsl:value-of select="TAC:today()" />
</alias>-->
<!--<Adding departmentcode DepartmentCode to personnel object if it contains only numbers>-->
<!--<<xsl:value-of select="number(department)"/>-->
<!--
<DepartmentCode><xsl:number value="Department" /></DepartmentCode>
-->
<!--<Adding CardType>-->
<!--<CardType>AC4plus432</CardType>-->
<!--<Adding SiteCode>-->
<!--<SiteCode>15</SiteCode>-->
<!--<Adding Signature, PhotoFile, FingerPrint use firstname.jpg or Lastname.jpg or Firstname+LastName.jpg. Use
the combination depending upon the jpg files stored on the hard drive. A few examples below >-->
<!--<Adding Signature>-->
<!--<Signature>D:\picsForSri\signatures\LISASIG.BMP</Signature>-->
<!--<Signature>
<xsl:value-of select="concat('D:\',FirstName,'.jpg')"/>
</Signature>-->
<!--<Signature>
<xsl:value-of select="concat('c:\',Lastname,'.jpg')"/>
</Signature>-->
<!--<Adding FingerPrint>-->
<!--<FingerPrint>D:\picsForSri\Fingerprints\Finger.jpg</FingerPrint>-->
<!--<Adding photofile>-->
<!--<PhotoFile>D:\picsForSri\pics\Elmer1.jpg</PhotoFile>-->
<!--Assigning default areas to the imported personnel-->
<!-- To implement Area Links, uncomment the section below before the <AreaLinks> tag and after the </AreaLinks> tag-->
<!-- To add more areas, copy the <AreaLink></AreaLink> tags and everything between them and paste after the first </AreaLink> tag-->
<!-- State can be Enabled or Disabled, Preload is Workstation Only and can be True or False, AreaId example - Root\MyPersonnelFolder. -->
<!-- This is line 1 of 2 to remove to implement Area Links
<AreaLinks>
<AreaLink>
<AreaId><![CDATA[Full Path To Area Here]]></AreaId>
<SchedId>Full Path To Schedule Here</SchedId>
<State>Enabled</State>
<Preload>False</Preload>
<ClearanceLevel>0</ClearanceLevel>
</AreaLink>
</AreaLinks>
This is line 2 of 2 to implement Area Links -->
<!--<Adding Templates to personnel object>-->
<!--<Adding Templates to personnel object with Department name>-->
<!--<RefTemplate>
<xsl:value-of select="concat('Root\Templates\Personnel Templates\', Department)"/>
</RefTemplate>-->
<!--<Adding Templates to personnel object based on department>-->
<!--<Can do the same way with departmentCode DepartmentCode>-->
<!--<xsl:value-of select=AreaTemplate1000/> same as <xsl:text>AreaTemplate1000</xsl:text>-->
<!--<RefTemplate>
<xsl:choose>
<xsl:when test="StateOfResidence='MA'">
<xsl:text>Root\Templates\Personnel Templates\AllAccess</xsl:text>
</xsl:when>
<xsl:when test="StateOfResidence='NY'">
<xsl:text>Root\Templates\Personnel Templates\PowerUser</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>Root\Templates\Personnel Templates\StandardUser</xsl:text>
</xsl:otherwise>
</xsl:choose>
</RefTemplate>-->
<!--<Adding one personnel Template to personnel object >-->
<!--<RefTemplate> Root\Templates\Personnel Templates\PT1</RefTemplate>-->
<!--Template>
<xsl:choose>
<xsl:when test="StateOfResidence='MA'">
<xsl:text>Root\Templates\Personnel Templates\All Access</xsl:text>
</xsl:when>
<xsl:when test="StateOfResidence='PA'">
<xsl:text>Root\Templates\Personnel Templates\Power User</xsl:text>
</xsl:when>
<xsl:when test="StateOfResidence='NY'">
<xsl:text>Root\Templates\Personnel Templates\Standard User</xsl:text>
</xsl:when>
</xsl:choose>
</RefTemplate>-->
<!--<Adding one personnel Template to personnel object >-->
<RefTemplate>Root\Templates\Personnel Templates\Standard User</RefTemplate>-->
<!-- Manipulate states-->
<!-- If the attribute is using here don't add it at the <xsl:copy-of select-->
<!--
<StateOfResidence>
<xsl:choose>
<xsl:when test="StateOfResidence='Massachusetts'">
<xsl:text>MA</xsl:text>
</xsl:when>
<xsl:when test="StateOfResidence='New Hampshire'">
<xsl:text>NH</xsl:text>
</xsl:when>
<xsl:when test="StateOfResidence='Washington DC'">
<xsl:text>DC</xsl:text>
</xsl:when>
<xsl:when test="StateOfResidence='Connecticut'">
<xsl:text>CT</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="StateOfResidence"/>
</xsl:otherwise>
</xsl:choose>
</StateOfResidence>-->
<!-- Manipulate phone numbers-->
<!--</telephonenumberFormat>-->
<!--
<WorkPhone>
<xsl:choose>
<xsl:when test="contains(WorkPhone,'-')">
<xsl:value-of select="WorkPhone"/>
</xsl:when>
<xsl:when test="string-length(WorkPhone)=0">
<xsl:value-of select="WorkPhone"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat(substring(WorkPhone,1,3),'-',substring(WorkPhone,4,3),'-',substring(WorkPhone,7,4))"/>
</xsl:otherwise>
</xsl:choose>
</WorkPhone>
-->
<!--Replacing the linefeed in the adress -->
<!-- Unicode of linefeed 
 (is line break \n), Unicode of tab 	-->
<!-- <xsl:value-of select="translate(Address, '\n', ' ')"/> Won't work -->
<!--
<Address>
<xsl:value-of select="translate(Address, '
', ' ')"/>
</Address> -->
<!--************************************************************** -->
<!--These are the examples of how to parse Multi valued Active Directory attributes after mapping them to Continuum attributes -->
<!-- Use Continuum attributes names instead of these dummy attribute names, variables names can be at as your wish -->
<!-- This example takes the first element from the list, it shows the use of a variable -->
<!--<HomePhone>
<xsl:variable name="phoneNumbers" select='HomePhone'/>
<xsl:value-of select="substring-before($phoneNumbers, ',')"/>
</HomePhone>-->
<!-- This example takes the second element from the list. -->
<!-- It uses a param at the top of the file. after the line <xsl:template match="SourceUser">-->
<!--Or use a local variable between phone2 tags<xsl:variable name="allPhoneNumbers" select='HomePhone'/>-->
<!--
<Phone2>
<xsl:variable name="after-first-comma" select='substring-after($allPhoneNumbers,",")'/>
<xsl:variable name="second-comma" select='substring-before($after-first-comma,",")'/>
<xsl:value-of select="$second-comma"/>
</Phone2>
-->
<!-- This example outputs a xml tag if the element exists in the list -->
<!--
<memberOf>
<xsl:variable name="memberGroups" select="memberOf"/>
<xsl:if test="contains($memberGroups, 'Engineering')">
Engineering Lab1
</xsl:if>
</memberOf>
-->
<!--************************************************************** -->
</xsl:copy>
</xsl:template>
</xsl:stylesheet>