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