|
From: <mb...@re...> - 2005-02-25 12:55:24
|
Author: mbooth Date: 2005-02-25 13:53:52 +0100 (Fri, 25 Feb 2005) New Revision: 301 Added: ccm-ldn-terms/trunk/doc/esd/README-upgrading-domains.txt ccm-ldn-terms/trunk/doc/esd/files-1.04.txt ccm-ldn-terms/trunk/doc/esd/xslt-1.04/ ccm-ldn-terms/trunk/doc/esd/xslt-1.04/ControlledList2domain.xsl ccm-ldn-terms/trunk/doc/esd/xslt-1.04/ControlledList2hierarchy.xsl ccm-ldn-terms/trunk/doc/esd/xslt-1.04/ItemsHierarchy2domainLite.xsl ccm-ldn-terms/trunk/doc/esd/xslt-1.04/ItemsHierarchy2hierarchy.xsl ccm-ldn-terms/trunk/doc/esd/xslt-1.04/ItemsHierarchy2hierarchyLite.xsl ccm-ldn-terms/trunk/doc/esd/xslt-1.04/LGDLLGSLItemsHierarchy2mixedHierarchy.xsl ccm-ldn-terms/trunk/doc/esd/xslt-1.04/Mapping2mapping.xsl ccm-ldn-terms/trunk/doc/esd/xslt-1.04/Mapping2reversemapping.xsl ccm-ldn-terms/trunk/doc/esd/xslt-1.04/RelatedItems2related.xsl Modified: ccm-ldn-terms/trunk/doc/esd/xslt-1.03/LGDLLGSLItemsHierarchy2mixedHierarchy.xsl Log: Add version 1.04 domains Added: ccm-ldn-terms/trunk/doc/esd/README-upgrading-domains.txt =================================================================== --- ccm-ldn-terms/trunk/doc/esd/README-upgrading-domains.txt 2005-02-25 12:51:36 UTC (rev 300) +++ ccm-ldn-terms/trunk/doc/esd/README-upgrading-domains.txt 2005-02-25 12:53:52 UTC (rev 301) @@ -0,0 +1,43 @@ +Release Notes for Terms Importer upgrade +Introduction + +These release notes relate to changes to the com.arsdigita.london.terms.importer package and related supporting files in the directory /usr/share/doc/ccm-ldn-terms-VERSION/esd. + +The purpose of these changes is to enable the importer to correctly import revised ESD controlled lists into a system that has an earlier version of the lists. Specifically a requirement was to upgrade a production version of APLAWS with a 1.02 version of ESD lists to have 1.04 lists. + +User Interface + +The upgraded importer tool has exactly the same interface as the earlier version. Therefore the tool works as documented in the APLAWS Admin Guide. One previously undocumented command is optional. To recap: + +First generate the XML files to import + +# cat files-1.04.txt | perl generate.pl + +Then import the domains and terms in those domains + +# ccm-run com.arsdigita.london.terms.Importer domain-* + +Then add the hierarchical relationships between the terms + +# ccm-run com.arsdigita.london.terms.Importer hierarchy-* + +Then add the mappings between the terms + +# ccm-run com.arsdigita.london.terms.Importer mapping-* + +Then add the related terms (this is not in the original documentation) + +# ccm-run com.arsdigita.london.terms.Importer related-* + +The most difficult part of this process is determining what should be the contents of the input file, in our case files-1.04.txt. This determines which XML files are generated. The released version of files-1.02.txt generated too many files, so that too many domains were imported into our APLAWS installation. In addition, a hierarchy mapping LGDL to LGSL was imported, followed by a related mapping of the same terms. This second import was superfluous and resulted in incorrect data. The files-1.04.txt was created with fewer entries than files-1.02.txt for this reason. + +It was necessary to edit one of the XSL files that transform the ESD toolkit XML into terms importer XML. The file LGDLLGSLItemsHierarchy2mixedHierarchy.xsl was changed to ensure that the LGSL terms added to the LGDL were all preferred terms. The same result could have been attained by changing the java code, but we decided to make as few changes to java code as possible. + +Changes to the Java code + +All changes were made only to classes in com.arsdigita.london.terms.importer . This package is only used to import the terms through the command line UI. No changes were made to the terms code , or to categories etc. +The classes changed were DomainBuilder HierarchyBuilder, MixedHierarchyBuilder and RelatedBuilder. +DomainBuilder was altered to update the Domain information. +The other classes were updated to delete the existing mappings between terms, and import the new ones. + + Added: ccm-ldn-terms/trunk/doc/esd/files-1.04.txt =================================================================== --- ccm-ldn-terms/trunk/doc/esd/files-1.04.txt 2005-02-25 12:51:36 UTC (rev 300) +++ ccm-ldn-terms/trunk/doc/esd/files-1.04.txt 2005-02-25 12:53:52 UTC (rev 301) @@ -0,0 +1,17 @@ +# This file contains lines of the form: +# +# (ESD Toolkit XML, APLAWS import XML, ESD->APLAWS transform) +http://www.esd.org.uk/standards/lgcl/1.04/lgclhierarchy.xml,hierarchy-lgcl-1.04.xml,xslt-1.04/ItemsHierarchy2hierarchy.xsl +http://www.esd.org.uk/standards/lgcl/1.04/lgclgclmapping.xml,mapping-lgcl-1.04-gcl-2.10.xml,xslt-1.04/Mapping2mapping.xsl +http://www.esd.org.uk/standards/termslist/1.04/termslist.xml,domain-lgcl-1.04.xml,xslt-1.04/ControlledList2domain.xsl +http://www.esd.org.uk/standards/lgcl/1.04/lgcllgslmapping.xml,mapping-lgcl-1.04-lgsl-2.01.xml,xslt-1.04/Mapping2mapping.xsl +http://www.esd.org.uk/standards/lgsl/2.01/lgsltermslist.xml,domain-lgsl-2.01.xml,xslt-1.04/ControlledList2domain.xsl +http://www.esd.org.uk/standards/lgdl/2.01/lgdltermslist.xml,domain-lgdl-2.01.xml,xslt-1.04/ControlledList2domain.xsl +http://www.esd.org.uk/standards/gcl/2.10/gcltermslist.xml,domain-gcl-2.10.xml,xslt-1.04/ControlledList2domain.xsl +#http://www.esd.org.uk/standards/gcl/2.10/gclhierarchy.xml,hierarchy-gcl-2.10.xml,xslt-1.04/ItemsHierarchy2hierarchy.xsl +http://www.esd.org.uk/standards/lgdl/2.01/lgdlhierarchy.xml,hierarchy-lgdl-2.01.xml,xslt-1.04/ItemsHierarchy2hierarchy.xsl +http://www.esd.org.uk/standards/lgcl/1.04/lgclrelatedterms.xml,related-lgcl-1.04.xml,xslt-1.04/RelatedItems2related.xsl +http://www.esd.org.uk/standards/lgdl/2.01/lgdllgslhierarchy.xml,hierarchy-lgdl-2.01-lgsl-2.01.xml,xslt-1.04/LGDLLGSLItemsHierarchy2mixedHierarchy.xsl +http://www.esd.org.uk/standards/lgcl/1.04/lgcllgslmapping.xml,mapping-lgsl-2.00-lgcl-1.04.xml,xslt-1.04/Mapping2reversemapping.xsl +http://www.esd.org.uk/standards/lgcl/1.04/lgclhierarchy.xml,domain-lgcl-lite-1.04.xml,xslt-1.04/ItemsHierarchy2domainLite.xsl +http://www.esd.org.uk/standards/lgcl/1.04/lgclhierarchy.xml,hierarchy-lgcl-lite-1.04.xml,xslt-1.04/ItemsHierarchy2hierarchyLite.xsl Modified: ccm-ldn-terms/trunk/doc/esd/xslt-1.03/LGDLLGSLItemsHierarchy2mixedHierarchy.xsl =================================================================== --- ccm-ldn-terms/trunk/doc/esd/xslt-1.03/LGDLLGSLItemsHierarchy2mixedHierarchy.xsl 2005-02-25 12:51:36 UTC (rev 300) +++ ccm-ldn-terms/trunk/doc/esd/xslt-1.03/LGDLLGSLItemsHierarchy2mixedHierarchy.xsl 2005-02-25 12:53:52 UTC (rev 301) @@ -29,7 +29,7 @@ <terms:source> <terms:term id="{$sourceID}"/> </terms:source> - <terms:destination isDefault="{@Default}" isPreferred="{@Preferred}"> + <terms:destination isDefault="{@Default}" isPreferred="true"> <terms:term id="{@Id}"/> </terms:destination> </terms:orderedPair> Added: ccm-ldn-terms/trunk/doc/esd/xslt-1.04/ControlledList2domain.xsl =================================================================== --- ccm-ldn-terms/trunk/doc/esd/xslt-1.04/ControlledList2domain.xsl 2005-02-25 12:51:36 UTC (rev 300) +++ ccm-ldn-terms/trunk/doc/esd/xslt-1.04/ControlledList2domain.xsl 2005-02-25 12:53:52 UTC (rev 301) @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:esd="http://www.esd.org.uk/standards" + xmlns:terms="http://xmlns.redhat.com/london/terms/1.0" + exclude-result-prefixes="esd terms" + version="1.0"> + + <xsl:output method="xml"/> + + <xsl:template match="esd:ControlledList"> + <terms:domain + about="{@HomeLocation}" + key="{@ItemName}" + title="{@ListName}" + version="{@Version}" + released="{@VersionDate}"> + + <xsl:apply-templates select="esd:Item"/> + </terms:domain> + </xsl:template> + + <xsl:template match="esd:Item"> + <terms:term + id="{@Id}" + name="{esd:Name}"> + <xsl:if test="@AToZ"> + <xsl:attribute name="inAtoZ"> + <xsl:value-of select="@AToZ"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="esd:Shortcut"> + <xsl:attribute name="shortcut"> + <xsl:value-of select="esd:Shortcut"/> + </xsl:attribute> + </xsl:if> + </terms:term> + </xsl:template> + +</xsl:stylesheet> Added: ccm-ldn-terms/trunk/doc/esd/xslt-1.04/ControlledList2hierarchy.xsl =================================================================== --- ccm-ldn-terms/trunk/doc/esd/xslt-1.04/ControlledList2hierarchy.xsl 2005-02-25 12:51:36 UTC (rev 300) +++ ccm-ldn-terms/trunk/doc/esd/xslt-1.04/ControlledList2hierarchy.xsl 2005-02-25 12:53:52 UTC (rev 301) @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:esd="http://www.esd.org.uk/standards" + xmlns:terms="http://xmlns.redhat.com/london/terms/1.0" + exclude-result-prefixes="esd terms" + version="1.0"> + + <xsl:template match="esd:ControlledList"> + <terms:hierarchy> + <terms:domain resource="{@HomeLocation}"/> + <xsl:apply-templates select="esd:Item"/> + + </terms:hierarchy> + </xsl:template> + + <xsl:template match="esd:Item"> + <terms:term id="{@Id}"/> + </xsl:template> + +</xsl:stylesheet> Added: ccm-ldn-terms/trunk/doc/esd/xslt-1.04/ItemsHierarchy2domainLite.xsl =================================================================== --- ccm-ldn-terms/trunk/doc/esd/xslt-1.04/ItemsHierarchy2domainLite.xsl 2005-02-25 12:51:36 UTC (rev 300) +++ ccm-ldn-terms/trunk/doc/esd/xslt-1.04/ItemsHierarchy2domainLite.xsl 2005-02-25 12:53:52 UTC (rev 301) @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:esd="http://www.esd.org.uk/standards" + xmlns:terms="http://xmlns.redhat.com/london/terms/1.0" + exclude-result-prefixes="esd terms" + version="1.0"> + + <xsl:output method="xml"/> + + <xsl:template match="esd:ItemsHierarchy"> + <terms:domain + about="{@Resource}" + key="LGCL" + title="Local Government Category List" + version="{@Version}" + released="{esd:Metadata/esd:Date.Issued}"> + + <xsl:apply-templates select="esd:Item"/> + <xsl:apply-templates select="esd:Item/esd:NarrowerItems/esd:Item"/> + </terms:domain> + </xsl:template> + + <xsl:template match="esd:Item"> + <terms:term + id="{@Id}" + name="{esd:Name}" + inAtoZ="false"/> + </xsl:template> + +</xsl:stylesheet> Added: ccm-ldn-terms/trunk/doc/esd/xslt-1.04/ItemsHierarchy2hierarchy.xsl =================================================================== --- ccm-ldn-terms/trunk/doc/esd/xslt-1.04/ItemsHierarchy2hierarchy.xsl 2005-02-25 12:51:36 UTC (rev 300) +++ ccm-ldn-terms/trunk/doc/esd/xslt-1.04/ItemsHierarchy2hierarchy.xsl 2005-02-25 12:53:52 UTC (rev 301) @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:esd="http://www.esd.org.uk/standards" + xmlns:terms="http://xmlns.redhat.com/london/terms/1.0" + exclude-result-prefixes="esd terms" + version="1.0"> + + <xsl:output method="xml"/> + + <xsl:template match="esd:ItemsHierarchy"> + <terms:hierarchy> + <terms:domain resource="{@Resource}"/> + <xsl:apply-templates select="esd:Item" mode="root"/> + <xsl:apply-templates select="esd:Item" mode="narrower"/> + </terms:hierarchy> + </xsl:template> + + <xsl:template match="esd:Item" mode="root"> + <terms:term id="{@Id}"/> + </xsl:template> + + <xsl:template match="esd:Item" mode="narrower"> + <xsl:if test="esd:NarrowerItems/esd:Item"> + <xsl:variable name="sourceID"> + <xsl:value-of select="@Id"/> + </xsl:variable> + <xsl:for-each select="esd:NarrowerItems/esd:Item"> + <terms:orderedPair> + <terms:source> + <terms:term id="{$sourceID}"/> + </terms:source> + <terms:destination isDefault="{@Default}" isPreferred="{@Category}"> + <terms:term id="{@Id}"/> + </terms:destination> + </terms:orderedPair> + </xsl:for-each> + </xsl:if> + <xsl:apply-templates select="esd:NarrowerItems/esd:Item" mode="narrower"/> + </xsl:template> + +</xsl:stylesheet> Added: ccm-ldn-terms/trunk/doc/esd/xslt-1.04/ItemsHierarchy2hierarchyLite.xsl =================================================================== --- ccm-ldn-terms/trunk/doc/esd/xslt-1.04/ItemsHierarchy2hierarchyLite.xsl 2005-02-25 12:51:36 UTC (rev 300) +++ ccm-ldn-terms/trunk/doc/esd/xslt-1.04/ItemsHierarchy2hierarchyLite.xsl 2005-02-25 12:53:52 UTC (rev 301) @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:esd="http://www.esd.org.uk/standards" + xmlns:terms="http://xmlns.redhat.com/london/terms/1.0" + exclude-result-prefixes="esd terms" + version="1.0"> + + <xsl:output method="xml"/> + + <xsl:template match="esd:ItemsHierarchy"> + <terms:hierarchy> + <terms:domain resource="{@Resource}"/> + <xsl:apply-templates select="esd:Item" mode="root"/> + <xsl:apply-templates select="esd:Item" mode="narrower"/> + </terms:hierarchy> + </xsl:template> + + <xsl:template match="esd:Item" mode="root"> + <terms:term id="{@Id}"/> + </xsl:template> + + <xsl:template match="esd:Item" mode="narrower"> + <xsl:if test="esd:NarrowerItems/esd:Item"> + <xsl:variable name="sourceID"> + <xsl:value-of select="@Id"/> + </xsl:variable> + <xsl:for-each select="esd:NarrowerItems/esd:Item"> + <terms:orderedPair> + <terms:source> + <terms:term id="{$sourceID}"/> + </terms:source> + <terms:destination isDefault="{@Default}" isPreferred="{@Category}"> + <terms:term id="{@Id}"/> + </terms:destination> + </terms:orderedPair> + </xsl:for-each> + </xsl:if> + </xsl:template> + +</xsl:stylesheet> Added: ccm-ldn-terms/trunk/doc/esd/xslt-1.04/LGDLLGSLItemsHierarchy2mixedHierarchy.xsl =================================================================== --- ccm-ldn-terms/trunk/doc/esd/xslt-1.04/LGDLLGSLItemsHierarchy2mixedHierarchy.xsl 2005-02-25 12:51:36 UTC (rev 300) +++ ccm-ldn-terms/trunk/doc/esd/xslt-1.04/LGDLLGSLItemsHierarchy2mixedHierarchy.xsl 2005-02-25 12:53:52 UTC (rev 301) @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:esd="http://www.esd.org.uk/standards" + xmlns:terms="http://xmlns.redhat.com/london/terms/1.0" + exclude-result-prefixes="esd terms" + version="1.0"> + + <xsl:output method="xml"/> + + <xsl:template match="esd:ItemsHierarchy"> + <terms:mixedHierarchy> + <terms:source> + <terms:domain resource="{@LgdlResource}"/> + </terms:source> + <terms:destination> + <terms:domain resource="{@LgslResource}"/> + </terms:destination> + <xsl:apply-templates select="esd:LgdlItem"/> + </terms:mixedHierarchy> + </xsl:template> + + <xsl:template match="esd:LgdlItem"> + <xsl:if test="esd:NarrowerItems/esd:LgslItem"> + <xsl:variable name="sourceID"> + <xsl:value-of select="@Id"/> + </xsl:variable> + <xsl:for-each select="esd:NarrowerItems/esd:LgslItem"> + <terms:orderedPair> + <terms:source> + <terms:term id="{$sourceID}"/> + </terms:source> + <terms:destination isDefault="{@Default}" isPreferred="true"> + <terms:term id="{@Id}"/> + </terms:destination> + </terms:orderedPair> + </xsl:for-each> + </xsl:if> + <xsl:apply-templates select="esd:NarrowerItems/esd:LgdlItem"/> + </xsl:template> + +</xsl:stylesheet> Added: ccm-ldn-terms/trunk/doc/esd/xslt-1.04/Mapping2mapping.xsl =================================================================== --- ccm-ldn-terms/trunk/doc/esd/xslt-1.04/Mapping2mapping.xsl 2005-02-25 12:51:36 UTC (rev 300) +++ ccm-ldn-terms/trunk/doc/esd/xslt-1.04/Mapping2mapping.xsl 2005-02-25 12:53:52 UTC (rev 301) @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:esd="http://www.esd.org.uk/standards" + xmlns:terms="http://xmlns.redhat.com/london/terms/1.0" + exclude-result-prefixes="esd terms" + version="1.0"> + + <xsl:output method="xml"/> + + <xsl:template match="/esd:ItemMappings"> + <terms:mapping> + <terms:source> + <terms:domain resource="{@FromResource}"/> + </terms:source> + <terms:destination> + <terms:domain resource="{@ToResource}"/> + </terms:destination> + <xsl:apply-templates select="esd:ItemMapping"/> + </terms:mapping> + </xsl:template> + + <xsl:template match="esd:ItemMapping"> + <xsl:for-each select="esd:From/esd:Item"> + <xsl:variable name="sourceID"> + <xsl:value-of select="@Id"/> + </xsl:variable> + <xsl:for-each select="../../esd:To/esd:Item"> + <terms:orderedPair> + <terms:source> + <terms:term id="{$sourceID}"/> + </terms:source> + <terms:destination> + <terms:term id="{@Id}"/> + </terms:destination> + </terms:orderedPair> + </xsl:for-each> + </xsl:for-each> + </xsl:template> + +</xsl:stylesheet> Added: ccm-ldn-terms/trunk/doc/esd/xslt-1.04/Mapping2reversemapping.xsl =================================================================== --- ccm-ldn-terms/trunk/doc/esd/xslt-1.04/Mapping2reversemapping.xsl 2005-02-25 12:51:36 UTC (rev 300) +++ ccm-ldn-terms/trunk/doc/esd/xslt-1.04/Mapping2reversemapping.xsl 2005-02-25 12:53:52 UTC (rev 301) @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:esd="http://www.esd.org.uk/standards" + xmlns:terms="http://xmlns.redhat.com/london/terms/1.0" + exclude-result-prefixes="esd terms" + version="1.0"> + + <xsl:output method="xml"/> + + <xsl:template match="/esd:ItemMappings"> + <terms:mapping> + <terms:source> + <terms:domain resource="{@ToResource}"/> + </terms:source> + <terms:destination> + <terms:domain resource="{@FromResource}"/> + </terms:destination> + <xsl:apply-templates select="esd:ItemMapping"/> + </terms:mapping> + </xsl:template> + + <xsl:template match="esd:ItemMapping"> + <xsl:for-each select="esd:To/esd:Item"> + <xsl:variable name="sourceID"> + <xsl:value-of select="@Id"/> + </xsl:variable> + <xsl:for-each select="../../esd:From/esd:Item"> + <terms:orderedPair> + <terms:source> + <terms:term id="{$sourceID}"/> + </terms:source> + <terms:destination> + <terms:term id="{@Id}"/> + </terms:destination> + </terms:orderedPair> + </xsl:for-each> + </xsl:for-each> + </xsl:template> + +</xsl:stylesheet> Added: ccm-ldn-terms/trunk/doc/esd/xslt-1.04/RelatedItems2related.xsl =================================================================== --- ccm-ldn-terms/trunk/doc/esd/xslt-1.04/RelatedItems2related.xsl 2005-02-25 12:51:36 UTC (rev 300) +++ ccm-ldn-terms/trunk/doc/esd/xslt-1.04/RelatedItems2related.xsl 2005-02-25 12:53:52 UTC (rev 301) @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:esd="http://www.esd.org.uk/standards" + xmlns:terms="http://xmlns.redhat.com/london/terms/1.0" + exclude-result-prefixes="esd terms" + version="1.0"> + + <xsl:output method="xml"/> + + <xsl:template match="/esd:RelatedItems"> + <terms:related> + <terms:domain resource="{@Resource}"/> + + <xsl:apply-templates select="esd:RelatedItems"/> + </terms:related> + </xsl:template> + + <xsl:template match="esd:RelatedItems"> + <terms:unorderedPair> + <terms:first> + <terms:term id="{esd:Item[position()=1]/@Id}"/> + </terms:first> + <terms:second> + <terms:term id="{esd:Item[position()=2]/@Id}"/> + </terms:second> + </terms:unorderedPair> + </xsl:template> + +</xsl:stylesheet> |