1. JSONObject Common.getFirstData(JSONObject json)
Gets the first data it finds in a JSONObject
. If the JSON object includes an array, it will return the value of the first data found in that array.
2. Object Common.getFirstData(JSONObject json, String key)
Gets the first data it finds in a JSONObject
according to the specified key. If the JSON object includes an array, it will return the value of the first key found in that array.
3. String MaeDriveDao.readAndImportExcelFile(HttpServletRequest request, String varName, Connection con, String insertQuery, String deleteQuery, JSONArray columnTypes, int sheetNumber, int startAtRow, String site)
Read and import an excel file into a database table. varName
is the variable that stores the ID of the file that has been uploaded on the server (widget must be used to upload files). insertQuery
and deleteQuery
correspond to the SQL statements to insert into the database and delete from the record. columnsTypes
is an array with the definition of the data type of each column (INTEGER, STRING, DOUBLE). sheetNumber
is the number of the excel sheet you want to import (from number 1), startRow
is the number of the row you want to import from (starting from number 1). The result is a string with the description of the error (if it occurs). If the execution was successful, the result string is empty
4. String Common.howLong(String textDate, String lang)
5. String Common.howLong(Timestamp date, String lang)
Gets a string of "how long ago" given a date. eg 4 hours ago. 2 minutes ago, 3 months ago, 5 years ago.
6. Object Common.getProperty(String property, String site)
Gets the value of a system property (see settings per site)
7. JSONObject Common.mergeJsonObjects(JSONObject json1, JSONObject json2)
Merges 2 JSON objects and returns a new JSON object with the objects contained in json1 and json2
8. How to reponse with an PDF file
FdcPdf.htmlToPdfFromString(request, htmlCode, os)
where htmlCode is a string with the output (HTML) to generate as PDF. This is the last widget you must use, you don't need return JSON or variables
9. How to reponse with an HTML file
PrintWriter out = httpresponse.getWriter();
out.println(htmlCode);
created with
HTML Designer .