/v3.2/nimbits-model/src/com/nimbits/client/model/Const.java

http://nimbits-server.googlecode.com/ · Java · 319 lines · 284 code · 14 blank · 21 comment · 0 complexity · cc729537e02db70476c255ec8fe97af1 MD5 · raw file

  1. /*
  2. * Copyright (c) 2010 Tonic Solutions LLC.
  3. *
  4. * http://www.nimbits.com
  5. *
  6. *
  7. * Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
  8. *
  9. * http://www.gnu.org/licenses/gpl.html
  10. *
  11. * Unless required by applicable law or agreed to in writing, software distributed under the license is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
  12. */
  13. package com.nimbits.client.model;
  14. import com.nimbits.client.model.email.EmailAddress;
  15. /**
  16. * Created by bsautner
  17. * User: benjamin
  18. * Date: 6/25/11
  19. * Time: 10:35 AM
  20. */
  21. public class Const {
  22. public static final String CONST_SERVER_VERSION = "3.2.1";
  23. public static final String CACHE_KEY_PREFIX = "01";
  24. public static final String WORD_MULTI_PART = "multipart";
  25. public static final String ACTION_ALERT = "alert";
  26. public static final String ACTION_CREATE = "create";
  27. public static final String ACTION_DELETE = "delete";
  28. public static final String ACTION_DOWNLOAD = "download";
  29. public static final String ACTION_IDLE = "idle";
  30. public static final String ACTION_ONOFF = "onoff";
  31. public static final String ACTION_UPDATE = "update";
  32. public static final String ACTION_VALUE = "value";
  33. public static final String ANDROID_COL_CATEGORY = "CATEGORY";
  34. public static final String ANDROID_COL_DESCRIPTION = "DESCRIPTION";
  35. public static final String ANDROID_COL_DISPLAY_TYPE = "DISPLAYTYPE";
  36. public static final String ANDROID_COL_ID = "_id";
  37. public static final String ANDROID_COL_JSON = "JSON";
  38. public static final String ANDROID_COL_NAME = "NAME";
  39. public static final String ANDROID_COL_URL = "URL";
  40. public static final String ANDROID_COL_VALUE = "VALUE";
  41. public static final String ANDROID_DB_NAME = "nimbits125";
  42. public static final String ANDROID_DB_PATH = "/data/data/com.nimbits.android/databases/";
  43. public static final String ANDROID_TABLE_LEVEL_ONE_DISPLAY = "Level_One_Display";
  44. public static final String ANDROID_TABLE_LEVEL_TWO_DISPLAY = "Level_Two_Display";
  45. public static final String ANDROID_TABLE_SERVERS = "Servers";
  46. public static final String ANDROID_TABLE_SETTINGS = "Settings";
  47. public static final String CACHE_KEY_CURRENT_VALUE = "MOSTRECENTPOINTVALUE:";
  48. public static final String CONST_AH = "ah";
  49. public static final String CONST_ENCODING = "UTF-8";
  50. public static final String CONST_HIDDEN_CATEGORY = "Nimbits_Unsorted";
  51. public static final String CONST_SERVER_NAME = "Nimbits Server";
  52. // ------------------------------ FIELDS ------------------------------
  53. public static final String COPYRIGHT = "Copyright (c) 2010 Tonic Solutions LLC. Unless required by applicable law or agreed to in writing, software distributed under the license is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.";
  54. public static final String DEFAULT_CHART_NAME = "Chart1";
  55. public static final String DEFAULT_CONTENT_TYPE = "text/html";
  56. public static final String DEFAULT_EMAIL_SUBJECT = "Nimbits Messaging";
  57. public static final String DEFAULT_EMPTY_COL = "EMPTY";
  58. public static final String ERROR_BATCH_SERVICE_JDO = "Batch Service JDOException";
  59. public static final String FORMAT_DATE_TIME = "MM/dd/y hh:mm:ss";
  60. public static final String FROM_EMAIL = "support@nimbits.com";
  61. public static final String GSON_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss Z";
  62. public static final String IN_CONTENT = "inContent";
  63. public static final String MESSAGE_ADD_CATEGORY = "Add a new data point Category";
  64. public static final String MESSAGE_CLICK_TO_TREND = "Click to Trend";
  65. public static final String MESSAGE_CONFIGURE_POINT = "Configure Data Point";
  66. public static final String MESSAGE_DATA_POINT = "Data Point";
  67. public static final String MESSAGE_DIAGRAM_NOT_FOUND_EXCEPTION = "The requested diagram could not be located.";
  68. public static final String MESSAGE_DIAGRAM_PROTECTION_EXCEPTION = "The diagram you requested could not be accessed. You are either not the diagram owner, or the owner has set the pretection level" +
  69. " to a level you cannot access. Please contact the owner of the diagram.";
  70. public static final String MESSAGE_EMAIL_SUBJECT = "Message from nimbits.com";
  71. public static final String MESSAGE_HIGH_ALERT_ON = "High Alert ON";
  72. public static final String MESSAGE_LINKS_AFTER_ERROR = " <P><a href = \"Http://www.nimbitc.com\" go to Nimbits.com </P>";
  73. public static final String MESSAGE_LOADING_POINTS = "Loading Data Points...";
  74. public static final String MESSAGE_LOW_ALERT_ON = "Low Alert On";
  75. public static final String MESSAGE_NEW_CATEGORY = "New Category";
  76. public static final String MESSAGE_NEW_CATEGORY_PROMPT = "Please enter the name of the new Category";
  77. public static final String MESSAGE_NEW_POINT = "New Data Point";
  78. public static final String MESSAGE_NEW_POINT_PROMPT = "Please enter the name of the new data point.";
  79. public static final String MESSAGE_NO_ACCOUNT = "No Google OwnerAccount";
  80. public static final String MESSAGE_NO_DATA = "";
  81. public static final String MESSAGE_POINT_DELETED = "Point Deleted. You may need to refresh your browser";
  82. public static final String MESSAGE_SELECT_POINT = "Select a Data Point";
  83. public static final String MESSAGE_SERVER_SECRET_ERROR = " ERROR Could not get the server secret";
  84. public static final String MESSAGE_TWITTER_ADDED = "Nice! Your nimbits account is now connected to twitter. " +
  85. "You can configure data points to send alerts and updates to your twitter feed " +
  86. "on the property menu";
  87. public static final String MESSAGE_UPLOAD_SVG = "Upload a process diagram in .svg format";
  88. public static final String N = "NimbitsV";
  89. public static final String NAMESPACE_DEFAULT = "default";
  90. public static final String PARAM_ACTION = "action";
  91. public static final String PARAM_ADMIN = "admin";
  92. public static final String PARAM_AUTO_SCALE = "autoScale";
  93. public static final String PARAM_BASE_URL = "baseURL";
  94. public static final String PARAM_BLOB_KEY = "blob-key";
  95. public static final String PARAM_CATEGORY = "category";
  96. public static final String PARAM_CHART_DATA = "chartData";
  97. public static final String PARAM_CLIENT = "client";
  98. public static final String PARAM_CODE = "code";
  99. public static final String PARAM_COOKIE = "cookie";
  100. public static final String PARAM_COUNT = "count";
  101. public static final String PARAM_DIAGRAM = "diagram";
  102. public static final String PARAM_EMAIL = "email";
  103. public static final String PARAM_ENABLE_CONNECTIONS = "enableConnections";
  104. public static final String PARAM_END_DATE = "ed";
  105. public static final String PARAM_EXP = "exp";
  106. public static final String PARAM_FACEBOOK = "FB";
  107. public static final String PARAM_FOLDER = "folder";
  108. public static final String PARAM_FORMAT = "format";
  109. public static final String PARAM_FROM_ADDRESS = "fromAddress";
  110. public static final String PARAM_GOOGLE_COM = "com.google";
  111. public static final String PARAM_HOST = "host";
  112. public static final String PARAM_ICON = "icon";
  113. public static final String PARAM_ID = "id";
  114. public static final String PARAM_IDLE = "idle";
  115. public static final String PARAM_INCLUDE_DIAGRAMS = "includediagrams";
  116. public static final String PARAM_INCLUDE_POINTS = "includepoints";
  117. public static final String PARAM_IN_CONTENT = "inContent";
  118. public static final String PARAM_IS_LOGGED_IN = "isLoggedIn";
  119. public static final String PARAM_JSON = "json";
  120. public static final String PARAM_JSON_POINT = "pointJson";
  121. public static final String PARAM_JSON_USER = "pointUser";
  122. public static final String PARAM_JSON_VALUE = "valueJson";
  123. public static final String PARAM_KEY = "key";
  124. public static final String PARAM_LAT = "lat";
  125. public static final String PARAM_LNG = "lng";
  126. public static final String PARAM_LOGGED_IN = "loggedin";
  127. public static final String PARAM_NAME = "name";
  128. public static final String PARAM_NOTE = "note";
  129. public static final String PARAM_OAUTH = "oauth_token";
  130. public static final String PARAM_PASSWORD = "password";
  131. public static final String PARAM_PATH = "path";
  132. public static final String PARAM_POINT = "point";
  133. public static final String PARAM_POINTS = "points";
  134. public static final String PARAM_POINT_COUNT = "pointcount";
  135. public static final String PARAM_POINT_ID = "pointID";
  136. public static final String PARAM_PROPERTY = "property";
  137. public static final String PARAM_RELOAD = "reload";
  138. public static final String PARAM_SECRET = "secret";
  139. public static final String PARAM_SEGMENT = "seg";
  140. public static final String PARAM_SELF = "self";
  141. public static final String PARAM_START_DATE = "sd";
  142. public static final String PARAM_STATE = "state";
  143. public static final String PARAM_TIMESTAMP = "timestamp";
  144. public static final String PARAM_TOKEN = "rToken";
  145. public static final String PARAM_TOTAL = "total";
  146. public static final String PARAM_TWITTER = "TW";
  147. public static final String PARAM_TWITTER_CLIENT_ID = "twitterClientId";
  148. public static final String PARAM_TWITTER_SECRET = "twitterSecret";
  149. public static final String PARAM_TYPE = "type";
  150. public static final String PARAM_URL = "url";
  151. public static final String PARAM_UUID = "uuid";
  152. public static final String PARAM_VALUE = "value";
  153. public static final String PARAM_VERBOSE = "verbose";
  154. public static final String PATH_AUTHTEST_SERVICE = "/service/authtest";
  155. public static final String PATH_CATEGORY_SERVICE = "/service/category";
  156. public static final String PATH_CHART_WIKI = "https://code.google.com/p/nimbits-server/wiki/AnnotatedTimeline";
  157. public static final String PATH_CONNECTION_IMAGE = "/resources/images/network.jpg";
  158. public static final String PATH_CURRENT_VALUE = "/service/currentvalue";
  159. public static final String PATH_DELETE_DATA_TASK = "/task/DeleteRecordedValuesTask";
  160. public static final String PATH_DIAGRAM_SERVICE = "/service/diagram";
  161. public static final String PATH_GOOGLE_CLIENT_LOGIN = "https://www.google.com/accounts/ClientLogin";
  162. public static final String PATH_INCOMING_MAIL_QUEUE = "/task/incommingmail";
  163. public static final String PATH_NIMBITS_HOME = "http://www.nimbits.com";
  164. public static final String PATH_NIMBITS_PUBLIC_SERVER = "http://app.nimbits.com";
  165. public static final String PATH_OBJECT_PROTECTION_URL = "http://www.nimbits.com/app/diagram_protection.html";
  166. public static final String PATH_POINT_MAINT_TASK = "/task/pointmaint";
  167. public static final String PATH_POINT_SERVICE = "/service/point";
  168. public static final String PATH_SERIES_SERVICE = "/service/series";
  169. public static final String PATH_TASK_RECORD_VALUE = "/task/recordvaluetask";
  170. public static final String PATH_TASK_PROCESS_BATCH = "/task/processbatchtask";
  171. public static final String PATH_TASK_UPDATE_POINT_STATS = "/task/updatepointstats";
  172. public static final String PATH_USER_SERVICE = "/admin/user";
  173. public static final String PATH_WELCOME_URL = "./welcome.html";
  174. public static final String Path_CHART_API = "/service/chartapi";
  175. public static final String QUEUE_DELETE_DATA = "deletedata";
  176. public static final String QUEUE_INCOMING_MAIL = "incommingmail";
  177. public static final String QUEUE_RECORD_VALUE = "recordvaluequeue";
  178. public static final String QUEUE_PROCESS_BATCH = "processbatchqueue";
  179. public static final String RESPONSE_CATEGORY_EXISTS = "Category Exists";
  180. public static final String QUEUE_UPDATE_POINT_STATS = "updatepointstats";
  181. // public static final String RESPONSE_CATEGORY_NOT_FOUND = "Category does not exist";
  182. public static final String RESPONSE_ERROR_SAVING_VALUE = "Error Saving Value";
  183. public static final String RESPONSE_MISSING_POINT_PARAM = "missing point parameter";
  184. public static final String RESPONSE_NO_POINTS = "No Points";
  185. public static final String RESPONSE_PERMISSION_DENIED = "Permission Denied";
  186. public static final String RESPONSE_POINT_EXISTS = "Point Exists";
  187. public static final String RESPONSE_POINT_NOT_FOUND_UUID = "could not find point using uuid ";
  188. public static final String RESPONSE_PROTECTED_POINT = "Unable to process. You didn't provide an oauth token or secret, and the point you requested is not public";
  189. public static final String RESPONSE_UNKNOWN_USER = "Could not identify user";
  190. public static final String TARGET_TYPE_BLANK = "blank";
  191. public static final String TASK_POINT_MAINT = "pointmaint";
  192. public static final String TEXT_NEW_CATEGORY = "Create category";
  193. public static final String TRANSACTION_OPTIONAL = "transactions-optional";
  194. public static final String WARNING_UNCHECKED = "unchecked";
  195. public static final String WORD_ANDROID = "android";
  196. public static final String WORD_ANNOTATION = "Annotation";
  197. public static final String WORD_BLANK = "blank";
  198. public static final String WORD_CATEGORY = "Category";
  199. public static final String WORD_DATE = "Date";
  200. public static final String WORD_DOUBLE = "double";
  201. public static final String WORD_ERROR = "Error";
  202. public static final String WORD_FALSE = "false";
  203. public static final String WORD_NAME = "Name";
  204. public static final String WORD_NIMBITS = "Nimbits";
  205. public static final String WORD_SUCCESS = "Success";
  206. public static final String WORD_TIMESTAMP = "Timestamp";
  207. public static final String WORD_TRUE = "true";
  208. public static final String WORD_VALUE = "Value";
  209. public static final String WORD_YES = "Yes";
  210. public static final int DEFAULT_TIMER_UPDATE_SPEED = 5000;
  211. public static final String PATH_AH_LOGIN = "/_ah/login";
  212. public static final String PARAM_ACSID = "ACSID";
  213. public static final String PARAM_MY_FILE = "myFile";
  214. public static final String PARAM_DIAGRAM_ID = "diagramId";
  215. public static final String PARAM_UPLOAD_TYPE_HIDDEN_FIELD = "uploadTypeHiddenField";
  216. public static final String PARAM_GENKEY = "genkey";
  217. public static final String PARAM_OUT = "out";
  218. public static final String PARAM_I = "i";
  219. public static final String PARAM_DATA = "data";
  220. public static String PATH_BATCH_SERVICE = "/service/batch";
  221. public static final String METHOD_GET = "GET";
  222. public static final String METHOD_POST = "POST";
  223. public static final String PARAM_FACEBOOK_CLIENT_ID = "facebookClientId";
  224. public static final String PARAM_FACEBOOK_SECRET = "facebookSecret";
  225. public static final String PARAM_FACEBOOK_REDIRECT_URL = "facebookRedirectUrl";
  226. public static final String WORD_PROPERTIES = "Properties";
  227. public static final String HTML_HOME_LINK = "<A href = \"http://www.nimbits.com\">nimbits.com</a>";
  228. public static final String PATH_FACEBOOK_ME = "https://graph.facebook.com/me";
  229. public static final String PATH_LOGO_IMG = "http://app.nimbits.com/resources/images/logo.png";
  230. public static final String PATH_WOLFRAM_ALPHA = "http://api.wolframalpha.com/v2/query";
  231. public static final String PARAM_WOLFRAM_ALPHA_KEY = "wolframAlphaKey";
  232. public static final String PARAM_SERVER = "server";
  233. public static final String ERROR_POINT_NOT_FOUND = "Point not found";
  234. public static final String ERROR_USER_NOT_FOUND = "User not found";
  235. public static final String PARAM_USER = "user";
  236. public static final String ERROR_RETRY = "There was an error saving this value. The system will try again.";
  237. public static final String PARAM_CONTEXT = "context";
  238. public static String getConnectionInviteEmail(final EmailAddress email) {
  239. return "<P STYLE=\"margin-bottom: 0in\"> " + email.getValue() +
  240. " wants to connect with you on <a href = \"http://www.nimbits.com\"> Nimbits! </A></BR></P><BR> \n" +
  241. "<P><a href = \"http://www.nimbits.com\">Nimbits</A> is a data logging service that you can use to record time series\n" +
  242. "data, such as sensor readings, GPS Data, stock prices or anything else into Data Points on the cloud.</P>\n" +
  243. "<BR><P STYLE=\"margin-bottom: 0in\">\n" +
  244. "</P>\n" +
  245. "<P STYLE=\"margin-bottom: 0in\">Nimbits uses Google Accounts for\n" +
  246. "authentication. If you have a gmail account, you can sign into\n" +
  247. "Nimbits immediately using that account. You can also register any\n" +
  248. "email address with google accounts and then sign in to Nimbits. It\n" +
  249. "only takes a few seconds to register:\n" +
  250. "<A HREF=\"https://www.google.com/accounts/NewAccount\">https://www.google.com/accounts/NewAccount</A></P>\n" +
  251. "<P STYLE=\"margin-bottom: 0in\">\n" +
  252. "</P>\n" +
  253. "<BR><P STYLE=\"margin-bottom: 0in\"><A HREF=\"http://app.nimbits.com/\">Sign\n" +
  254. "into Nimbits</A> to approve this connection request. <A HREF=\"http://www.nimbits.com/\">Go to \n" +
  255. "nimbits.com</A> to learn more.</P>\n" +
  256. "<P STYLE=\"margin-bottom: 0in\">\n" +
  257. "</P>\n" +
  258. "<P STYLE=\"margin-bottom: 0in\">\n" +
  259. "</P>\n" +
  260. "<BR><BR><P STYLE=\"margin-bottom: 0in\"><STRONG>More about Nimbits Services</STRONG></P>\n" +
  261. "<P STYLE=\"margin-bottom: 0in\">\n" +
  262. "</P>\n" +
  263. "<P STYLE=\"margin-bottom: 0in\">Nimbits is a collection of software " +
  264. "designed for recording and working with time series data - such as " +
  265. "readings from a temperature probe, a stock price, or anything else " +
  266. "that changes over time - even textual and GPS data. Nimbits allows " +
  267. "you to create online Data Points that provide a data channel into the " +
  268. "cloud.\n" +
  269. "</P>\n" +
  270. "<P STYLE=\"margin-bottom: 0in\">\n" +
  271. "</P>\n" +
  272. "<BR><P STYLE=\"margin-bottom: 0in\">Nimbits Server, a data historian, is " +
  273. "available at <A HREF=\"http://www.nimbits.com/\">app.nimbits.com</A> " +
  274. "and provides a collection of web services, APIs and an interactive " +
  275. "portal enabling you to record data on a global cloud computing " +
  276. "infrastructure. You can also download and install your own instance " +
  277. "of a Nimbits Server, write your own software using Nimbits as a " +
  278. "powerful back end, or use our many free and open source downloads. " +
  279. "</P>\n" +
  280. "<P STYLE=\"margin-bottom: 0in\">\n" +
  281. "</P>\n" +
  282. "<BR><P STYLE=\"margin-bottom: 0in\">Built on cloud computing architecture,\n" +
  283. "and optimized to run on Google App Engine, you can run a Nimbits\n" +
  284. "Server with remarkable uptime and out of the box disaster recover\n" +
  285. "with zero upfront cost and a generous free quota. Then, only pay for\n" +
  286. "computing services you use with near limitless and instant\n" +
  287. "scalability when you need it. A typical 10 point Nimbits System costs\n" +
  288. "only pennies a week to run, and nothing at all when it's not in use.\n" +
  289. "</P>\n" +
  290. "<P STYLE=\"margin-bottom: 0in\">\n" +
  291. "</P>\n" +
  292. "<P STYLE=\"margin-bottom: 0in\">As your data flows into a Nimbits Data\n" +
  293. "Point, values can be compressed, alarms can be triggered,\n" +
  294. "calculations can be performed and data can even be relayed to\n" +
  295. "facebook, Twitter or other connected systems. You can chat with your\n" +
  296. "data over IM from anywhere, see and share your changing data values\n" +
  297. "in spreadsheets, diagrams and even on your phone with our free\n" +
  298. "android app. \n" +
  299. "</P>";
  300. }
  301. // --------------------------- CONSTRUCTORS ---------------------------
  302. private Const() {
  303. throw new AssertionError();
  304. }
  305. }