From: Olivier G. <og...@us...> - 2007-05-03 21:06:03
|
Update of /cvsroot/osmose-dev/osmose/src/osmose/application/file In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21458/osmose/src/osmose/application/file Modified Files: OSMFile.java Log Message: Added export to OPML. Index: OSMFile.java =================================================================== RCS file: /cvsroot/osmose-dev/osmose/src/osmose/application/file/OSMFile.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OSMFile.java 1 Feb 2006 19:25:57 -0000 1.2 --- OSMFile.java 3 May 2007 21:06:01 -0000 1.3 *************** *** 37,46 **** --- 37,56 ---- public static final String OSM_XML_ENCODING="ISO-8859-1"; + public static final String OSM_OPML_ENCODING="ISO-8859-1"; public static final String OSM_XML_PREFACE="<?xml version='1.0' encoding='" + OSM_XML_ENCODING + "'?>\n"; + public static final String OSM_OPML_PREFACE="<opml version='1.0'>\n"; public static final String OSM_DOC_TAG="document"; + public static final String OSM_OPML_TAG="opml"; + public static final String OSM_OPML_BODY_TAG="body"; + public static final String OSM_OPML_HEAD_TAG="head"; + public static final String OSM_OPML_TITLE_TAG="title"; + public static final String OSM_OPML_NAME_TAG="name"; + public static final String OSM_OPML_AUTHOR_TAG="author"; + public static final String OSM_OPML_DATE_TAG="date"; public static final String OSM_SOFT_VERSION="soft-version"; public static final String OSM_DOC_ATT_TYPE="type"; public static final String OSM_DOC_ATT_LASTID="lastid"; public static final String OSM_ELT_TAG="element"; + public static final String OSM_OUTLINE_TAG="outline"; public static final String OSM_ELTURL_TAG="url"; public static final String OSM_ELT_ATT_ONLINE="ontheline"; *************** *** 186,189 **** --- 196,222 ---- return str; } + + /** + * A method to build an OPML opening tag with an attribute. + * @param tag the label of the tag + * @param att the attribute of the tag + * @return the string for this opening tag + */ + public static String getTagopml1(String tag, String att) + { + String str = "<" + tag + " " + "text=\"" + att + "\">"; + return str; + } + + /** + * A method to build an OPML closing tag. + * @param tag the label of the tag + * @return the string for this closing tag + */ + public static String getTagopml2(String tag) + { + String str = "</" + tag + ">"; + return str; + } /** *************** *** 360,362 **** } ! } \ No newline at end of file --- 393,395 ---- } ! } |