Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Stephane Crozat
hdoc
Commits
ba3ab404
Commit
ba3ab404
authored
Dec 17, 2015
by
crzt
Browse files
Merge branch 'master' of
https://gitlab.utc.fr/crozatst/hdoc
parents
bee6ff6c
cb36f02c
Changes
7
Hide whitespace changes
Inline
Side-by-side
hdoc_to_optim/hdoc_to_optim.ant
View file @
ba3ab404
<project name="hdoc_to_optim" default="convert">
<!-- Arguments properties -->
<property name="InputPath" value="input" />
<property name="OutputPath" value="output" />
<property name="OutputScarPath" value="${OutputPath}/result.scar" />
<target name="convert">
<!-- get input hdoc file path -->
<fileset id="fileset_hdoc" dir="${InputPath}" casesensitive="yes">
<include name="*.hdoc"/>
</fileset>
<pathconvert property="HdocPath" pathsep="" refid="fileset_hdoc" />
<!--unzips the hdoc to be converted-->
<unzip dest="hdoc" src ="${InputPath}"/>
<!--gives all rights to avoid bugs-->
<unzip dest="hdoc" src ="${HdocPath}"/>
<!--gives all rights to avoid bugs-->
<chmod dir="hdoc" perm="777"/>
<!--launches the XSLT find_content to retrieve the content path-->
<xslt in="hdoc/META-INF/container.xml" out="get_content.ant" style="find_content.xsl"/>
<!--launches the XSLT find_content to retrieve the content path-->
<xslt in="hdoc/META-INF/container.xml" out="get_content.ant" style="xsl/find_content.xsl"/>
<chmod file="get_content.ant" perm="777"/>
<!--launches the ANT get_content resulting from the previous XSLT in order to launch the conversion-->
<!--launches the ANT get_content resulting from the previous XSLT in order to launch the conversion-->
<ant antfile="get_content.ant"/>
<!--once the conversion is complete, the result is zipped-->
<zip basedir="result" destfile="${OutputPath}"/>
<!--temporary files and folders are deleted-->
<!--once the conversion is complete, the result is zipped-->
<zip basedir="result" destfile="${OutputScarPath}"/>
<!--temporary files and folders are deleted-->
<delete dir="hdoc"/>
<delete dir="result"/>
<delete file="get_content.ant"/>
<delete file="get_ressources.ant"/>
</target>
</project>
\ No newline at end of file
hdoc_to_optim/run.bat
View file @
ba3ab404
@echo
off
set
lib
=
lib
set
ant
=
myantce
.ant
set
ant
=
hdoc_to_optim
.ant
set
antparam
=
-Dprogram
.param
=
%
1
set
scJarList
=
%lib%
\
*
...
...
hdoc_to_optim/run.sh
View file @
ba3ab404
#!/bin/sh
lib
=
"lib"
ant
=
"
myantce
.ant"
ant
=
"
hdoc_to_optim
.ant"
antparam
=
"-Dprogram.param=
$1
"
#Recherche de java et controle que se soit une version SUN
...
...
hdoc_to_optim/xsl/find_content.xsl
View file @
ba3ab404
...
...
@@ -4,14 +4,14 @@
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
version=
"2.0"
xmlns:h=
"urn:utc.fr:ics:hdoc:container"
xmlns:xs=
"http://www.w3.org/2001/XMLSchema"
>
<xsl:param
name=
"destfile"
required=
"yes"
as=
"xs:string"
/>
<!--
<xsl:param name="destfile" required="yes" as="xs:string"/>
-->
<xsl:output
method=
"xml"
indent=
"yes"
/>
<xsl:template
match=
"h:container"
>
<project
name=
"hdoc_to_optim"
default=
"main"
>
<target
name=
"main"
>
<mkdir
dir=
"result"
/>
<chmod
dir=
"result"
perm=
"777"
/>
<copy
file=
".wspmeta"
todir=
"result"
/>
<copy
file=
"
output/
.wspmeta"
todir=
"result"
/>
<xsl:apply-templates/>
</target>
</project>
...
...
@@ -24,10 +24,10 @@
<xsl:template
match=
"h:rootfile"
>
<xsl:variable
name=
"path"
select=
"@full-path"
/>
<!--the ANT runs the XSLT get_ressources then the ANT created by it-->
<xslt
in=
"hdoc/{$path}"
out=
"get_ressources.ant"
style=
"find_ressources.xsl"
/>
<xslt
in=
"hdoc/{$path}"
out=
"get_ressources.ant"
style=
"
xsl/
find_ressources.xsl"
/>
<chmod
file=
"get_ressources.ant"
perm=
"777"
/>
<ant
antfile=
"get_ressources.ant"
/>
<!--the ANT runs the main XSLT transfo-->
<xslt
in=
"hdoc/{$path}"
out=
"result/content.paper"
style=
"transfo.xsl"
/>
<xslt
in=
"hdoc/{$path}"
out=
"result/content.paper"
style=
"
xsl/
transfo.xsl"
/>
</xsl:template>
</xsl:stylesheet>
opale_to_hdoc/opale_to_hdoc.ant
View file @
ba3ab404
<project name="ProjetOpale" default="convert">
<!-- Arguments properties -->
<property name="InputPath" value="source.scar" />
<property name="OutputPath" value="result.hdoc" />
<!-- Other properties -->
<property name="UnzipSourcePath" value="
U
nzipSourcePath" />
<property name="UnzipSourcePath" value="
u
nzipSourcePath" />
<property name="XmlModuleName" value="" />
<property name="TmpPath" value="
T
mp
Path
" />
<property name="TmpFile1" value="
T
mpFile1.xml" />
<property name="TmpPath" value="
t
mp" />
<property name="TmpFile1" value="
t
mpFile1.xml" />
<property name="RacineFile" value="content.xml" />
<property name="HdocPath" value="hdoc" />
<property name="OutputPath" value="output" />
<property name="HdocPath" value="${OutputPath}/hdoc" />
<property name="ZipPath" value="${OutputPath}/result.hdoc" />
<!-- Others properties (in another file) currently empty -->
<property file="opale_to_hdoc.properties" />
...
...
@@ -60,7 +58,12 @@
<!-- Unzip scar source file -->
<target name="unzip_scar">
<unzip src="${InputPath}" dest="./${UnzipSourcePath}"/>
<!-- get scar file path -->
<fileset id="fileset_scar" dir="input" casesensitive="yes">
<include name="*.scar"/>
</fileset>
<pathconvert property="scar.path" pathsep="" refid="fileset_scar" />
<unzip src="${scar.path}" dest="./${UnzipSourcePath}"/>
</target>
<!-- Create the hdoc structure -->
...
...
@@ -70,8 +73,8 @@
<touch file="${HdocPath}/META-INF/container.xml" />
<touch file="${HdocPath}/mimetype" />
<echo message="application/x-hdoc+zip" file="${HdocPath}/mimetype" />
<echoxml file="${HdocPath}/META-INF/container.xml">
<container version="1.0">
<echoxml file="${HdocPath}/META-INF/container.xml"
namespacePolicy="elementsOnly"
>
<container
xmlns="urn:utc.fr:ics:hdoc:container"
version="1.0">
<rootfiles>
<rootfile full-path="${HdocPath}/${RacineFile}" media-type="text/xml" />
</rootfiles>
...
...
@@ -89,18 +92,18 @@
<pathconvert property="xml.path" pathsep="" refid="fileset_source_xml" />
<!-- xsl -->
<xslt style="opale_to_hdoc_regle1.xsl" in="${xml.path}" out="./${TmpPath}/${TmpFile1}">
<xslt style="
xsl/
opale_to_hdoc_regle1.xsl" in="${xml.path}" out="./${TmpPath}/${TmpFile1}">
</xslt>
</target>
<!-- Create content.xml -->
<target name="content_xml">
<xslt style="opale_to_hdoc_regle2.xsl" in="./${TmpPath}/${TmpFile1}" out="./${HdocPath}/${RacineFile}" />
<xslt style="
xsl/
opale_to_hdoc_regle2.xsl" in="./${TmpPath}/${TmpFile1}" out="./${HdocPath}/${RacineFile}" />
</target>
<!-- Zip Hdoc -->
<target name="zip">
<zip destfile="${
Output
Path}" basedir="${HdocPath}"/>
<zip destfile="${
Zip
Path}" basedir="${HdocPath}"/>
</target>
</project>
\ No newline at end of file
opale_to_hdoc/run.bat
View file @
ba3ab404
@echo
off
set
lib
=
lib
set
ant
=
myantce
.ant
set
ant
=
opale_to_hdoc
.ant
set
antparam
=
-Dprogram
.param
=
%
1
set
scJarList
=
%lib%
\
*
...
...
opale_to_hdoc/run.sh
View file @
ba3ab404
#!/bin/sh
lib
=
"lib"
ant
=
"
myantce
.ant"
ant
=
"
opale_to_hdoc
.ant"
antparam
=
"-Dprogram.param=
$1
"
#Recherche de java et controle que se soit une version SUN
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment