' +
33 | '
Print page' +
34 | '
Close').hide();
35 | var print_frame = $('
');
36 |
37 | // Raise print preview window from the dead, zooooooombies
38 | print_modal
39 | .hide()
40 | .append(print_controls)
41 | .append(print_frame)
42 | .appendTo('body');
43 |
44 | // The frame lives
45 | for (var i=0; i < window.frames.length; i++) {
46 | if (window.frames[i].name == "print-frame") {
47 | var print_frame_ref = window.frames[i].document;
48 | break;
49 | }
50 | }
51 | print_frame_ref.open();
52 | print_frame_ref.write('' +
53 | '' +
54 | '
' + document.title + '' +
55 | '' +
56 | '');
57 | print_frame_ref.close();
58 |
59 | // Grab contents and apply stylesheet
60 | var $iframe_head = $('head link[media*=print], head link[media=all]').clone(),
61 | $iframe_body = $('body > *:not(#print-modal):not(script)').clone();
62 | $iframe_head.each(function() {
63 | $(this).attr('media', 'all');
64 | });
65 | if (!$.browser.msie && !($.browser.version < 7) ) {
66 | $('head', print_frame_ref).append($iframe_head);
67 | $('body', print_frame_ref).append($iframe_body);
68 | }
69 | else {
70 | $('body > *:not(#print-modal):not(script)').clone().each(function() {
71 | $('body', print_frame_ref).append(this.outerHTML);
72 | });
73 | $('head link[media*=print], head link[media=all]').each(function() {
74 | $('head', print_frame_ref).append($(this).clone().attr('media', 'all')[0].outerHTML);
75 | });
76 | }
77 |
78 | // Disable all links
79 | $('a', print_frame_ref).bind('click.printPreview', function(e) {
80 | e.preventDefault();
81 | });
82 |
83 | // Introduce print styles
84 | $('head').append(''
95 | );
96 |
97 | // Load mask
98 | $.printPreview.loadMask();
99 |
100 | // Disable scrolling
101 | $('body').css({overflowY: 'hidden', height: '100%'});
102 | $('img', print_frame_ref).load(function() {
103 | print_frame.height($('body', print_frame.contents())[0].scrollHeight);
104 | });
105 |
106 | // Position modal
107 | starting_position = $(window).height() + $(window).scrollTop();
108 | var css = {
109 | top: starting_position,
110 | height: '100%',
111 | overflowY: 'auto',
112 | zIndex: 10000,
113 | display: 'block'
114 | }
115 | print_modal
116 | .css(css)
117 | .animate({ top: $(window).scrollTop()}, 400, 'linear', function() {
118 | print_controls.fadeIn('slow').focus();
119 | });
120 | print_frame.height($('body', print_frame.contents())[0].scrollHeight);
121 |
122 | // Bind closure
123 | $('a', print_controls).bind('click', function(e) {
124 | e.preventDefault();
125 | if ($(this).hasClass('print')) { window.print(); }
126 | else { $.printPreview.distroyPrintPreview(); }
127 | });
128 | },
129 |
130 | distroyPrintPreview: function() {
131 | print_controls.fadeOut(100);
132 | print_modal.animate({ top: $(window).scrollTop() - $(window).height(), opacity: 1}, 400, 'linear', function(){
133 | print_modal.remove();
134 | $('body').css({overflowY: 'auto', height: 'auto'});
135 | });
136 | mask.fadeOut('slow', function() {
137 | mask.remove();
138 | });
139 |
140 | $(document).unbind("keydown.printPreview.mask");
141 | mask.unbind("click.printPreview.mask");
142 | $(window).unbind("resize.printPreview.mask");
143 | },
144 |
145 | /* -- Mask Functions --*/
146 | loadMask: function() {
147 | size = $.printPreview.sizeUpMask();
148 | mask = $('
').appendTo($('body'));
149 | mask.css({
150 | position: 'absolute',
151 | top: 0,
152 | left: 0,
153 | width: size[0],
154 | height: size[1],
155 | display: 'none',
156 | opacity: 0,
157 | zIndex: 9999,
158 | backgroundColor: '#000'
159 | });
160 |
161 | mask.css({display: 'block'}).fadeTo('400', 0.75);
162 |
163 | $(window).bind("resize..printPreview.mask", function() {
164 | $.printPreview.updateMaskSize();
165 | });
166 |
167 | mask.bind("click.printPreview.mask", function(e) {
168 | $.printPreview.distroyPrintPreview();
169 | });
170 |
171 | $(document).bind("keydown.printPreview.mask", function(e) {
172 | if (e.keyCode == 27) { $.printPreview.distroyPrintPreview(); }
173 | });
174 | },
175 |
176 | sizeUpMask: function() {
177 | if ($.browser.msie) {
178 | // if there are no scrollbars then use window.height
179 | var d = $(document).height(), w = $(window).height();
180 | return [
181 | window.innerWidth || // ie7+
182 | document.documentElement.clientWidth || // ie6
183 | document.body.clientWidth, // ie6 quirks mode
184 | d - w < 20 ? w : d
185 | ];
186 | } else { return [$(document).width(), $(document).height()]; }
187 | },
188 |
189 | updateMaskSize: function() {
190 | var size = $.printPreview.sizeUpMask();
191 | mask.css({width: size[0], height: size[1]});
192 | }
193 | }
194 | })(jQuery);
--------------------------------------------------------------------------------
/skos-testing-tool/src/main/webapp/welcomefile.jsp:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/skos-testing-tool/src/test/java/fr/sparna/rdf/skos/testtool/test/ValidateSkosFileTest.java:
--------------------------------------------------------------------------------
1 | package fr.sparna.rdf.skos.testtool.test;
2 |
3 | import java.io.File;
4 |
5 | import org.junit.Ignore;
6 | import org.junit.Test;
7 |
8 | import fr.sparna.rdf.skos.testtool.ExecuteQSkos;
9 |
10 | public class ValidateSkosFileTest {
11 |
12 | @Test
13 | @Ignore
14 | public void testValidate() throws Exception {
15 | ExecuteQSkos skos=new ExecuteQSkos("ilc");
16 | skos.validate(new File("/home/clarvie/test.rdf"));
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------