Commit b06cc48a authored by Mickaël Desfrênes's avatar Mickaël Desfrênes Committed by Jérôme Chauveau
Browse files

Début inclusion d'EAD dans le MaX standard

parent 73837ada
Loading
Loading
Loading
Loading
+10
Changes for plugins-available/default/ead_toc/ead_toc.xq: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
import module namespace max.config = 'pddn/max/config' at '../../rxq/config.xqm';
import module namespace max.ead_toc = "pddn/max/ead/ead_toc.xqm" at '../../rxq/ead/ead_toc.xqm';

declare variable $baseURI external;
declare variable $dbPath external;
declare variable $project external;
declare variable $doc external;
declare variable $id external;

max.ead_toc:buildEADDocumentTOC($project, $doc)
 No newline at end of file
+64
Changes for rxq/ead/ead_toc.xqm: 64 added lines, 0 removed lines.
Original line number Diff line number Diff line
module namespace max.ead_toc = "pddn/max/ead/ead_toc.xqm";
import module namespace max.config = 'pddn/max/config' at '../config.xqm';

declare function max.ead_toc:buildEADDocumentTOC($projectId, $docPath){
    let $dbPath := concat(max.config:getProjectDBPath($projectId), "/", $docPath)
    let $target := doc($dbPath)

    return
        <nav>
            {
                for $c in $target/*:ead/*:archdesc
                return
								<details id="details_{$c/@id}">
                    <summary>
                        <a href="/{$projectId}/{$docPath}/{$c/@id}">
												{$c/@id}
												{$c/*:did/*:unittitle[1]//text()}
												</a>
                    </summary>
                    {max.ead_toc:getComponentChildren($c, $projectId, $docPath)}
                </details>
            }
        </nav>
};

declare function max.ead_toc:hasComponentChildren($component){
    0
};

declare function max.ead_toc:getComponentChildren($component, $projectId, $docPath){
    for $c in $component/*:dsc/*:c
    return
        <details  id="details_{$c/@id}">
            <summary>
                <a href="/{$projectId}/{$docPath}/{$c/@id}">
								{$c/@id}
								{$c/*:did/*:unitid[1]//text()}
								 –
								{$c/*:did/*:unittitle[1]//text()}
								</a>
            </summary>
            {max.ead_toc:getComponentGrandChildren($c, $projectId, $docPath)}
        </details>
};

declare function max.ead_toc:hasComponentGrandChildren($component){
    0
};

declare function max.ead_toc:getComponentGrandChildren($component, $projectId, $docPath){
    for $c in $component/*:c
    return
        <details  id="details_{$c/@id}">
            <summary>
                <a href="/{$projectId}/{$docPath}/{$c/@id}">
								{$c/@id}
								{$c/*:did/*:unitid[1]//text()}
								 –
								{$c/*:did/*:unittitle[1]//text()}
								</a>
            </summary>
            {max.ead_toc:getComponentGrandChildren($c, $projectId, $docPath)}
        </details>
};
 No newline at end of file
+5 −2
Changes for rxq/toc.xqm: 5 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ import module namespace max.config = 'pddn/max/config' at 'config.xqm';
import module namespace max.html = 'pddn/max/html' at 'html.xqm';
import module namespace max.util = 'pddn/max/util' at 'util.xqm';
import module namespace max.tei_toc = "pddn/max/tei/tei_toc.xqm"  at 'tei/tei_toc.xqm';
import module namespace max.ead_toc = "pddn/max/ead/ead_toc.xqm"  at 'ead/ead_toc.xqm';

(:get project table of contents:)
declare function max.toc:getProjectTOC($project){
@@ -28,14 +29,16 @@ declare function max.toc:getProjectTOC($project){
        else
            max.util:list-db-resources($project)


    let $tocXSL := max.config:getProjectTOCXSL($project)

    return xslt:transform($xml,
            $tocXSL,
            map{
            "baseuri":max.config:getBaseURI(),
            "project": $project
            })/*[1]


};

(:
@@ -78,7 +81,7 @@ declare function max.toc:buildDefaultDocumentTOC($project, $docPath){
        case $max.cons:TEI
            return max.tei_toc:buildTEIDocumentTOC($project, $docPath)
        case $max.cons:EAD
            return <div>TODO EAD TOC</div>
            return max.ead_toc:buildEADDocumentTOC($project, $docPath)
        default return <div class='error'>Format XML {$xmlType} non géré !</div>

};
+2 −1
Changes for rxq/util.xqm: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -197,7 +197,8 @@ declare function max.util:teiDocTitle($dbName, $docPath){
};

declare function max.util:eadDocTitle($dbName, $docPath){
     doc($dbName || '/' || $docPath)/*:ead/*:archdesc/*:did/*:unittitle//text()
    let $title := doc($dbName || '/' || $docPath)/*:ead/*:archdesc/*:did/*:unittitle//text()
     return <span><title>{$title}</title></span>
};

declare function max.util:maxHome(){
+7 −1
Changes for ui/templates/ead.html: 7 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -3,7 +3,6 @@
  {$head}

  <body>
    {$devListCombobox}
    <nav id="ead-top-nav" class="navbar navbar-inverse navbar-fixed-top">
      <div id="img_header" style="background-color:green; height:80px"></div>
      <div class="container">
@@ -31,7 +30,14 @@
        </div>
        <div id="plan"></div>
      </div>

    <!-- main contents -->
    <main id="main-max-container" class="container">
        {$content}
    </main>



      <div id="right"></div>    
    </div>
    <div id="bottom">Site réalisé par le Pôle du Document numérique - <strong>MRSH-CNRS-Université de Caen</strong> - © 2013-2015 - Fait avec 
Loading