Skip to content

Commit

Permalink
Merge pull request #163 from Edirom/issue-110
Browse files Browse the repository at this point in the history
rework site structure
  • Loading branch information
peterstadler authored May 26, 2023
2 parents 7fcb7d7 + e27fef5 commit e0251fb
Show file tree
Hide file tree
Showing 12 changed files with 100 additions and 132 deletions.
19 changes: 8 additions & 11 deletions index.html → about.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
</head>
<body>
<div class="main">
<div class="front_page_header">
<a href="http://www.kb.dk" title="Royal Danish Library">
<img style="border: 0px solid;" src="resources/images/kb.png" alt="Royal Danish Library"/>
</a>
</div>
<h2><img src="resources/images/mermeid_30px.png" alt="MerMEId"/> – Metadata Editor and Repository for MEI Data</h2>

<div class="vertical_spacer">&#160;</div>
Expand All @@ -22,11 +17,13 @@ <h2>Introduction to the MerMEId demo server</h2>

<p>Mer<span class="logo_color">MEI</span>d is a system for the editing,
handling, and (pre-)viewing of music metadata, based on the the MEI (<a
href="http://www.music-encoding.org" target="_blank">Music Encoding
href="https://www.music-encoding.org" target="_blank">Music Encoding
Initiative</a>) XML schema.
</p>

<p>Mer<span class="logo_color">MEI</span>d is a community effort coordinated by <a href="https://edirom.de">ViFE – Virtueller Forschungsverbund Edirom</a> and the <a href="https://www.oeaw.ac.at/acdh">Austrian Centre for Digital Humanities and Cultural Heritage (ACDH-CH)</a> both for the production of
<p>Mer<span class="logo_color">MEI</span>d is a community effort coordinated by <a href="https://edirom.de">ViFE –
Virtueller Forschungsverbund Edirom</a> and the <a href="https://www.oeaw.ac.at/acdh">Austrian
Centre for Digital Humanities and Cultural Heritage (ACDH-CH)</a> both for the production of
thematic catalogues of works and for organizing source- and
work-related information during the preparation of scholarly editions
of music. More information available at
Expand All @@ -48,7 +45,7 @@ <h2>Try it!</h2>
target="manual">manual</a>
(opens in a new window or tab) which also includes a list of frequently asked questions.&#160;</p>

<p><button onclick="location.href='modules/list_files.xq'">Try Mer<span
<p><button onclick="location.href='index.html'">Try Mer<span
class="logo_color">MEI</span>d</button></p>

<h2>What you can do with the demo</h2>
Expand All @@ -66,7 +63,7 @@ <h2>Setting up your own Mer<span class="logo_color">MEI</span>d server</h2>

<p>Mer<span class="logo_color">MEI</span>d is open-source software
released under the <a href="http://www.apache.org/licenses/LICENSE-2.0"
title="See Apache License 2.0" target="_blank" >Apache License version
title="See Apache License 2.0" target="_blank">Apache License version
2.0</a>. The software is available for download at <a
href="https://github.com/Edirom/MerMEId">https://github.com/Edirom/MerMEId</a></p>

Expand All @@ -75,9 +72,9 @@ <h2>Setting up your own Mer<span class="logo_color">MEI</span>d server</h2>
at <a href="https://github.com/Edirom/MerMEId">GitHub</a>.</p>

<p>This version of Mer<span class="logo_color">MEI</span>d uses
the <a href="http://www.music-encoding.org" target="_blank" title="Music Encoding Initiative">MEI</a>
the <a href="https://www.music-encoding.org" target="_blank" title="Music Encoding Initiative">MEI</a>
4.0.0 XML schema. The schema is available at <a
href="http://www.music-encoding.org/schema/">www.music-encoding.org/schema/</a>. </p>
href="https://music-encoding.org/resources/schemas.html">https://music-encoding.org/resources/schemas.html</a>. </p>
</div>
{$config:footer}
</body>
Expand Down
6 changes: 6 additions & 0 deletions controller.xql
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ else if ($exist:path eq "/") then
<redirect url="index.html"/>
</dispatch>

else if ($exist:path eq "/index.html") then
(: forward root path to index.xql :)
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<forward url="{$exist:controller}/modules/list_files.xq"/>
</dispatch>

else if (contains($exist:path, "/orbeon/")) then
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<cache-control cache="yes"/>
Expand Down
6 changes: 5 additions & 1 deletion filter/xsl/mermeid_configuration.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dcm="http://www.kb.dk/dcm"
xmlns:xf="http://www.w3.org/2002/xforms"
version="2.0">
version="3.0">

<xsl:param name="xslt.resources-endpoint"/>

<xsl:param name="xslt.orbeon-endpoint"/>
<xsl:param name="xslt.exist-endpoint-seen-from-orbeon"/>
<xsl:param name="xslt.server-name"/>
<xsl:param name="xslt.document-root"/>
<xsl:param name="xslt.footer"/>

<xsl:variable name="xforms-parameters" as="element(dcm:parameters)">
<parameters xmlns="http://www.kb.dk/dcm">
Expand Down Expand Up @@ -48,6 +49,9 @@
<!-- Enable code inspector component? -->
<code_inspector_main_switch>true</code_inspector_main_switch>

<footer>
<xsl:value-of select="$xslt.footer"/>
</footer>

<!-- Some elements used internally by XForms - not for user configuration -->
<xml_file/>
Expand Down
89 changes: 15 additions & 74 deletions forms/edit-form-footer.xml
Original file line number Diff line number Diff line change
@@ -1,74 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<h:span xmlns:h="http://www.w3.org/1999/xhtml"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:m="http://www.music-encoding.org/ns/mei"
xmlns:dcm="http://www.kb.dk/dcm">

<!-- Footer -->

<h:div class="logo">
<xf:trigger appearance="minimal">
<xf:label>
<h:img alt="MerMEId - logo"
title="About MerMEId"
src="{instance('parameters')/dcm:server_name}/editor/images/mermeid_12px.png"
border="0"/>
</xf:label>
<xxf:show dialog="about-dialog" ev:event="DOMActivate"/>
</xf:trigger>
</h:div>


<xxf:dialog id="about-dialog"
appearance="full"
level="modal"
close="true"
draggable="false"
visible="false">

<h:div class="about_header">
<h:img src="/editor/images/mermeid_30px.png"
alt="MerMEId logo" border="0"
style="margin-bottom: 10px;"/>
</h:div>

<h:div class="about_main">

<!--<p style="text-align:center">
<xi:include href="/editor/version.txt" parse="text"/>
</p>-->
<h:p style=""> </h:p>

<h:p>MerMEId (Metadata Editor and Repository for MEI Data) is written
and distributed by:</h:p>

<h:p>Danish Centre for Music Editing (DCM)<h:br/>
<h:a href="http://www.kb.dk/">Royal Danish Library</h:a><h:br/>
P.O.Box 2149<h:br/>
DK - 1016 Copenhagen<h:br/></h:p>

<h:p>Authors: Sigfrid Lundberg (<h:a href="mailto:[email protected]">[email protected]</h:a>)
&amp; Axel Teich Geertinger (<h:a href="mailto:[email protected]">[email protected]</h:a>)</h:p>

<h:p>MerMEId is open-source software released under the <h:a
href="http://www.apache.org/licenses/LICENSE-2.0" title="See
Apache License 2.0" target="_blank" >Apache License version
2.0</h:a></h:p>
<h:p>The software is provided "as is". Use at own risk. Neither the authors, DCM, <h:br/>
nor the Royal Danish Library can be held responsible for any costs or loss of data <h:br/>
caused by the use of this software.</h:p>

</h:div>

<h:div class="about_footer">
<h:img src="/editor/images/dcm_logo_long_text_dark.png" alt="DCM logo" border="0"
style="margin-right:30px;"/>
<h:a href="http://www.kb.dk/en/"
title="Royal Danish Library"><h:img src="/editor/images/kb.png"
alt="Royal Danish Library - Logo" border="0"/></h:a>
</h:div>
</xxf:dialog>
</h:span>
<?xml version="1.0" encoding="UTF-8"?>
<h:div xmlns:h="http://www.w3.org/1999/xhtml"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:m="http://www.music-encoding.org/ns/mei"
xmlns:dcm="http://www.kb.dk/dcm">

<!-- Footer -->
<!-- Taken from properties.xml -->

<xf:output ref="instance('parameters')/dcm:footer" mediatype="text/html"/>

</h:div>
1 change: 1 addition & 0 deletions forms/edit-form-head.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<h:style type="text/css" media="all">
@import "/editor/style/tab_style.css";
@import "/editor/style/xform_style.css";
@import "/editor/style/footer.css";
</h:style>

<xf:model>
Expand Down
4 changes: 2 additions & 2 deletions forms/includes/topmenu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@
title="Close editor and return to file list" border="0"/></xf:label>
<xf:action ev:event="DOMActivate">
<xf:action if="instance('temp')/changed='true'">
<xf:var name="uri" select="concat(instance('parameters')/dcm:server_name,'/modules/list_files.xq')"/>
<xf:var name="uri" select="concat(instance('parameters')/dcm:server_name,'/index.html')"/>
<xf:setvalue ref="instance('temp')/target_uri" value="$uri"/>
<xxf:show dialog="exit-warning-dialog"/>
</xf:action>
<xf:action if="instance('temp')/changed='false'">
<xf:load resource="{instance('parameters')/dcm:server_name}/modules/list_files.xq" show="replace"/>
<xf:load resource="{instance('parameters')/dcm:server_name}/index.html" show="replace"/>
</xf:action>
</xf:action>
</xf:trigger><xf:trigger appearance="minimal">
Expand Down
7 changes: 3 additions & 4 deletions modules/transform.xq
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
xquery version "3.1";

declare namespace exist="http://exist.sourceforge.net/NS/exist";
declare namespace output="http://www.w3.org/2010/xslt-xquery-serialization";

import module namespace transform = "http://exist-db.org/xquery/transform";

import module namespace config="https://github.com/edirom/mermeid/config" at "config.xqm";

import module namespace console="http://exist-db.org/xquery/console";

declare option exist:serialize "method=xml media-type=application/xml";

let $inputDoc := (doc(request:get-attribute('transform.doc')), request:get-data())[1]
let $footer := config:get-property('footer') => config:replace-properties() => serialize(<output:serialization-parameters><output:method>xml</output:method></output:serialization-parameters>)

return transform:transform($inputDoc, doc(request:get-attribute('transform.stylesheet')), <parameters>
<param name="xslt.resources-endpoint" value="{config:get-property('exist_endpoint')}/resources"/>
<param name="xslt.exist-endpoint-seen-from-orbeon" value="{$config:exist-endpoint-seen-from-orbeon}"/>
<param name="xslt.orbeon-endpoint" value="{$config:orbeon-endpoint}"/>
<param name="xslt.server-name" value="{config:get-property('exist_endpoint')}"/>
<param name="xslt.document-root" value="/data/"/>
<param name="xslt.footer" value="{$footer}"/>
</parameters>, <attributes></attributes>, "method=xml media-type=application/xml")
6 changes: 6 additions & 0 deletions properties.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@
<img id="github-contributors" src="https://contrib.rocks/image?repo=Edirom/MerMEId" alt="Avatars of contributors to MerMEId in GitHub" />
</a>
</div>
<div class="nav">
<ul>
<li><a href="/index.html">Home</a></li>
<li><a href="/about.html">About</a></li>
</ul>
</div>
</div>
</footer>

Expand Down
48 changes: 48 additions & 0 deletions resources/css/footer.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Dedicated CSS file for styling of footer
* to be used both in list view and forms
*/
div.footer, p.footer {
margin: 0 -20px 20px -20px;
padding: 10px 20px;
}

.footer, .footer a:link, .footer a:visited, .footer a:active {
color: #ccc;
}

div.footer .version {
margin-top: 12px;
float:right;
}

div.footer div.dev{
margin-top: 10px;
}

div.footer img{
vertical-align: middle;
margin-left: 10px;
}

div.footer #dcm-logo{
height:30px;
}

div.footer #github-contributors{
height: 23px;
}

.footer .nav {
text-align:center;
}

.footer .nav ul {
padding:0;
}

.footer .nav li {
list-style-type:none;
margin: 0 2em;
display:inline;
}
36 changes: 4 additions & 32 deletions resources/css/list_style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Main CSS file used in various places
*/
@import url(footer.css);
body {
font-size: .8em;
font-family: arial, helvetica, sans-serif;
Expand Down Expand Up @@ -31,38 +35,6 @@ div.nav_bar {
border: none;
}

div.footer, p.footer {
margin: 0 -20px 20px -20px;
padding: 10px 20px;
}

.footer, .footer a:link, .footer a:visited, .footer a:active {
color: #ccc;
}

div.footer .version {
margin-top: 12px;
float:right;
}

div.footer div.dev{
margin-top: 10px;
}

div.footer img{
vertical-align: middle;
margin-left: 10px;
}

div.footer #dcm-logo{
height:30px;
}

div.footer #github-contributors{
height: 23px;
}


h2 {
margin-bottom: 0;
}
Expand Down
2 changes: 1 addition & 1 deletion testing/src/test/java/mermeid/Common.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static void enterLogin(){
String loginText = "";
String loginUser = "mermeid";
String loginPass = "mermeid";
driver.get("http://localhost:8080/modules/list_files.xq");
driver.get("http://localhost:8080/index.html");
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10));

try {
Expand Down
8 changes: 1 addition & 7 deletions testing/src/test/java/mermeid/EditorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,8 @@ public void OpenEditPage(){

String title = driver.getTitle();
System.out.println("Title: " + title);
assertTrue(title.equals("MerMEId – Metadata Editor and Repository for MEI Data"));
assertTrue(title.equals("All documents"));

WebElement button = driver.findElement(By.cssSelector("button"));
String buttonText = button.getText();
System.out.print("Function `OpenEditPage` log: ");
System.out.println(buttonText);

assertTrue(buttonText.equals("Try MerMEId"));

Common.enterLogin();
WebElement editButton = driver.findElement(By.xpath("//form[@action='http://localhost:8080/forms/edit-work-case.xml'][input/@value='incipit_demo.xml']/button"));
Expand Down

0 comments on commit e0251fb

Please sign in to comment.