User Tools

Site Tools


playground:mavis-samma_integration

MAVIS-SAMMA Integration

by ʻUluʻulu : The Henry Kuʻualoha Giugni Moving Image Archive of Hawaiʻi

ʻUluʻulu uses SAMMA machinery and software for physical inspection of video tapes, and the cleaning and migration of 3/4“ U-matic video tapes. We use xml files and csv files for integrating metadata created by SAMMA processes into MAVIS. What follows is a summary of our workflow as it pertains to MAVIS-SAMMA integration. [see appendix for workflow diagram]

Accessioning

The first thing we do is accession our video tapes, and add basic metadata for each tape. This is done on a MAVIS Workstation, with metadata entered manually through MAVIS Client. As each carrier is created, we paste the carrier item id number into our label printing software, print out an item id label, and put this on the video tape container. When all of the tapes have been accessioned, we export the item list out of MAVIS Client. [see appendix for flowchart, export stylesheet]

Importing .csv file into SAMMA Prep

At this point, we have a comma-separated values file with the following fields to be imported into the SAMMA Prep software:

tapeid^video_standard^tape_format^stocklength^tapeid_sequence^location^description^author^comments^output_filename

Change encoding of .csv file

We need to change the encoding of the .csv file to UTF-8, so that it will be read correctly by the SAMMA software.

Log into SAMMA Prep

Since we use a Virtual Private Network (VPN) connection to access our MAVIS database, we need to log out of MAVIS Client and disconnect from the VPN before starting the SAMMA Prep software. This is because the Prep software needs to connect to the main SAMMA database, which is on a computer on our local network, which becomes unreachable when our workstation is logged into the VPN. After disconnecting from the VPN, we open the SAMMA Prep software log in.

Import file

SAMMA Prep has a CSV Import tool. We open this tool, load the .csv file, and import the data into the SAMMA database.

Input metadata into online spreadsheet

At this stage, we also input metadata into an online spreadsheet that is accessible to all staff that needs to manipulate its data. These spreadsheets will be imported into MAVIS further down in the workflow. We currently use Google Docs. Which spreadsheet we use depends on the format of the video tape and how it is destined to be migrated. The main options are the SAMMA post-migration spreadsheet, the Migrating with Final Cut Pro spreadsheet, and the Outside Vendor spreadsheet.

For video tapes to be migrated with the SAMMA Solo, we open the .csv file as a spreadsheet and paste the tape ids and file names into our sammaPostMigrationMetadata online spreadsheet. This gives our media specialist a list of everything to be migrated with SAMMA, and a place to add metadata that is not automatically created by SAMMA during the migration process.

Mark .csv file as Imported

We then move the .csv file into a folder that lets us know that it has already been imported into SAMMA Prep.

Physical Inspection

At this point, the video tapes we accessioned should exist in the SAMMA database. The next step is going through the SAMMA Prep process, which entails physically inspecting the item and printing out SAMMA barcodes. This is currently done on our SAMMA Laptop Workstation, using SAMMA Prep software. After physically inspecting the video tape, committing the record, and printing/attaching the barcodes, we need to create an xml file. This is not created automatically during the Prep process. We need to re-open the recently committed record, go to the Finish tab, and Save As an .xml file. The correct file name needs to be entered by the operator.

Importing Prep XML into MAVIS

After a tape has been physically inspected at the Physical Inspection Station, an xml record should exist on the SAMMA Laptop Workstation. These xml files should be copied onto a MAVIS Workstation on a regular weekly basis and uploaded into MAVIS.

Retrieve XML files

We currently transfer the xml files through our local network, using the Windows file browser on the MAVIS Workstation (although the visibility and accessibility of networked computers is a bit inconsistent). So the file transfer process is basically a drag and drop procedure. After a file has been transferred to the MAVIS Workstation, the file on the SAMMA Laptop Workstation is moved into a special folder marking it as having been moved to the MAVIS Workstation.

Import XML files

We then open MAVIS Client on the MAVIS Workstation, and import the xml file using a special stylesheet. This creates a treatment record and condition notes for each video tape carrier, using the physical inspection categories and values from SAMMA Prep. [see appendix for stylesheet]

END OF SAMMA Integration Procedures for NON-U-matic VIDEO TAPES

SAMMA Clean

We have a 3/4” U-matic SAMMA Clean machine. For these tapes, the next step in the process is cleaning. The cleaning process is done on the SAMMA Laptop Workstation, using the SAMMA Clean software. A clean.xml file is automatically created during the cleaning process. We then import this file into MAVIS.

Importing Clean XML into MAVIS

This process is similar to the Prep process, however, it is slightly different because the Clean process also creates a clean.pdf file for each tape. So first, we copy the clean XML files onto the MAVIS Workstation computer. Next, we back up the clean.pdf files on our servers. After that, we import the XML file, using MAVIS Client. This creates a clean treatment record and a reference material (pointing to the location of the clean pdf) for each video tape carrier. [see appendix for stylesheet]

SAMMA Migration

The next step for 3/4“ tapes is their digitization. This occurs at our SAMMA Solo Workstation, using SAMMA Solo software. The relevant part of this workflow is the SAMMA operator entering their MAVIS name ID number in the SAMMA record's “Migrated By” section. Each SAMMA video tape record already has the MAVIS information that was imported into the SAMMA database during the SAMMA Prep stage. An XML file is automatically created during the migration (along with the digital video files and a PDF file).

Post-Migration Procedures

Entering metadata in online spreadsheet

There is certain information that we want to attach to the created files that is not included in the Solo XML file. For this we use our sammaPostMigrationMetadata online spreadsheet. We have fields for color type and audio information, examiner notes, examiner user name, and checksum. This is all input during our QC process.

Backing up files on Servers

After running and recording checksum information, we back up our files on our servers.

Importing Solo XML files into MAVIS

After backing up the media files, we are ready to import the Solo XML files.

Retrieve XML files

We retrieve the XML files created during the SAMMA Solo migration using Filezilla, since, in addition to housing the SAMMA database, the Solo computer also has an FTP Server. On the MAVIS Workstation, we connect to the ftp server (must be disconnected from the VPN first) and download the Solo XML files.

Import files

This is done on the MAVIS Workstation, using MAVIS Client. This import creates Digital Components and copied from info for each file created with the SAMMA Solo. [see appendix for stylesheet]

Importing post-Migration Metadata into MAVIS

Add MAVIS item numbers to the online Spreadsheet

Before importing the metadata that was added to the sammaPostMigrationMetadata spreadsheet, we need to add MAVIS item numbers, so that the data gets attached to the correct records. We need to retrieve the component and carrier item ids for the items that were just created during the Solo XML import. We get these numbers through a MAVIS Client export from an items list window. [see appendix for stylesheet] We then open up the exported file and copy and paste numbers into their proper locations in the online spreadsheet.

Proofread Data

Then we proofread the data.

Import Data

Convert to .csv file

First we download the online spreadsheet as an OpenOffice spreadsheet. Then we open the file and clean it up, getting rid of extraneous rows. Then we save it as a .csv file with the proper delimiters.

Import into MAVIS

This is done on the MAVIS Workstation, using MAVIS Client. We choose the .csv file and use the convert delimited file option. This import adds checksum info and the examiner notes to the recently created items. [see appendix for stylesheet]

Other Things

Something to keep in mind is that every time we make a change in SAMMA configuration, we need to change MAVIS codes and import stylesheets. And procedures get slightly more complicated when multiple SAMMA profiles (PRJ's and SXT's) are being used.

Conclusion

Anyway, that is the end of our MAVIS-SAMMA integration procedures. We start in MAVIS, export data to be imported into SAMMA Prep. In MAVIS, we import XML files from SAMMA Prep, Clean, and Solo. We export data from MAVIS to be input into an online spreadsheet. We then import this spreadsheet as a CSV file back into MAVIS. And that is that. More detailed workflows can be provided upon request.

Appendix A: Diagrams

Overall Workflow

Accessioning

Appendix B: Stylesheets

Export for SAMMA Prep Stylesheet

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet

	version="1.0"

	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

	xmlns:fo="http://www.w3.org/1999/XSL/Format"

	xmlns:xl="http://www.w3.org/TR/xlink"

	xmlns:mv="http://www.wizardis.com.au/2005/12/MAVIS">

<!-- 

   Create SAMMA Prep CSV



   Modification History

   ********************

   13/12/10  FLS ????????   Created

   21/12/10  JRR ????????   Modified - took out first ^

   07/01/11  JRR ????????   Modified - deleted umid,cleaned,MigrationProfile

   07/01/11  JRR ????????   Modified - changed tapeid to map to mv:itemId, not mv:rackNo

   11/01/11  JRR ????????   Modified - added rack number to end of location field; added rackNo variable

   11/01/11  JRR ????????   Modified - deleted variables cleaned,profile

   17/02/11  JRR ????????   Modified - added acquisition source as author

   18/02/11  JRR ????????   Modified - added collection number to file name; changed output filename

   20/07/11  JRR ????????   Modified - changed description field from xl:title to ../../mv:itemDescr

   tapeid^video_standard^tape_format^stocklength^tapeid_sequence^location^description^author^comments^output_filename



-->

	<xsl:output method="text"/>

	<xsl:variable name="cr" select="'&#xA;'"/>

	<xsl:variable name="delim" select="'^'"/>

	<xsl:variable name="ofComponent" select="' of component '"/>

	<xsl:variable name="rackNo" select="' : '"/>

	<xsl:variable name="collection" select="'c'"/>

	<xsl:variable name="underscore" select="'_'"/>





<xsl:template match="mv:mavis">tapeid^video_standard^tape_format^stocklength^tapeid_sequence^location^description^author^comments^output_filename

<xsl:for-each select="//mv:VideoTapeCarrier">

		<xsl:value-of select="mv:itemId"/><xsl:value-of select="$delim"/>

		<xsl:value-of select="../../mv:videoMode"/><xsl:value-of select="$delim"/>

		<xsl:value-of select="../../mv:techCode/@xl:title"/><xsl:value-of select="$delim"/>

		<xsl:value-of select="../../mv:stockLength"/><xsl:value-of select="$delim"/>

		<xsl:value-of select="mv:carrierNo"/><xsl:value-of select="$ofComponent"/><xsl:value-of select="substring-after(mv:component/@xl:href,'/VideoTapeComponent/key/')"/><xsl:value-of select="$delim"/>

		<xsl:choose>

			<xsl:when test="mv:currentLocation"><xsl:value-of select="mv:currentLocation"/></xsl:when>

			<xsl:when test="mv:permanentLocation"><xsl:value-of select="mv:permanentLocation"/></xsl:when>

		</xsl:choose><xsl:value-of select="$rackNo"/><xsl:value-of select="mv:rackNo"/><xsl:value-of select="$delim"/>

		<xsl:value-of select="../../mv:itemDescr"/><xsl:value-of select="$delim"/>

		<xsl:value-of select="../../mv:source/@xl:title"/><xsl:value-of select="$delim"/>

		<xsl:value-of select="mv:notes"/><xsl:value-of select="$delim"/>

		<xsl:value-of select="$collection"/><xsl:value-of select="substring-after(../../mv:collection/@xl:href,'/Collection/key/')"/><xsl:value-of select="$underscore"/><xsl:value-of select="mv:itemId"/><xsl:value-of select="$delim"/>

		<xsl:value-of select="$cr"/>

	</xsl:for-each>

</xsl:template>



</xsl:stylesheet>

Import from SAMMA Prep Stylesheet

<?xml version="1.0" encoding="ISO-8859-13"?>

<xsl:stylesheet

	version="1.0"

	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

	xmlns:xl="http://www.w3.org/TR/xlink"

	xmlns="http://www.wizardis.com.au/2005/12/MAVIS">

<!-- 

   Add carrier conditions to a video, using SammaPrep xml

   Modification History

   ********************

   13/12/10  FLS ????????   Created

   18/02/11  JRR ????????   Modified: added Odor, changed numbers

   22/02/11  JRR ????????   Modified: added DamagedShell, TapeTorn, Dirt, Cinching, LooseWind, TapeWarping, PowderyResidue, LiquidStaining, SpokingPopping

   08/03/11  JRR ????????   Modified: added treatments; added assessedBy parameter to conditions

   27/04/11  JRR ????????   Modified: updated criteria numbers to match Samma Prep; added comments to treatment summary

   27/01/12  JRR ????????   Modified: added examined by prepOperator and prepTime to be included in carrier general tab; added entered date into carrier treatment; changed performedBy to prepOperator; added entered date into carrier conditions; changed assessedBY to prepOperator





-->

<xsl:output encoding="ISO-8859-13" indent="yes"/>



<xsl:variable name="passed" select="'Passed Inspection. '"/>

<xsl:variable name="notpassed" select="'Did not pass Inspection. '"/>



<xsl:template match="SAMMAPrep">

	<mavis>

	

	<xsl:for-each select="//Tape">

		<xsl:if test="Details/UMID">

			<VideoTapeCarrier><xsl:attribute name="xl:href">/VideoTapeCarrier/key/<xsl:value-of select="Details/UMID"/></xsl:attribute>

				<whoExamined><xsl:value-of select="Details/PrepOperator"/></whoExamined>

				<!--<examinedDate><xsl:value-of select="substring(Details/PrepTime, 6, 2)"/>/<xsl:value-of select="substring(Details/PrepTime, 9, 2)"/>/<xsl:value-of select="substring(Details/PrepTime, 1, 4)"/></examinedDate>-->

				<examinedDate><xsl:value-of select="substring(Details/PrepTime, 1, 10)"/></examinedDate>

				<treatments>

					<xsl:call-template name="addTreatment">

						<xsl:with-param name="treatmentCode">PE</xsl:with-param>

						<xsl:with-param name="treatmentLocation">I</xsl:with-param>

						<xsl:with-param name="summary">

							<xsl:choose>

								<xsl:when test="Results/PassedInspection = 1"><xsl:value-of select="$passed"/><xsl:value-of select="Results/Comments"/></xsl:when>

								<xsl:otherwise><xsl:value-of select="$notpassed"/><xsl:value-of select="Results/Comments"/></xsl:otherwise>

							</xsl:choose>

						</xsl:with-param>

						<xsl:with-param name="performedBy">

							<xsl:value-of select="Details/PrepOperator"/>

						</xsl:with-param>

						<xsl:with-param name="enteredDate">

							<xsl:value-of select="Details/PrepTime"/>

						</xsl:with-param>

					</xsl:call-template>

				</treatments>

				<conditions>

					<xsl:if test="Results/Odor">

						<xsl:call-template name="addCondition">

							<xsl:with-param name="conditionCode">OD</xsl:with-param>

							<xsl:with-param name="conditionDegree">

								<xsl:choose>

									<xsl:when test="Results/Odor = 0">0</xsl:when>

									<xsl:when test="Results/Odor = 2">3</xsl:when>

									<xsl:otherwise>2</xsl:otherwise>

								</xsl:choose>	

							</xsl:with-param>

							<xsl:with-param name="assessedBy"><xsl:value-of select="Details/PrepOperator"/></xsl:with-param>

							<xsl:with-param name="enteredDate"><xsl:value-of select="Details/PrepTime"/></xsl:with-param>	

						</xsl:call-template>

					</xsl:if>

					<xsl:if test="Results/Mold">

						<xsl:call-template name="addCondition">

							<xsl:with-param name="conditionCode">MO</xsl:with-param>

							<xsl:with-param name="conditionDegree">

								<xsl:choose>

									<xsl:when test="Results/Mold = 0">0</xsl:when>

									<xsl:when test="Results/Mold = 4">3</xsl:when>

									<xsl:otherwise>2</xsl:otherwise>

								</xsl:choose>	

							</xsl:with-param>

							<xsl:with-param name="assessedBy"><xsl:value-of select="Details/PrepOperator"/></xsl:with-param>

							<xsl:with-param name="enteredDate"><xsl:value-of select="Details/PrepTime"/></xsl:with-param>	

						</xsl:call-template>

					</xsl:if>

					<xsl:if test="Results/DamagedShell">

						<xsl:call-template name="addCondition">

							<xsl:with-param name="conditionCode">DS</xsl:with-param>

							<xsl:with-param name="conditionDegree">

								<xsl:choose>

									<xsl:when test="Results/DamagedShell = 5">3</xsl:when>

									<xsl:otherwise>0</xsl:otherwise>

								</xsl:choose>	

							</xsl:with-param>

							<xsl:with-param name="assessedBy"><xsl:value-of select="Details/PrepOperator"/></xsl:with-param>

							<xsl:with-param name="enteredDate"><xsl:value-of select="Details/PrepTime"/></xsl:with-param>	

						</xsl:call-template>

					</xsl:if>

					<xsl:if test="Results/TapeTorn">

						<xsl:call-template name="addCondition">

							<xsl:with-param name="conditionCode">TT</xsl:with-param>

							<xsl:with-param name="conditionDegree">

								<xsl:choose>

									<xsl:when test="Results/TapeTorn = 6">3</xsl:when>

									<xsl:otherwise>0</xsl:otherwise>

								</xsl:choose>	

							</xsl:with-param>

							<xsl:with-param name="assessedBy"><xsl:value-of select="Details/PrepOperator"/></xsl:with-param>

							<xsl:with-param name="enteredDate"><xsl:value-of select="Details/PrepTime"/></xsl:with-param>	

						</xsl:call-template>

					</xsl:if>

					<xsl:if test="Results/Dirt">

						<xsl:call-template name="addCondition">

							<xsl:with-param name="conditionCode">DI</xsl:with-param>

							<xsl:with-param name="conditionDegree">

								<xsl:choose>

									<xsl:when test="Results/Dirt = 0">0</xsl:when>

									<xsl:when test="Results/Dirt = 9">3</xsl:when>

									<xsl:when test="Results/Dirt = 8">2</xsl:when>

									<xsl:otherwise>1</xsl:otherwise>

								</xsl:choose>	

							</xsl:with-param>

							<xsl:with-param name="assessedBy"><xsl:value-of select="Details/PrepOperator"/></xsl:with-param>

							<xsl:with-param name="enteredDate"><xsl:value-of select="Details/PrepTime"/></xsl:with-param>

						</xsl:call-template>

					</xsl:if>

					<xsl:if test="Results/Cinching">

						<xsl:call-template name="addCondition">

							<xsl:with-param name="conditionCode">CI</xsl:with-param>

							<xsl:with-param name="conditionDegree">

								<xsl:choose>

									<xsl:when test="Results/Cinching = 10">2</xsl:when>

									<xsl:otherwise>0</xsl:otherwise>

								</xsl:choose>	

							</xsl:with-param>

							<xsl:with-param name="assessedBy"><xsl:value-of select="Details/PrepOperator"/></xsl:with-param>

							<xsl:with-param name="enteredDate"><xsl:value-of select="Details/PrepTime"/></xsl:with-param>	

						</xsl:call-template>

					</xsl:if>

					<xsl:if test="Results/LooseWind">

						<xsl:call-template name="addCondition">

							<xsl:with-param name="conditionCode">LW</xsl:with-param>

							<xsl:with-param name="conditionDegree">

								<xsl:choose>

									<xsl:when test="Results/LooseWind = 0">0</xsl:when>

									<xsl:when test="Results/LooseWind = 12">3</xsl:when>

									<xsl:otherwise>2</xsl:otherwise>

								</xsl:choose>	

							</xsl:with-param>

							<xsl:with-param name="assessedBy"><xsl:value-of select="Details/PrepOperator"/></xsl:with-param>

							<xsl:with-param name="enteredDate"><xsl:value-of select="Details/PrepTime"/></xsl:with-param>	

						</xsl:call-template>

					</xsl:if>

					<xsl:if test="Results/EdgeDamage">

						<xsl:call-template name="addCondition">

							<xsl:with-param name="conditionCode">ED</xsl:with-param>

							<xsl:with-param name="conditionDegree">

								<xsl:choose>

									<xsl:when test="Results/EdgeDamage = 0">0</xsl:when>

									<xsl:when test="Results/EdgeDamage = 14">2</xsl:when>

									<xsl:when test="Results/EdgeDamage = 15">3</xsl:when>

									<xsl:otherwise>1</xsl:otherwise>

								</xsl:choose>	

							</xsl:with-param>

							<xsl:with-param name="assessedBy"><xsl:value-of select="Details/PrepOperator"/></xsl:with-param>

							<xsl:with-param name="enteredDate"><xsl:value-of select="Details/PrepTime"/></xsl:with-param>	

						</xsl:call-template>

					</xsl:if>

					<xsl:if test="Results/TapeWarping">

						<xsl:call-template name="addCondition">

							<xsl:with-param name="conditionCode">TW</xsl:with-param>

							<xsl:with-param name="conditionDegree">

								<xsl:choose>

									<xsl:when test="Results/TapeWarping = 0">0</xsl:when>

									<xsl:when test="Results/TapeWarping = 17">3</xsl:when>

									<xsl:otherwise>2</xsl:otherwise>

								</xsl:choose>	

							</xsl:with-param>

							<xsl:with-param name="assessedBy"><xsl:value-of select="Details/PrepOperator"/></xsl:with-param>

							<xsl:with-param name="enteredDate"><xsl:value-of select="Details/PrepTime"/></xsl:with-param>	

						</xsl:call-template>

					</xsl:if>

					<xsl:if test="Results/PowderyResidue">

						<xsl:call-template name="addCondition">

							<xsl:with-param name="conditionCode">PR</xsl:with-param>

							<xsl:with-param name="conditionDegree">

								<xsl:choose>

									<xsl:when test="Results/PowderyResidue = 0">0</xsl:when>

									<xsl:when test="Results/PowderyResidue = 19">2</xsl:when>

									<xsl:when test="Results/PowderyResidue = 20">3</xsl:when>

									<xsl:otherwise>1</xsl:otherwise>

								</xsl:choose>	

							</xsl:with-param>

							<xsl:with-param name="assessedBy"><xsl:value-of select="Details/PrepOperator"/></xsl:with-param>

							<xsl:with-param name="enteredDate"><xsl:value-of select="Details/PrepTime"/></xsl:with-param>	

						</xsl:call-template>

					</xsl:if>

					<xsl:if test="Results/LiquidStaining">

						<xsl:call-template name="addCondition">

							<xsl:with-param name="conditionCode">LS</xsl:with-param>

							<xsl:with-param name="conditionDegree">

								<xsl:choose>

									<xsl:when test="Results/LiquidStaining = 0">0</xsl:when>

									<xsl:when test="Results/LiquidStaining = 22">2</xsl:when>

									<xsl:when test="Results/LiquidStaining = 23">3</xsl:when>

									<xsl:otherwise>1</xsl:otherwise>

								</xsl:choose>	

							</xsl:with-param>

							<xsl:with-param name="assessedBy"><xsl:value-of select="Details/PrepOperator"/></xsl:with-param>

							<xsl:with-param name="enteredDate"><xsl:value-of select="Details/PrepTime"/></xsl:with-param>	

						</xsl:call-template>

					</xsl:if>

					<xsl:if test="Results/SpokingPopping">

						<xsl:call-template name="addCondition">

							<xsl:with-param name="conditionCode">SP</xsl:with-param>

							<xsl:with-param name="conditionDegree">

								<xsl:choose>

									<xsl:when test="Results/SpokingPopping = 0">0</xsl:when>

									<xsl:when test="Results/SpokingPopping = 25">2</xsl:when>

									<xsl:when test="Results/SpokingPopping = 26">3</xsl:when>

									<xsl:otherwise>1</xsl:otherwise>

								</xsl:choose>	

							</xsl:with-param>

							<xsl:with-param name="assessedBy"><xsl:value-of select="Details/PrepOperator"/></xsl:with-param>

							<xsl:with-param name="enteredDate"><xsl:value-of select="Details/PrepTime"/></xsl:with-param>	

						</xsl:call-template>

					</xsl:if>

				</conditions>

			</VideoTapeCarrier>

		</xsl:if>

	</xsl:for-each>

	</mavis>

</xsl:template>



<xsl:template match="*">

	<!-- Do not output anything except what's in the "SAMMAPrep" template -->

</xsl:template>



<xsl:template name="addTreatment">

	<xsl:param name="treatmentCode"/>

	<xsl:param name="treatmentLocation"/>

	<xsl:param name="summary"/>

	<xsl:param name="performedBy"/>

	<xsl:param name="enteredDate"/>

		<CarrierTreatment>

			<treatmentCode><xsl:value-of select="$treatmentCode"/></treatmentCode>

			<treatmentLocation><xsl:value-of select="$treatmentLocation"/></treatmentLocation>

			<summary><xsl:value-of select="$summary"/></summary>

			<performedBy><xsl:value-of select="$performedBy"/></performedBy>

			<enteredDate><xsl:value-of select="substring($enteredDate, 6, 2)"/>/<xsl:value-of select="substring($enteredDate, 9, 2)"/>/<xsl:value-of select="substring($enteredDate, 1, 4)"/> - <xsl:choose><xsl:when test="substring($enteredDate, 12, 2) &gt; 12"><xsl:value-of select="substring($enteredDate, 12, 2) - 12"/>:<xsl:value-of select="substring($enteredDate, 15, 2)"/>:<xsl:value-of select="substring($enteredDate, 18, 2)"/> PM</xsl:when><xsl:when test="substring($enteredDate, 12, 2) = '12'">12:<xsl:value-of select="substring($enteredDate, 15, 2)"/>:<xsl:value-of select="substring($enteredDate, 18, 2)"/> PM</xsl:when><xsl:when test="substring($enteredDate, 12, 2) = '00'">12:<xsl:value-of select="substring($enteredDate, 15, 2)"/>:<xsl:value-of select="substring($enteredDate, 18, 2)"/> AM</xsl:when><xsl:otherwise><xsl:value-of select="substring($enteredDate, 12, 2)"/>:<xsl:value-of select="substring($enteredDate, 15, 2)"/>:<xsl:value-of select="substring($enteredDate, 18, 2)"/> AM</xsl:otherwise></xsl:choose></enteredDate>

		</CarrierTreatment>

		

</xsl:template>



<xsl:template name="addCondition">

	<xsl:param name="conditionCode"/>

	<xsl:param name="conditionDegree"/>

	<xsl:param name="assessedBy"/>

	<xsl:param name="enteredDate"/>

		<CarrierCondition>

			<conditionCode><xsl:value-of select="$conditionCode"/></conditionCode>

			<conditionDegree><xsl:value-of select="$conditionDegree"/></conditionDegree>

			<assessedBy><xsl:value-of select="$assessedBy"/></assessedBy>

			<enteredDate><xsl:value-of select="substring($enteredDate, 6, 2)"/>/<xsl:value-of select="substring($enteredDate, 9, 2)"/>/<xsl:value-of select="substring($enteredDate, 1, 4)"/> - <xsl:choose><xsl:when test="substring($enteredDate, 12, 2) &gt; 12"><xsl:value-of select="substring($enteredDate, 12, 2) - 12"/>:<xsl:value-of select="substring($enteredDate, 15, 2)"/>:<xsl:value-of select="substring($enteredDate, 18, 2)"/> PM</xsl:when><xsl:when test="substring($enteredDate, 12, 2) = '12'">12:<xsl:value-of select="substring($enteredDate, 15, 2)"/>:<xsl:value-of select="substring($enteredDate, 18, 2)"/> PM</xsl:when><xsl:when test="substring($enteredDate, 12, 2) = '00'">12:<xsl:value-of select="substring($enteredDate, 15, 2)"/>:<xsl:value-of select="substring($enteredDate, 18, 2)"/> AM</xsl:when><xsl:otherwise><xsl:value-of select="substring($enteredDate, 12, 2)"/>:<xsl:value-of select="substring($enteredDate, 15, 2)"/>:<xsl:value-of select="substring($enteredDate, 18, 2)"/> AM</xsl:otherwise></xsl:choose></enteredDate>

		</CarrierCondition>

</xsl:template>



</xsl:stylesheet>

Import from SAMMA Clean Stylesheet

<?xml version="1.0" encoding="ISO-8859-13"?>

<xsl:stylesheet

	version="1.0"

	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

	xmlns:xl="http://www.w3.org/TR/xlink"

	xmlns="http://www.wizardis.com.au/2005/12/MAVIS">

<!-- 

   Add treatment to video carrier, using SammaClean xml

   Modification History

   ********************

   24/02/11  JRR ????????   Created

   10/03/11  JRR ????????   Modified: added reference material template

   17/03/11  JRR ????????   Modified: made enteredDate format conversion

   24/05/11  JRR ????????   Modified: changed ref material to url, added url variable

   31/10/11  JRR ????????   Modified: added <isOlcDisplay>Y</isOlcDisplay> to reference material



To do: Maybe want to add url prefix to ini file so that if it changes, each resource id does not have to be redone (this might mean the resource id type would be path/filename) 

-->



<xsl:output encoding="ISO-8859-13" indent="yes"/>



<xsl:variable name="cleaner" select="'CLEAN'"/>

<xsl:variable name="qf" select="' Quality Factor: '"/>

<xsl:variable name="url" select="'http://serverurl/metadata/'"/>

<xsl:variable name="cleanPDF" select="'_clean.pdf'"/>



<xsl:template match="SammaCleaner">

	<mavis>

	

	<xsl:for-each select="//Tape">

		<xsl:if test="Results/TapeId">

			<VideoTapeCarrier><xsl:attribute name="xl:href">/VideoTapeCarrier/key/<xsl:value-of select="Results/TapeId"/></xsl:attribute>

				<treatments>

					<xsl:call-template name="addTreatment">

						<xsl:with-param name="treatmentCode">CR</xsl:with-param>

						<xsl:with-param name="treatmentLocation">I</xsl:with-param>

						<xsl:with-param name="summary">

							<xsl:value-of select="Results/CleanedResult"/>

							<xsl:value-of select="$qf"/><xsl:value-of select="Results/QualityFactor"/>

						</xsl:with-param>

						<xsl:with-param name="performedBy">

							<xsl:value-of select="$cleaner"/>

						</xsl:with-param>

						<xsl:with-param name="enteredDate">

							<xsl:value-of select="//Results/CleanedDateTime"/>

						</xsl:with-param>

					</xsl:call-template>

				</treatments>

				<xsl:call-template name="referenceMaterial"/>

			</VideoTapeCarrier>

		</xsl:if>

	</xsl:for-each>



	</mavis>

</xsl:template>



<xsl:template match="*">

	<!-- Do not output anything except what's in the "SammaCleaner" template -->

</xsl:template>



<xsl:template name="addTreatment">

	<xsl:param name="treatmentCode"/>

	<xsl:param name="treatmentLocation"/>

	<xsl:param name="summary"/>

	<xsl:param name="performedBy"/>

	<xsl:param name="enteredDate"/>

		<CarrierTreatment>

			<treatmentCode><xsl:value-of select="$treatmentCode"/></treatmentCode>

			<treatmentLocation><xsl:value-of select="$treatmentLocation"/></treatmentLocation>

			<summary><xsl:value-of select="$summary"/></summary>

			<performedBy><xsl:value-of select="$performedBy"/></performedBy>

			<enteredDate><xsl:value-of select="substring($enteredDate, 6, 2)"/>/<xsl:value-of select="substring($enteredDate, 9, 2)"/>/<xsl:value-of select="substring($enteredDate, 1, 4)"/> - <xsl:choose><xsl:when test="substring($enteredDate, 12, 2) &gt; 12"><xsl:value-of select="substring($enteredDate, 12, 2) - 12"/>:<xsl:value-of select="substring($enteredDate, 15, 2)"/>:<xsl:value-of select="substring($enteredDate, 18, 2)"/> PM</xsl:when><xsl:when test="substring($enteredDate, 12, 2) = '12'">12:<xsl:value-of select="substring($enteredDate, 15, 2)"/>:<xsl:value-of select="substring($enteredDate, 18, 2)"/> PM</xsl:when><xsl:when test="substring($enteredDate, 12, 2) = '00'">12:<xsl:value-of select="substring($enteredDate, 15, 2)"/>:<xsl:value-of select="substring($enteredDate, 18, 2)"/> AM</xsl:when><xsl:otherwise><xsl:value-of select="substring($enteredDate, 12, 2)"/>:<xsl:value-of select="substring($enteredDate, 15, 2)"/>:<xsl:value-of select="substring($enteredDate, 18, 2)"/> AM</xsl:otherwise></xsl:choose></enteredDate>

		</CarrierTreatment>

		

</xsl:template>



<xsl:template name="referenceMaterial">

	<objectReferenceMaterials>

		<ObjectReferenceMaterial>

			<referenceMaterialType>SC</referenceMaterialType>

			<isOlcDisplay>Y</isOlcDisplay>

			<objectResourceIdentifiers>

				<ResourceIdentifier>

					<resourceIdentifier>

						<xsl:value-of select="$url"/>

						<xsl:value-of select="Results/Filename"/>

						<xsl:value-of select="$cleanPDF"/>

					</resourceIdentifier>

					<resourceIdentifierType>URL</resourceIdentifierType>

				</ResourceIdentifier>

			</objectResourceIdentifiers>

		</ObjectReferenceMaterial>

	</objectReferenceMaterials>

</xsl:template>



</xsl:stylesheet>

Import from SAMMA Solo Stylesheet

<?xml version="1.0" encoding="ISO-8859-13"?>

<xsl:stylesheet

	version="1.0"

	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

	xmlns:xl="http://www.w3.org/TR/xlink"

	xmlns="http://www.wizardis.com.au/2005/12/MAVIS">

<!-- 

   Add digital files to a video, using SammaSolo xml

   Modification History

   ********************

   17/07/11  JRR ????????   Copied from sammaSolo_8bitMOV_DV_wmv_mov_flv.xsl

   21/07/11  JRR ????????   Modified: got rid of extra tabs in reference material

   14/10/11  JRR ????????   Modified: added Duration entry into seconds field

   27/10/11  JRR ????????   Modified: added Duration for videoTapeCarrier

   31/10/11  JRR ????????   Modified: added <isOlcDisplay>Y</isOlcDisplay> to reference material

   10/07/12  JRR ????????   Modified: changed INT file Sound Field from Mono to Stereo; changed software used to current Samma Solo version SS431

   18/07/12  JRR ????????   Modified: added imported from field, value SAMMA





NOTE: must update preservation folder number as it changes - current is preservation03

This style sheet is CURRENT

Use this stylesheet for the following prj files:

HKG Umatic Uncompressed_dv_wmv_h.264_mxf_12_01_2011.prj

   

to do: TEST DURATION IMPORT! TEST IMPORTED FROM IMPORT!

To do: Maybe want to add url prefix to ini file so that if it changes, each resource id does not have to be redone (this might mean the resource id type would be path/filename) 



-->

	<xsl:output encoding="ISO-8859-13" indent="yes"/>

	<xsl:variable name="ofComponent" select="' of component '"/>

	<!--<xsl:variable name="motionJPEG" select="'_pres_2.mxf'"/>  -->

	<xsl:variable name="url" select="'http://serverurl/'"/>

	<xsl:variable name="pdf" select="'_solo.pdf'"/>

	<xsl:variable name="sammaSolo" select="'Samma Solo'"/>

	<xsl:variable name="capSet" select="'; '"/>

	

<xsl:template match="SammaSolo">

	<mavis>

	<xsl:for-each select="//Settings">

		<xsl:if test="Details/TapeId">

			<VideoTapeCarrier>

				<xsl:attribute name="xl:href">

					/VideoTapeCarrier/key/<xsl:value-of select="Details/TapeId"/>

				</xsl:attribute>

				<xsl:call-template name="referenceMaterial"/>

				<durationSec><xsl:value-of select="Duration"/></durationSec>

			</VideoTapeCarrier>

		</xsl:if>

	</xsl:for-each>

	<xsl:for-each select="EncodedFiles/*">

		<xsl:if test="Type!='MOTION_JPEG2000' and Type!='_acc_2.wmv'">

			<DigitalComponent>

				<xsl:call-template name="workOrUnattached"/>

				<typeMaterial>V</typeMaterial>

				<categoryMaterial>

					<xsl:choose>

						<xsl:when test="Type='_pres_1.mov'">PC</xsl:when>

						<xsl:when test="Type='_acc_1.mov'">AC</xsl:when>

						<xsl:when test="Type='_int_1.mov'">IC</xsl:when>

					</xsl:choose>

				</categoryMaterial>

				<collection><xsl:value-of select="substring-after(substring-before(../../Settings/Details/Filename,'_'),'c')"/></collection>

				<itemDescr><xsl:value-of select="../../Settings/Details/Description"/></itemDescr>

				<importedFrom>SAMMA</importedFrom>

				<whoCaptured><xsl:value-of select="../../Settings/Details/MigratedBy"/></whoCaptured>

				<dateTimeCaptured><xsl:value-of select="substring(../../Settings/Details/MigrationDateTime, 6, 2)"/>/<xsl:value-of select="substring(../../Settings/Details/MigrationDateTime, 9, 2)"/>/<xsl:value-of select="substring(../../Settings/Details/MigrationDateTime, 1, 4)"/> - <xsl:choose><xsl:when test="substring(../../Settings/Details/MigrationDateTime, 12, 2) &gt; 12"><xsl:value-of select="substring(../../Settings/Details/MigrationDateTime, 12, 2) - 12"/>:<xsl:value-of select="substring(../../Settings/Details/MigrationDateTime, 15, 2)"/>:<xsl:value-of select="substring(../../Settings/Details/MigrationDateTime, 18, 2)"/> PM</xsl:when><xsl:when test="substring(../../Settings/Details/MigrationDateTime, 12, 2) = '12'">12:<xsl:value-of select="substring(../../Settings/Details/MigrationDateTime, 15, 2)"/>:<xsl:value-of select="substring(../../Settings/Details/MigrationDateTime, 18, 2)"/> PM</xsl:when><xsl:when test="substring(../../Settings/Details/MigrationDateTime, 12, 2) = '00'">12:<xsl:value-of select="substring(../../Settings/Details/MigrationDateTime, 15, 2)"/>:<xsl:value-of select="substring(../../Settings/Details/MigrationDateTime, 18, 2)"/> AM</xsl:when><xsl:otherwise><xsl:value-of select="substring(../../Settings/Details/MigrationDateTime, 12, 2)"/>:<xsl:value-of select="substring(../../Settings/Details/MigrationDateTime, 15, 2)"/>:<xsl:value-of select="substring(../../Settings/Details/MigrationDateTime, 18, 2)"/> AM</xsl:otherwise></xsl:choose></dateTimeCaptured>

				<xsl:call-template name="componentCopyHistory"/>

				<xsl:call-template name="workOrUnattached"/>

				<carriers>

					<DigitalCarrier>

						<fileFormat>

							<xsl:choose>

								<xsl:when test="Type='_pres_1.mov'">VQ</xsl:when>

								<xsl:when test="Type='_acc_1.mov'">VM4</xsl:when>

								<xsl:when test="Type='_int_1.mov'">VQ</xsl:when>

							</xsl:choose>

						</fileFormat>

						<fileSize><xsl:value-of select="FileSize"/></fileSize>	

						<xsl:call-template name="carrierCopyHistory"/>

						<!--<xsl:call-template name="shaIdentifier"/>-->

						<xsl:call-template name="resourceIdentifier"/>

						<captureDeviceType>PCI</captureDeviceType>

						<captureDeviceMake>FPD</captureDeviceMake>

						<captureDeviceModel><xsl:value-of select="$sammaSolo"/></captureDeviceModel>

						<captureDeviceSettings><xsl:value-of select="../../Settings/General/Template"/><xsl:value-of select="$capSet"/><xsl:value-of select="../../Settings/Encoder2/ProjectFile"/></captureDeviceSettings>

						<!--

						<videoDurationHr></videoDurationHr>

						<videoDurationMin></videoDurationMin>-->

						<videoDurationSec><xsl:value-of select="Duration"/></videoDurationSec>

						<dateTimeCaptured><xsl:value-of select="substring(../../Settings/Details/MigrationDateTime, 6, 2)"/>/<xsl:value-of select="substring(../../Settings/Details/MigrationDateTime, 9, 2)"/>/<xsl:value-of select="substring(../../Settings/Details/MigrationDateTime, 1, 4)"/> - <xsl:choose><xsl:when test="substring(../../Settings/Details/MigrationDateTime, 12, 2) &gt; 12"><xsl:value-of select="substring(../../Settings/Details/MigrationDateTime, 12, 2) - 12"/>:<xsl:value-of select="substring(../../Settings/Details/MigrationDateTime, 15, 2)"/>:<xsl:value-of select="substring(../../Settings/Details/MigrationDateTime, 18, 2)"/> PM</xsl:when><xsl:when test="substring(../../Settings/Details/MigrationDateTime, 12, 2) = '12'">12:<xsl:value-of select="substring(../../Settings/Details/MigrationDateTime, 15, 2)"/>:<xsl:value-of select="substring(../../Settings/Details/MigrationDateTime, 18, 2)"/> PM</xsl:when><xsl:when test="substring(../../Settings/Details/MigrationDateTime, 12, 2) = '00'">12:<xsl:value-of select="substring(../../Settings/Details/MigrationDateTime, 15, 2)"/>:<xsl:value-of select="substring(../../Settings/Details/MigrationDateTime, 18, 2)"/> AM</xsl:when><xsl:otherwise><xsl:value-of select="substring(../../Settings/Details/MigrationDateTime, 12, 2)"/>:<xsl:value-of select="substring(../../Settings/Details/MigrationDateTime, 15, 2)"/>:<xsl:value-of select="substring(../../Settings/Details/MigrationDateTime, 18, 2)"/> AM</xsl:otherwise></xsl:choose></dateTimeCaptured>

						<operatingSystem>WXP</operatingSystem>

						<softwareUsed>SS431</softwareUsed>

						<xsl:choose>

							<xsl:when test="Type='_pres_1.mov'">

								<videoCompression>UN8</videoCompression>

								<videoSamplingHierarchy>422</videoSamplingHierarchy>

								<videoAspectRatio>TV</videoAspectRatio>

								<videoFrameLayout>I</videoFrameLayout>

								<videoColourSpace>YCbCr</videoColourSpace>

								<videoHeight>480</videoHeight>

								<videoWidth>720</videoWidth>

								<videoAudioCompression>LP</videoAudioCompression>

								<videoSoundField>ST</videoSoundField>

								<videoAudioSampleRate>48</videoAudioSampleRate>

								<videoAudioNoChannels>2</videoAudioNoChannels>

								<videoFrameRate>29.97</videoFrameRate>

							</xsl:when>

							<xsl:when test="Type='_acc_1.mov'">

								<videoCompression>H264</videoCompression>

								<!--<videoSamplingHierarchy>422</videoSamplingHierarchy>-->

								<videoAspectRatio>TV</videoAspectRatio>

								<videoFrameLayout>D</videoFrameLayout>

								<videoColourSpace>YCbCr</videoColourSpace>

								<videoHeight>480</videoHeight>

								<videoWidth>640</videoWidth>

								<videoAudioCompression>AAC</videoAudioCompression>

								<videoSoundField>ST</videoSoundField>

								<videoAudioSampleRate>48</videoAudioSampleRate>

								<videoAudioNoChannels>2</videoAudioNoChannels>

								<videoFrameRate>29.97</videoFrameRate>

							</xsl:when>

							<xsl:when test="Type='_int_1.mov'">

								<videoCompression>DVCP25</videoCompression>

								<videoSamplingHierarchy>411</videoSamplingHierarchy>

								<videoAspectRatio>TV</videoAspectRatio>

								<videoFrameLayout>I</videoFrameLayout>

								<videoColourSpace>YCbCr</videoColourSpace>

								<videoHeight>480</videoHeight>

								<videoWidth>720</videoWidth>

								<videoAudioCompression>LP</videoAudioCompression>

								<videoSoundField>ST</videoSoundField>

								<videoAudioSampleRate>48</videoAudioSampleRate>

								<videoAudioNoChannels>2</videoAudioNoChannels>

								<videoFrameRate>29.97</videoFrameRate>

							</xsl:when>

						</xsl:choose>				

					</DigitalCarrier>

				</carriers>

			</DigitalComponent>

		</xsl:if>

	</xsl:for-each>

	

	</mavis>

</xsl:template>



<xsl:template match="*">

	<!-- Do not output anything except what's in the "SAMMAPrep" template -->

</xsl:template>



<xsl:template name="carrierCopyHistory">

	<xsl:if test="../../Settings/Details/TapeId">

		<copiedFromItems>

			<ItemCopy>

				<item><xsl:attribute name="xl:href">/VideoTapeCarrier/key/<xsl:value-of select="../../Settings/Details/TapeId"/></xsl:attribute></item>

				<copiedDate><xsl:value-of select="substring(../../Settings/Details/MigrationDateTime, 1, 10)"/></copiedDate>

			</ItemCopy>

		</copiedFromItems>

	</xsl:if>

</xsl:template>





<xsl:template name="componentCopyHistory">

	<xsl:if test="contains(../../Settings/Details/TapeIdSequence,'of component')">

		<copiedFromItems>

			<ItemCopy>

				<item><xsl:attribute name="xl:href">/VideoTapeComponent/key/<xsl:value-of select="substring-after(../../Settings/Details/TapeIdSequence,$ofComponent)"/></xsl:attribute></item>

				<copiedDate><xsl:value-of select="substring(../../Settings/Details/MigrationDateTime, 1, 10)"/></copiedDate>

			</ItemCopy>

		</copiedFromItems>

	</xsl:if>

</xsl:template>



<xsl:template name="shaIdentifier">

	<xsl:if test="ShaDigest">

		<objectIdentifiers>

			<ObjectIdentifier>

				<identifier><xsl:value-of select="ShaDigest"/></identifier>

				<identifierType>SHA-DIGEST</identifierType>

			</ObjectIdentifier>

		</objectIdentifiers>

	</xsl:if>

</xsl:template>



<xsl:template name="resourceIdentifier">

	<xsl:if test="Filename">

		<objectResourceIdentifiers>

			<ResourceIdentifier>

				<resourceIdentifier>

					<xsl:value-of select="$url"/>

					<xsl:choose>

						<xsl:when test="Type='_pres_1.mov'">preservation03/<xsl:value-of select="../../Settings/Details/Filename"/><xsl:value-of select="Type"/></xsl:when>

						<xsl:when test="Type='_acc_1.mov'">access/<xsl:value-of select="../../Settings/Details/Filename"/>_acc_1.mp4</xsl:when>

						<xsl:when test="Type='_int_1.mov'">intermediate/<xsl:value-of select="../../Settings/Details/Filename"/><xsl:value-of select="Type"/></xsl:when>

					</xsl:choose>					

				</resourceIdentifier>

				<resourceIdentifierType>URL</resourceIdentifierType>

			</ResourceIdentifier>

		</objectResourceIdentifiers>

	</xsl:if>

</xsl:template>



<xsl:template name="referenceMaterial">

	<objectReferenceMaterials>

		<ObjectReferenceMaterial>

			<referenceMaterialType>SS</referenceMaterialType>

			<isOlcDisplay>Y</isOlcDisplay>

			<objectResourceIdentifiers>

				<ResourceIdentifier>

					<resourceIdentifier>

						<xsl:value-of select="$url"/>metadata/<xsl:value-of select="Details/Filename"/><xsl:value-of select="$pdf"/>

					</resourceIdentifier>

					<resourceIdentifierType>URL</resourceIdentifierType>

				</ResourceIdentifier>

			</objectResourceIdentifiers>

		</ObjectReferenceMaterial>

	</objectReferenceMaterials>

</xsl:template>

				

<xsl:template name="workOrUnattached">

	<xsl:variable name="tapeId"><xsl:value-of select="../../Settings/Details/TapeIdSequence"/></xsl:variable>

	<xsl:variable name="workId"><xsl:value-of select="substring-before(substring-after($tapeId,$ofComponent),'-')"/></xsl:variable>

	

	<xsl:choose>

		<xsl:when test="contains($tapeId,$ofComponent)">

			<xsl:choose>

				<xsl:when test="$workId != ''">

					<work><xsl:attribute name="xl:href">/Work/key/<xsl:value-of select="$workId"/></xsl:attribute></work>

				</xsl:when>

				<xsl:otherwise><isUnattached>Y</isUnattached></xsl:otherwise>		

			</xsl:choose>

		</xsl:when>	

		<xsl:otherwise><isUnattached>Y</isUnattached></xsl:otherwise>

	</xsl:choose>

</xsl:template>



				

</xsl:stylesheet>


Export for Online Spreadsheet Stylesheet

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet

	version="1.0"

	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

	xmlns:fo="http://www.w3.org/1999/XSL/Format"

	xmlns:xl="http://www.w3.org/TR/xlink"

	xmlns:mv="http://www.wizardis.com.au/2005/12/MAVIS">



<!-- 

   Create export for Access File Creation Spreadsheet



   Modification History

   ********************

   18/04/11  JRR ????????   Created

   20/12/11  JRR ????????   Added file names for special case copied from (this can be commented out), added title numbers



Media specialist searches for digital acquisition with category IC; selects all; exports using this stylesheet

This stylesheet is also used for sammaPostMigrationMetadata procedures.



-->



	<xsl:output method="text"/>

	<xsl:variable name="cr" select="'&#xA;'"/>

	<xsl:variable name="delim" select="'^'"/>



<xsl:template match="mv:mavis">Item Description^Component Item Number^Carrier Item Number^Copied From^File Name Int^File Name Acc^Title Number

<xsl:for-each select="//mv:DigitalCarrier">

	<xsl:value-of select="../../mv:itemDescr"/><xsl:value-of select="$delim"/>

	<!--<xsl:value-of select="substring-after(../../mv:collection/@xl:href,'/Collection/key/')"/><xsl:value-of select="$delim"/>-->

	<xsl:value-of select="../../mv:itemId"/><xsl:value-of select="$delim"/>

	<xsl:value-of select="mv:itemId"/><xsl:value-of select="$delim"/>

	<xsl:for-each select=".//mv:ResourceIdentifier">

		<xsl:value-of select="mv:resourceIdentifier"/><xsl:value-of select="$delim"/>

	</xsl:for-each>c<xsl:value-of select="substring-after(../../mv:collection/@xl:href,'/Collection/key/')"/>_<xsl:value-of select="mv:itemId"/>_int_1.mov<xsl:value-of select="$delim"/>c<xsl:value-of select="substring-after(../../mv:collection/@xl:href,'/Collection/key/')"/>_<xsl:value-of select="mv:itemId"/>_acc_1.mp4<xsl:value-of select="$delim"/>

	<xsl:value-of select="substring-after(mv:work/@xl:href,'/TitleWork/key/')"/>

	<xsl:value-of select="$cr"/>

	</xsl:for-each>

</xsl:template>



</xsl:stylesheet>

Import from Online Spreadsheet Stylesheet

<?xml version="1.0" encoding="ISO-8859-13"?>

<xsl:stylesheet

	version="1.0"

	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

	xmlns:xl="http://www.w3.org/TR/xlink"

	xmlns="http://www.wizardis.com.au/2005/12/MAVIS">

<!-- 

   Add digital components and migration data to a video or film, using vendor xml

   Modification History

   ********************

   11/08/11  JRR ????????   Copied from vendor import access Stylesheet

   18/07/12  JRR ????????   Modified: Added check to only import migrated records; Added href attribute to identify correct files; eliminated fields that are extraneous; eliminated obsolete templates; added templates for other file checksums; added for int and acc; 

   19/07/12  JRR ????????   Modified: changed encompassing if statement to check the dataEntryComplete field instead of migrated field



NEED TO TEST!!!! 



to do: add bit rate stuff?

TO DO: do we want to make if statements so that xml conversion failure warnings about empty tags being ignored do not appear?

TO DO: WILL Carrier Notes FIELD BE OVERWRITTEN?  IS THERE A WAY TO APPEND INFO???



-->

	<xsl:output encoding="ISO-8859-13" indent="yes"/>

	<xsl:variable name="cr" select="'&#xA;'"/>

	<xsl:variable name="macPro" select="'Mac Pro'"/>

	

<xsl:template match="document">

	<mavis>

	<xsl:for-each select="//record">

		<xsl:if test="string(dataEntryComplete)">



		<xsl:if test="string(presChecksum)">

			<DigitalComponent>

				<xsl:attribute name="xl:href">

					/DigitalComponent/key/<xsl:value-of select"presComponentNumber"/>

				</xsl:attribute>

				<xsl:choose>

					<xsl:when test="string(titleNo)">

						<work><xsl:attribute name="xl:href">/Work/key/<xsl:value-of select="titleNo"/></xsl:attribute></work>

					</xsl:when>

					<xsl:otherwise><isUnattached>Y</isUnattached></xsl:otherwise>

				</xsl:choose>

				<carriers>

					<DigitalCarrier>

						<xsl:attribute name="xl:href">

							/DigitalCarrier/key/<xsl:value-of select"presCarrierNumber"/>

						</xsl:attribute>

						<whoExamined><xsl:value-of select="presExaminedBy"/></whoExamined>

						<xsl:call-template name="presChecksum"/>



						<videoColourType><xsl:value-of select="colorType"/></videoColourType>

						<notes>HKG Examiner Notes: <xsl:value-of select="examinerNotes"/><xsl:value-of select="$cr"/><xsl:value-of select="$cr"/>Audio: <xsl:value-of select="audio"/></notes>

					</DigitalCarrier>

				</carriers>

			</DigitalComponent>

		</xsl:if>



		<xsl:if test="string(intChecksum)">

			<DigitalComponent>

				<xsl:attribute name="xl:href">

					/DigitalComponent/key/<xsl:value-of select"intComponentNumber"/>

				</xsl:attribute>

				<xsl:choose>

					<xsl:when test="string(titleNo)">

						<work><xsl:attribute name="xl:href">/Work/key/<xsl:value-of select="titleNo"/></xsl:attribute></work>

					</xsl:when>

					<xsl:otherwise><isUnattached>Y</isUnattached></xsl:otherwise>

				</xsl:choose>

				<carriers>

					<DigitalCarrier>

						<xsl:attribute name="xl:href">

							/DigitalCarrier/key/<xsl:value-of select"intCarrierNumber"/>

						</xsl:attribute>

						<whoExamined><xsl:value-of select="intExaminedBy"/></whoExamined>

						<xsl:call-template name="intChecksum"/>



						<videoColourType><xsl:value-of select="colorType"/></videoColourType>

						<notes>HKG Examiner Notes: <xsl:value-of select="examinerNotes"/><xsl:value-of select="$cr"/><xsl:value-of select="$cr"/>Audio: <xsl:value-of select="audio"/></notes>

					</DigitalCarrier>

				</carriers>

			</DigitalComponent>

		</xsl:if>



		<xsl:if test="string(accChecksum)">

			<DigitalComponent>

				<xsl:attribute name="xl:href">

					/DigitalComponent/key/<xsl:value-of select"accComponentNumber"/>

				</xsl:attribute>

				<xsl:choose>

					<xsl:when test="string(titleNo)">

						<work><xsl:attribute name="xl:href">/Work/key/<xsl:value-of select="titleNo"/></xsl:attribute></work>

					</xsl:when>

					<xsl:otherwise><isUnattached>Y</isUnattached></xsl:otherwise>

				</xsl:choose>

				<carriers>

					<DigitalCarrier>

						<xsl:attribute name="xl:href">

							/DigitalCarrier/key/<xsl:value-of select"accCarrierNumber"/>

						</xsl:attribute>

						<whoExamined><xsl:value-of select="accExaminedBy"/></whoExamined>

						<xsl:call-template name="accChecksum"/>



						<videoColourType><xsl:value-of select="colorType"/></videoColourType>

						<notes>HKG Examiner Notes: <xsl:value-of select="examinerNotes"/><xsl:value-of select="$cr"/><xsl:value-of select="$cr"/>Audio: <xsl:value-of select="audio"/></notes>

					</DigitalCarrier>

				</carriers>

			</DigitalComponent>

		</xsl:if>



		</xsl:if>

	</xsl:for-each>

	

	</mavis>

</xsl:template>





<xsl:template match="*">

	<!-- Do not output anything except what's in the "shipment" template -->

</xsl:template>



<xsl:template name="presChecksum">

	<xsl:if test="string(presChecksum)">

		<objectIdentifiers>

			<ObjectIdentifier>

				<identifier><xsl:value-of select="presChecksum"/></identifier>

				<identifierType>HKGCS</identifierType>

			</ObjectIdentifier>

		</objectIdentifiers>

	</xsl:if>

</xsl:template>



<xsl:template name="intChecksum">

	<xsl:if test="string(intChecksum)">

		<objectIdentifiers>

			<ObjectIdentifier>

				<identifier><xsl:value-of select="intChecksum"/></identifier>

				<identifierType>HKGCS</identifierType>

			</ObjectIdentifier>

		</objectIdentifiers>

	</xsl:if>

</xsl:template>



<xsl:template name="accChecksum">

	<xsl:if test="string(accChecksum)">

		<objectIdentifiers>

			<ObjectIdentifier>

				<identifier><xsl:value-of select="accChecksum"/></identifier>

				<identifierType>HKGCS</identifierType>

			</ObjectIdentifier>

		</objectIdentifiers>

	</xsl:if>

</xsl:template>



				

</xsl:stylesheet>


playground/mavis-samma_integration.txt · Last modified: 2019/06/28 16:42 (external edit)