01 /*
02 * Sitemap.java
03 * Copyright (c) 1998-2008, The University of Sheffield.
04 *
05 * This code is from the GATE project (http://gate.ac.uk/) and is free
06 * software licenced under the GNU General Public License version 3. It is
07 * distributed without any warranty. For more details see COPYING.txt in the
08 * top level directory (or at http://gatewiki.sf.net/COPYING.txt).
09 *
10 * Hamish Cunningham, 31st August 2009
11 */
12
13 package gate.yam.plugins;
14
15 import java.util.*;
16 import java.io.*;
17 import gate.yam.YamPlugin;
18 import gate.yam.translate.AbstractTranslator;
19 import gate.util.Files;
20
21 /**
22 * Sitemap plugin for YAM.
23 * @author Hamish Cunningham
24 */
25 public class Sitemap implements YamPlugin {
26 /**
27 * Translate Sitemap updates in YAM pages.
28 *
29 * @param m a map of arguments from the YAM source
30 * @param t the translator that is converting the YAM document
31 * @param target the target output language
32 * @return the translation for insertion at the plugin call location
33 *
34 * An example call:
35 * %sitemap()
36 */
37 public String translate(Map m, AbstractTranslator t, String target) {
38
39 if(target.equals("Html")) { // html output
40 StringBuilder body = new StringBuilder();
41
42 for(String key : (Set<String>) m.keySet()) {
43 }
44
45 //TODO
46 // for each .yam under the current dir, (using the IO handler?)
47 // append the title and all the links in the file to body
48
49 return body.toString();
50
51 } else if(target.equals("LaTeX")) { // latex output
52
53 //TODO
54 return m.toString();
55 }
56
57 // catchall for other output types
58 return m.toString();
59 } // String translate(Map, AbstractTranslator, String)
60
61 } // Sitemap
|