001: /**********************************************************************************
002:
003: Feedzeo!
004: A free and open source RSS/Atom/RDF feed aggregator
005:
006: Copyright (C) 2005-2006 Anand Rao (anandrao@users.sourceforge.net)
007:
008: This library is free software; you can redistribute it and/or
009: modify it under the terms of the GNU Lesser General Public
010: License as published by the Free Software Foundation; either
011: version 2.1 of the License, or (at your option) any later version.
012:
013: This library is distributed in the hope that it will be useful,
014: but WITHOUT ANY WARRANTY; without even the implied warranty of
015: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
016: Lesser General Public License for more details.
017:
018: You should have received a copy of the GNU Lesser General Public
019: License along with this library; if not, write to the Free Software
020: Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
021:
022: ************************************************************************************/package app;
023:
024: /**
025: *
026: * @author Anand Rao
027: */
028: public class AppCmd {
029:
030: public static final int GET_CATEGORIES = 100;
031: public static final String GET_CATEGORIES_STR = "getcategories";
032:
033: public static final int ADD_LINK = 101;
034: public static final String ADD_LINK_STR = "addlink";
035:
036: public static final int GET_FEEDNAMES = 102;
037: public static final String GET_FEEDNAMES_STR = "getfeednames";
038:
039: public static final int GET_FEEDNAMES_W_PAGE_LINK = 103;
040: public static final String GET_FEEDNAMES_W_PAGE_LINK_STR = "getfeednameswpagelink";
041:
042: public static final int GET_ALL_FEEDNAMES_W_PAGE_LINK = 104;
043: public static final String GET_ALL_FEEDNAMES_W_PAGE_LINK_STR = "getallfeednameswpagelink";
044:
045: public static final int GET_STYLE_INFO = 105;
046: public static final String GET_STYLE_INFO_STR = "getstyleinfo";
047:
048: public static final int SAVE_STYLE_INFO = 106;
049: public static final String SAVE_STYLE_INFO_STR = "savestyleinfo";
050:
051: public static final int GET_FEEDNAMES_W_TABLEDATA_PAGE_LINK = 107;
052: public static final String GET_FEEDNAMES_W_TABLEDATA_PAGE_LINK_STR = "getfeednameswtabledatapagelink";
053:
054: public static final int GET_ALL_FEEDNAMES_W_TABLEDATA_PAGE_LINK = 108;
055: public static final String GET_ALL_FEEDNAMES_W_TABLEDATA_PAGE_LINK_STR = "getallfeednameswtabledatapagelink";
056:
057: public static final int GET_FEEDNAMES_W_FEEDSOURCE_LINK = 109;
058: public static final String GET_FEEDNAMES_W_FEEDSOURCE_LINK_STR = "getfeednameswfeedsourcelink";
059:
060: public static final int DEL_LINK = 110;
061: public static final String DEL_LINK_STR = "dellink";
062:
063: public static final int GET_FEEDNAMES_W_TABLEDATA_PAGE_LINK_FRM_SOURCEURL = 111;
064: public static final String GET_FEEDNAMES_W_TABLEDATA_PAGE_LINK_FRM_SOURCEURL_STR = "getfeednamewtabledatapagelinkfrmsourceurl";
065:
066: public static final int OPML_IMPORT = 112;
067: public static final String OPML_IMPORT_STR = "opmlimport";
068:
069: public static int MAX_CMD_PARAMS = 3;
070:
071: /** Creates a new instance of AppCmd */
072: public AppCmd() {
073: }
074:
075: public static int getOpCode(String cmd) {
076: if (cmd.equalsIgnoreCase(ADD_LINK_STR))
077: return ADD_LINK;
078: else if (cmd.equalsIgnoreCase(DEL_LINK_STR))
079: return DEL_LINK;
080: else if (cmd.equalsIgnoreCase(OPML_IMPORT_STR))
081: return OPML_IMPORT;
082: else if (cmd.equalsIgnoreCase(GET_CATEGORIES_STR))
083: return GET_CATEGORIES;
084: else if (cmd.equalsIgnoreCase(GET_FEEDNAMES_STR))
085: return GET_FEEDNAMES;
086: else if (cmd.equalsIgnoreCase(GET_FEEDNAMES_W_PAGE_LINK_STR))
087: return GET_FEEDNAMES_W_PAGE_LINK;
088: else if (cmd
089: .equalsIgnoreCase(GET_ALL_FEEDNAMES_W_PAGE_LINK_STR))
090: return GET_ALL_FEEDNAMES_W_PAGE_LINK;
091: else if (cmd.equalsIgnoreCase(GET_STYLE_INFO_STR))
092: return GET_STYLE_INFO;
093: else if (cmd.equalsIgnoreCase(SAVE_STYLE_INFO_STR))
094: return SAVE_STYLE_INFO;
095: else if (cmd
096: .equalsIgnoreCase(GET_FEEDNAMES_W_TABLEDATA_PAGE_LINK_STR))
097: return GET_FEEDNAMES_W_TABLEDATA_PAGE_LINK;
098: else if (cmd
099: .equalsIgnoreCase(GET_ALL_FEEDNAMES_W_TABLEDATA_PAGE_LINK_STR))
100: return GET_ALL_FEEDNAMES_W_TABLEDATA_PAGE_LINK;
101: else if (cmd
102: .equalsIgnoreCase(GET_FEEDNAMES_W_FEEDSOURCE_LINK_STR))
103: return GET_FEEDNAMES_W_FEEDSOURCE_LINK;
104: else if (cmd
105: .equalsIgnoreCase(GET_FEEDNAMES_W_TABLEDATA_PAGE_LINK_FRM_SOURCEURL_STR))
106: return GET_FEEDNAMES_W_TABLEDATA_PAGE_LINK_FRM_SOURCEURL;
107:
108: return 0;
109: }
110: }
|