source: main/trunk/greenstone3/web/interfaces/default_new/transform/depositor/de_page4.xsl@ 29852

Last change on this file since 29852 was 29852, checked in by Georgiy Litvinov, 9 years ago

Ckeditor integration commit

  • Property svn:executable set to *
File size: 2.7 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:java="http://xml.apache.org/xslt/java"
5 xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
6 xmlns:gslib="http://www.greenstone.org/skinning"
7 extension-element-prefixes="java util"
8 exclude-result-prefixes="java util">
9
10 <!-- set page title -->
11 <xsl:variable name="title">Deposit Item</xsl:variable>
12
13 <!-- the page content -->
14 <xsl:template name="wizardPage">
15 <div id="progressBar">Please wait...</div>
16 <script type="text/javascript">
17 <xsl:text disable-output-escaping="yes">
18 {
19 $(window).load(function()
20 {
21 $("#progressBar").html($("#progressBar").html() + "&lt;br/&gt;Moving file into collection...");
22 var url = gs.xsltParams.library_name + "?a=de&amp;sa=depositFile&amp;ro=1&amp;c=" + gs.cgiParams.c + "&amp;fileToAdd=" + gs.deSavedMetadata["md___ex.Filename"];
23 $.ajax(url).success(function(response)
24 {
25 $("#progressBar").html($("#progressBar").html() + "&lt;br/&gt;Importing collection...");
26 var xml;
27 try
28 {
29 xml = $.parseXML(response.replace(/&amp;/g, "&amp;amp;"));
30 }
31 catch(e)
32 {
33 console.log("ERROR: " + e);
34 $("#progressBar").html($("#progressBar").html() + "&lt;br/&gt;There was an error on the server.");
35 return;
36 }
37
38 if(!($(xml).find("error").length))
39 {
40 var pid = $(xml).find("status").attr("pid");
41 gs.functions.startCheckLoop(pid, "ImportCollection", function()
42 {
43 $("#progressBar").html($("#progressBar").html() + "&lt;br/&gt;Building collection...");
44 gs.functions.buildCollections([gs.cgiParams.c], function()
45 {
46 $("#progressBar").html($("#progressBar").html() + "&lt;br/&gt;Collection built...");
47 $("#progressBar").html($("#progressBar").html() + "&lt;br/&gt;Reloading Greenstone...");
48 $.ajax(gs.xsltParams.library_name + "?a=s&amp;sa=c").success(function()
49 {
50 $("#progressBar").html($("#progressBar").html() + "&lt;br/&gt;Done!");
51 })
52 .error(function()
53 {
54 $("#progressBar").html($("#progressBar").html() + "&lt;br/&gt;Reload failed, please restart Greenstone manually.");
55 });
56 });
57 });
58 }
59 else
60 {
61 $("#progressBar").html($("#progressBar").html() + "&lt;br/&gt;There was an error depositing your file:");
62 $(xml).find("error").each(function()
63 {
64 $("#progressBar").html($("#progressBar").html() + "&lt;br/&gt;" + $(this).text());
65 });
66 }
67 });
68 });
69 }
70 </xsl:text>
71 </script>
72 </xsl:template>
73</xsl:stylesheet>
74
Note: See TracBrowser for help on using the repository browser.