Subversion Repositories general

Rev

Rev 240 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
240 swalkenh 1
PK
260 swalkenh 2
 
3
 
240 swalkenh 4
×Z6META-INF/MANIFEST.MFManifest-Version: 1.0
5
Comment: you can view images with this plugin
6
Transform-To-File: src/plugins/imagePlugin/ImagePluginTransform.xsl
7
Created-By: 1.4.0 (Sun Microsystems Inc.)
8
Description: ...(todo)
9
XMLEditor-Plugin-Name: ImageViewer
10
Class-Path: 
11
Transform-Fro-File: src/plugins/imagePlugin/ImagePluginTransformBack.x
12
 sl
13
Main-Class: src.plugins.imagePlugin.ImagePlugin
14
 
15
Name: src/plugins/imagePlugin
16
Specification-Version: 0.4 (05/07/03)
17
Specification-Title: plugin for XMLEditor
18
Implementation-Version: 0.2 (05/07/03)
19
Implementation-Title: src.plugins.imagePlugin
20
Implementation-Vendor: group5, software practice SS_2003, University B
21
 ielefeld, Germany
22
Specification-Vendor: group5, software practice SS_2003, University Bi
23
 elefeld, Germany
24
 
25
PK
260 swalkenh 26
 
240 swalkenh 27
 
28
 
29
 
30
SourceFileImagePlugin.java!	
31
 
32
	7	²¶!±
33
 
34
 
35
 
260 swalkenh 36
 
37
* ss_2003
38
* group project: XML-Editor
39
* $Id: ImagePlugin.java,v 1.1 2003/07/07 09:44:34 swalkenh Exp $
40
*/
41
42
 
43
44
 
45
import javax.swing.*;
46
import java.util.Map;
47
import org.w3c.dom.Element;
48
49
 
50
51
 
52
* image plugin shows any images
53
*
54
* @author Yulia Klassen
55
* @author Viktoria Zudova
56
*/
57
public class ImagePlugin extends JPanel
58
						 implements PluginInterface
59
{
60
	
61
 
62
	
63
 
64
	{
65
	}
66
	
67
 
68
		System.out.println("main method of image plugin");
69
	}
70
	
71
 
72
	{
73
	}
74
	
75
 
76
	{
77
	}
78
	
79
 
80
	{
81
	}
82
	
83
 
84
	{
85
	}
86
	
87
 
88
 
89
PK
240 swalkenh 90
‘]ç.V@ƒÃÃ0src/plugins/imagePlugin/ImagePluginTransform.xsl<!-- status: first working for pictureviewer -->
260 swalkenh 91
 
92
<xsl:output method="xml" indent="yes" />
93
94
 
95
<xsl:param name="input">/</xsl:param><!-- eg. /XMLEDITORCONFIGURATION/DEFAULTPLUGIN -->
96
<xsl:param name="elementnamenew">standardplugin</xsl:param>
97
98
 
99
	<xsl:variable name="levelremaining" select="substring-after($input, '/')" />
100
101
 
102
	<xsl:message><xsl:value-of select="concat('outside-parameter elementnamenew: ', $elementnamenew)"/></xsl:message>
103
104
 
105
		<xsl:call-template name="selecter">
106
			<xsl:with-param name="levelremaining" select="$levelremaining" />
107
		</xsl:call-template>
108
	</xsl:for-each>
109
</xsl:template>
110
111
 
112
	<xsl:param name="levelremaining" />
113
	<xsl:variable name="level" select="substring-before( concat($levelremaining, '/'), '/')" />
114
	<xsl:variable name="nextlevels" select="substring-after($levelremaining, '/')" />
115
	
116
 
117
	     then work on childs with the selecter -->
118
	<xsl:if test = "(name() = $level)">
119
		<xsl:message>selecter-case: belongs to right path</xsl:message>
120
		<xsl:element name="name()">
121
		
122
 
123
			     then convert the node -->
124
			<xsl:if test = "( ('' = $nextlevels) 
125
		    	              and not('' = name()) )"><!-- avoid too many tags from matcher -->
126
				<xsl:message>selecter-case: last level</xsl:message>
127
				<xsl:apply-templates select="self::node()">
128
				</xsl:apply-templates>
129
			</xsl:if>
130
			<!-- else (if there are levels left) work on childs -->
131
			<xsl:if test = "not('' = $nextlevels)">
132
				<xsl:message>selecter-case: levels left</xsl:message>
133
				<xsl:copy>
134
					<xsl:for-each select="attribute::*">
135
						<xsl:attribute name="{name(.)}">
136
							<xsl:value-of select="self::node()" />
137
						</xsl:attribute>
138
					</xsl:for-each>
139
					<xsl:for-each select="node()">
140
						<xsl:call-template name="selecter">
141
							<xsl:with-param name="levelremaining" select="$nextlevels" />
142
						</xsl:call-template>
143
					</xsl:for-each>
144
				</xsl:copy>
145
			</xsl:if>
146
		</xsl:element>
147
	</xsl:if>
148
	<!-- else simply copy the node with childs -->
149
	<xsl:if test = "not(name() = $level)">
150
		<xsl:message>selecter-case: must only be copied and never touched in future</xsl:message>
151
		<xsl:copy-of select="self::node()" />
152
	</xsl:if>
153
</xsl:template>
154
155
 
156
	<xsl:element name="IMAGE">
157
		<!-- work on attributes and childs -->
158
		<xsl:attribute name="name">
159
			<xsl:value-of select="@label" />
160
		</xsl:attribute>
161
		<xsl:attribute name="url">
162
			<xsl:value-of select="@url" />
163
		</xsl:attribute>
164
		<xsl:for-each select="attribute::*">
165
			<xsl:if test = "not(name(.) = ('label'))">
166
			<xsl:if test = "not(name(.) = ('url'))">
167
				<xsl:attribute name="{name(.)}">
168
					<xsl:value-of select="self::node()" />
169
				</xsl:attribute>
170
			</xsl:if></xsl:if>
171
		</xsl:for-each>
172
		<xsl:for-each select="node()">
173
			<xsl:copy-of select="self::node()" />
174
		</xsl:for-each>
175
	</xsl:element>
176
</xsl:template>
177
178
 
179
	<xsl:element name="IMAGE">
180
		<!-- work on attributes and childs -->
181
		<xsl:attribute name="name">
182
			<xsl:value-of select="@Name" />
183
		</xsl:attribute>
184
		<xsl:attribute name="url">
185
			<xsl:value-of select="@Pfad" />
186
		</xsl:attribute>
187
		<xsl:for-each select="attribute::*">
188
			<xsl:if test = "not(name(.) = ('Name'))">
189
			<xsl:if test = "not(name(.) = ('Pfad'))">
190
				<xsl:attribute name="{name(.)}">
191
					<xsl:value-of select="self::node()" />
192
				</xsl:attribute>
193
			</xsl:if></xsl:if>
194
		</xsl:for-each>
195
		<xsl:for-each select="node()">
196
			<xsl:copy-of select="self::node()" />
197
		</xsl:for-each>
198
	</xsl:element>
199
</xsl:template>
200
201
 
202
	<xsl:element name="IMAGE">
203
		<!-- work on attributes and childs -->
204
		<xsl:attribute name="name">
205
			<xsl:value-of select="@Name" />
206
		</xsl:attribute>
207
		<xsl:attribute name="url">
208
			<xsl:value-of select="@Path" />
209
		</xsl:attribute>
210
		<xsl:for-each select="attribute::*">
211
			<xsl:if test = "not(name(.) = ('Name'))">
212
			<xsl:if test = "not(name(.) = ('Path'))">
213
				<xsl:attribute name="{name(.)}">
214
					<xsl:value-of select="self::node()" />
215
				</xsl:attribute>
216
			</xsl:if></xsl:if>
217
		</xsl:for-each>
218
		<xsl:for-each select="node()">
219
			<xsl:copy-of select="self::node()" />
220
		</xsl:for-each>
221
	</xsl:element>
222
</xsl:template>
223
224
 
225
	<xsl:copy-of select="." />
226
</xsl:template>
227
228
 
240 swalkenh 229
‘]ç.WjQμ¼4src/plugins/imagePlugin/ImagePluginTransformBack.xsl<!-- status: first try for pictureviewer -->
260 swalkenh 230
 
231
<xsl:output method="xml" indent="yes" />
232
233
 
234
<xsl:param name="input">/</xsl:param><!-- eg. /XMLEDITORCONFIGURATION/DEFAULTPLUGIN -->
235
<xsl:param name="elementnamenew">standardplugin</xsl:param>
236
237
 
238
	<xsl:variable name="levelremaining" select="substring-after($input, '/')" />
239
240
 
241
	<xsl:message><xsl:value-of select="concat('outside-parameter elementnamenew: ', $elementnamenew)"/></xsl:message>
242
243
 
244
		<xsl:call-template name="selecter">
245
			<xsl:with-param name="levelremaining" select="$levelremaining" />
246
		</xsl:call-template>
247
	</xsl:for-each>
248
</xsl:template>
249
250
 
251
	<xsl:param name="levelremaining" />
252
	<xsl:variable name="level" select="substring-before( concat($levelremaining, '/'), '/')" />
253
	<xsl:variable name="nextlevels" select="substring-after($levelremaining, '/')" />
254
	
255
 
256
	     then work on childs with the selecter -->
257
	<xsl:if test = "(name() = $level)">
258
		<xsl:message>selecter-case: belongs to right path</xsl:message>
259
		<xsl:element name="name()">
260
		
261
 
262
			     then convert the node -->
263
			<xsl:if test = "( ('' = $nextlevels) 
264
		    	              and not('' = name()) )"><!-- avoid too many tags from matcher -->
265
				<xsl:message>selecter-case: last level</xsl:message>
266
				<xsl:apply-templates select="self::node()">
267
				</xsl:apply-templates>
268
			</xsl:if>
269
			<!-- else (if there are levels left) work on childs -->
270
			<xsl:if test = "not('' = $nextlevels)">
271
				<xsl:message>selecter-case: levels left</xsl:message>
272
				<xsl:copy>
273
					<xsl:for-each select="attribute::*">
274
						<xsl:attribute name="{name(.)}">
275
							<xsl:value-of select="self::node()" />
276
						</xsl:attribute>
277
					</xsl:for-each>
278
					<xsl:for-each select="node()">
279
						<xsl:call-template name="selecter">
280
							<xsl:with-param name="levelremaining" select="$nextlevels" />
281
						</xsl:call-template>
282
					</xsl:for-each>
283
				</xsl:copy>
284
			</xsl:if>
285
		</xsl:element>
286
	</xsl:if>
287
	<!-- else simply copy the node with childs -->
288
	<xsl:if test = "not(name() = $level)">
289
		<xsl:message>selecter-case: must only be copied and never touched in future</xsl:message>
290
		<xsl:copy-of select="self::node()" />
291
	</xsl:if>
292
</xsl:template>
293
294
 
295
	<xsl:element name="PHOTO">
296
		<!-- work on attributes and childs -->
297
		<xsl:attribute name="label">
298
			<xsl:value-of select="@name" />
299
		</xsl:attribute>
300
		<xsl:attribute name="url">
301
			<xsl:value-of select="@url" />
302
		</xsl:attribute>
303
		<xsl:for-each select="attribute::*">
304
			<xsl:if test = "not(name(.) = ('name'))">
305
			<xsl:if test = "not(name(.) = ('url'))">
306
				<xsl:attribute name="{name(.)}">
307
					<xsl:value-of select="self::node()" />
308
				</xsl:attribute>
309
			</xsl:if></xsl:if>
310
		</xsl:for-each>
311
		<xsl:for-each select="node()">
312
			<xsl:copy-of select="self::node()" />
313
		</xsl:for-each>
314
	</xsl:element>
315
</xsl:template>
316
317
 
318
	<xsl:element name="Bild">
319
		<!-- work on attributes and childs -->
320
		<xsl:attribute name="Name">
321
			<xsl:value-of select="@name" />
322
		</xsl:attribute>
323
		<xsl:attribute name="Pfad">
324
			<xsl:value-of select="@url" />
325
		</xsl:attribute>
326
		<xsl:for-each select="attribute::*">
327
			<xsl:if test = "not(name(.) = ('name'))">
328
			<xsl:if test = "not(name(.) = ('url'))">
329
				<xsl:attribute name="{name(.)}">
330
					<xsl:value-of select="self::node()" />
331
				</xsl:attribute>
332
			</xsl:if></xsl:if>
333
		</xsl:for-each>
334
		<xsl:for-each select="node()">
335
			<xsl:copy-of select="self::node()" />
336
		</xsl:for-each>
337
	</xsl:element>
338
</xsl:template>
339
340
 
341
	<xsl:element name="Picture">
342
		<!-- work on attributes and childs -->
343
		<xsl:attribute name="Name">
344
			<xsl:value-of select="@name" />
345
		</xsl:attribute>
346
		<xsl:attribute name="Path">
347
			<xsl:value-of select="@url" />
348
		</xsl:attribute>
349
		<xsl:for-each select="attribute::*">
350
			<xsl:if test = "not(name(.) = ('name'))">
351
			<xsl:if test = "not(name(.) = ('url'))">
352
				<xsl:attribute name="{name(.)}">
353
					<xsl:value-of select="self::node()" />
354
				</xsl:attribute>
355
			</xsl:if></xsl:if>
356
		</xsl:for-each>
357
		<xsl:for-each select="node()">
358
			<xsl:copy-of select="self::node()" />
359
		</xsl:for-each>
360
	</xsl:element>
361
</xsl:template>
362
363
 
364
	<xsl:copy-of select="." />
365
</xsl:template>
366
367
 
240 swalkenh 368
369
 
260 swalkenh 370
 
240 swalkenh 371
 
260 swalkenh 372
 
240 swalkenh 373
374
 
260 swalkenh 375
 
240 swalkenh 376
 
260 swalkenh 377
 
240 swalkenh 378
 
260 swalkenh 379
 
240 swalkenh 380