diff --git a/app/.classpath b/app/.classpath index 9263b3f..23e0500 100644 --- a/app/.classpath +++ b/app/.classpath @@ -1,6 +1,12 @@ - + + + + + + + @@ -17,6 +23,5 @@ - diff --git a/app/.project b/app/.project index e01db13..f9dd6ec 100644 --- a/app/.project +++ b/app/.project @@ -1,6 +1,6 @@ - twitter_influence_analyzer + bluemix-java-twitter-influence-analyzer @@ -32,11 +32,11 @@ - org.eclipse.m2e.core.maven2Nature org.eclipse.jem.workbench.JavaEMFNature org.eclipse.wst.common.modulecore.ModuleCoreNature - org.eclipse.wst.common.project.facet.core.nature org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + org.eclipse.wst.common.project.facet.core.nature org.eclipse.wst.jsdt.core.jsNature diff --git a/app/.settings/.jsdtscope b/app/.settings/.jsdtscope index 887f573..585c967 100644 --- a/app/.settings/.jsdtscope +++ b/app/.settings/.jsdtscope @@ -1,6 +1,7 @@ - + + diff --git a/app/.settings/org.eclipse.jdt.core.prefs b/app/.settings/org.eclipse.jdt.core.prefs index c788ee3..f4217b0 100644 --- a/app/.settings/org.eclipse.jdt.core.prefs +++ b/app/.settings/org.eclipse.jdt.core.prefs @@ -1,7 +1,11 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning diff --git a/app/.settings/org.eclipse.wst.common.component b/app/.settings/org.eclipse.wst.common.component index c83ec28..7dbb9d2 100644 --- a/app/.settings/org.eclipse.wst.common.component +++ b/app/.settings/org.eclipse.wst.common.component @@ -1,9 +1,9 @@ - + - - - - + + + + diff --git a/app/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml b/app/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml new file mode 100644 index 0000000..c8e0439 --- /dev/null +++ b/app/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/app/.settings/org.eclipse.wst.common.project.facet.core.xml b/app/.settings/org.eclipse.wst.common.project.facet.core.xml index e8c2e36..1b06de9 100644 --- a/app/.settings/org.eclipse.wst.common.project.facet.core.xml +++ b/app/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -1,9 +1,9 @@ - - - + + + diff --git a/app/.settings/org.eclipse.wst.ws.service.policy.prefs b/app/.settings/org.eclipse.wst.ws.service.policy.prefs new file mode 100644 index 0000000..9cfcabe --- /dev/null +++ b/app/.settings/org.eclipse.wst.ws.service.policy.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.wst.ws.service.policy.projectEnabled=false diff --git a/app/WebContent/META-INF/MANIFEST.MF b/app/WebContent/META-INF/MANIFEST.MF deleted file mode 100644 index 5e94951..0000000 --- a/app/WebContent/META-INF/MANIFEST.MF +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -Class-Path: - diff --git a/app/WebContent/WEB-INF/lib/JSON4J_Apache.jar b/app/WebContent/WEB-INF/lib/JSON4J_Apache.jar deleted file mode 100644 index eea54e4..0000000 Binary files a/app/WebContent/WEB-INF/lib/JSON4J_Apache.jar and /dev/null differ diff --git a/app/WebContent/WEB-INF/lib/json-simple-1.1.jar b/app/WebContent/WEB-INF/lib/json-simple-1.1.jar deleted file mode 100644 index 0ab9563..0000000 Binary files a/app/WebContent/WEB-INF/lib/json-simple-1.1.jar and /dev/null differ diff --git a/app/WebContent/WEB-INF/lib/klout-java-wrapper.jar b/app/WebContent/WEB-INF/lib/klout-java-wrapper.jar deleted file mode 100644 index dad5eaa..0000000 Binary files a/app/WebContent/WEB-INF/lib/klout-java-wrapper.jar and /dev/null differ diff --git a/app/WebContent/WEB-INF/web.xml b/app/WebContent/WEB-INF/web.xml deleted file mode 100644 index 256f56c..0000000 --- a/app/WebContent/WEB-INF/web.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - index.html - index.htm - index.jsp - default.html - default.htm - default.jsp - - - Calculates the Influencer information - DispCalc - DispCalc - com.sampleapp.web.DispCalc - - - DispCalc - /TwitterInfluenceAnalyzer/DispCalc - - - - SaveData - SaveData - com.sampleapp.db.SaveData - - - SaveData - /TwitterInfluenceAnalyzer/SaveData - - - - DisplayAll - DisplayAll - com.sampleapp.db.DisplayAll - - - DisplayAll - /TwitterInfluenceAnalyzer/DisplayAll - - - - DelSelected - DelSelected - com.sampleapp.db.DelSelected - - - DelSelected - /TwitterInfluenceAnalyzer/DelSelected - - - - ClearAll - ClearAll - com.sampleapp.db.ClearAll - - - ClearAll - /TwitterInfluenceAnalyzer/ClearAll - - \ No newline at end of file diff --git a/app/build/classes/com/sampleapp/db/ClearAll.class b/app/build/classes/com/sampleapp/db/ClearAll.class deleted file mode 100644 index d3815f2..0000000 Binary files a/app/build/classes/com/sampleapp/db/ClearAll.class and /dev/null differ diff --git a/app/build/classes/com/sampleapp/db/DBUtil.class b/app/build/classes/com/sampleapp/db/DBUtil.class deleted file mode 100644 index f1ec735..0000000 Binary files a/app/build/classes/com/sampleapp/db/DBUtil.class and /dev/null differ diff --git a/app/build/classes/com/sampleapp/db/DelSelected.class b/app/build/classes/com/sampleapp/db/DelSelected.class deleted file mode 100644 index 78948e7..0000000 Binary files a/app/build/classes/com/sampleapp/db/DelSelected.class and /dev/null differ diff --git a/app/build/classes/com/sampleapp/db/DisplayAll.class b/app/build/classes/com/sampleapp/db/DisplayAll.class deleted file mode 100644 index 071fe09..0000000 Binary files a/app/build/classes/com/sampleapp/db/DisplayAll.class and /dev/null differ diff --git a/app/build/classes/com/sampleapp/db/SaveData.class b/app/build/classes/com/sampleapp/db/SaveData.class deleted file mode 100644 index 6d9cd55..0000000 Binary files a/app/build/classes/com/sampleapp/db/SaveData.class and /dev/null differ diff --git a/app/build/classes/com/sampleapp/web/DispCalc.class b/app/build/classes/com/sampleapp/web/DispCalc.class deleted file mode 100644 index 28934b5..0000000 Binary files a/app/build/classes/com/sampleapp/web/DispCalc.class and /dev/null differ diff --git a/app/build/classes/klout.properties b/app/build/classes/klout.properties deleted file mode 100644 index ac62f8f..0000000 --- a/app/build/classes/klout.properties +++ /dev/null @@ -1 +0,0 @@ -kloutkey= \ No newline at end of file diff --git a/app/build/classes/twitter4j.properties b/app/build/classes/twitter4j.properties deleted file mode 100644 index de11f0d..0000000 --- a/app/build/classes/twitter4j.properties +++ /dev/null @@ -1,6 +0,0 @@ -debug=false -http.useSSL=true -oauth.consumerKey= -oauth.consumerSecret= -oauth.accessToken= -oauth.accessTokenSecret= diff --git a/app/pom.xml b/app/pom.xml index 79a5ef5..00df780 100644 --- a/app/pom.xml +++ b/app/pom.xml @@ -1,59 +1,84 @@ - - 4.0.0 - twitter_influence_analyzer - twitter_influence_analyzer - 1.2 - war - - src - - - ${build.sourceDirectory} - - **/*.java - - - - - - maven-war-plugin - 2.3 - - WebContent - false - - - - maven-compiler-plugin - 3.1 - - 1.7 - 1.7 - - - - - - - javax.servlet - javax.servlet-api - 3.1.0 - provided - - - org.ektorp - org.ektorp - 1.4.1 - - - com.fasterxml.jackson.core - jackson-annotations - 2.4.0 - - - org.twitter4j - twitter4j-core - 4.0.2 - - - \ No newline at end of file + + + + + + + never + + + false + never + + ibm-maven-repo + ibm-maven-repo + http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/repository/ + + + + + + IBM International License Agreement for Non-Warranted Programs + http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/licenses/L-JTHS-8SZMHX/HTML/ + repo + Additional notices http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/licenses/L-JTHS-8SZMHX/HTML/notices.html + + + + 4.0.0 + + com.ibm.jstart + bluemix-java-twitter-influence-analyzer + war + 0.0.1-SNAPSHOT + + bluemix-java-twitter-influence-analyzer + http://maven.apache.org + + + + com.ibm.tools.target + was-liberty + LATEST + provided + pom + + + org.twitter4j + twitter4j-core + 4.0.2 + + + com.cloudant + cloudant-client + 1.0.1 + + + + + ${project.name} + + + maven-war-plugin + 2.1.1 + + false + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.0.2 + + 1.7 + 1.7 + + + + + diff --git a/app/src/com/sampleapp/db/ClearAll.java b/app/src/main/java/com/sampleapp/db/ClearAll.java similarity index 100% rename from app/src/com/sampleapp/db/ClearAll.java rename to app/src/main/java/com/sampleapp/db/ClearAll.java diff --git a/app/src/com/sampleapp/db/DBUtil.java b/app/src/main/java/com/sampleapp/db/DBUtil.java similarity index 73% rename from app/src/com/sampleapp/db/DBUtil.java rename to app/src/main/java/com/sampleapp/db/DBUtil.java index 6ea8e89..d386095 100644 --- a/app/src/com/sampleapp/db/DBUtil.java +++ b/app/src/main/java/com/sampleapp/db/DBUtil.java @@ -49,32 +49,18 @@ import java.util.List; import java.util.Map; -//import com.mongodb.*; -import org.ektorp.ViewQuery; -import org.ektorp.http.HttpClient; -import org.ektorp.http.StdHttpClient; -import org.ektorp.impl.StdCouchDbConnector; -import org.ektorp.impl.StdCouchDbInstance; +import com.cloudant.client.api.CloudantClient; +import com.cloudant.client.api.Database; import twitter4j.JSONArray; import twitter4j.JSONObject; public class DBUtil { - - // For grabbing vcap_services info - private Map env; - private String vcap; - private String host, port, url; - // username and password not currently used - //private String host, port, username, password, url; - private String dbname = "twitter-influence-analyzer"; - - // For interacting with Cloudant - protected StdCouchDbInstance dbInstance; - protected StdCouchDbConnector db; - - // Make this a singleton - private static DBUtil instance; + + protected CloudantClient client; // For interacting with Cloudant + protected Database db; // protected StdCouchDbInstance dbInstance + private String dbname = "twitter-influence-analyzer"; // database name (can be what you want just make it unique) + private static DBUtil instance; // Make this a singleton public static synchronized DBUtil getInstance() { if (instance == null) { @@ -84,8 +70,8 @@ public static synchronized DBUtil getInstance() { } private DBUtil() { - env = System.getenv(); - vcap = env.get("VCAP_SERVICES"); + Map env;env = System.getenv(); + String vcap = env.get("VCAP_SERVICES"); if (vcap == null) { System.out.println("No VCAP_SERVICES found"); @@ -111,44 +97,37 @@ private DBUtil() { JSONObject instance = cloudant.getJSONObject(0); // Grab the first instance of mongoDB for this app (there is only one) JSONObject credentials = instance.getJSONObject("credentials"); - host = credentials.getString("host"); - port = credentials.getString("port"); - // not currently in use, maybe in future versions of cloudant - //username = credentials.getString("username"); - //password = credentials.getString("password"); - url = credentials.getString("url"); + + // Get all VCAP_SERVICES credentials + String host = credentials.getString("host"); + String port = credentials.getString("port"); + String username = credentials.getString("username"); + String password = credentials.getString("password"); + String url = credentials.getString("url"); - System.out.println("Found all the params"); + System.out.println("Found all the params: "+username+ " "+password+" "+url); + + // Create the client connection the the database and then create the database + client = new CloudantClient(url,username,password); + db = client.database(dbname, true); - // cloudant initialization - HttpClient httpClient = new StdHttpClient.Builder().url(url).build(); - dbInstance = new StdCouchDbInstance(httpClient); - db = new StdCouchDbConnector(dbname, dbInstance); - - db.createDatabaseIfNotExists(); - System.out.println("Connected to cloudant on " + host + ":" + port); - } catch(Exception e) { e.printStackTrace(); } } - // saves the data in the mongoDB + // saves the data in the CloudantDB public void saveData(String t_name, int totalscore, int fcount, int fscore, int rtcount, int rtscore, int mcount) { // check whether the document is present in the database // if not present just insert new doc or else just update the existing doc. -// boolean documentExists = repo.contains(t_name); - //BasicDBObject query = new BasicDBObject("twitname", t_name); - - //boolean documentExists = infColl.find(query).count() != 0; - boolean documentExists = db.contains(t_name); + boolean documentExists = db.contains(t_name); if (documentExists) { // Update the existing record @SuppressWarnings("unchecked") - Map doc = db.get(Map.class, t_name); + Map doc = db.find(Map.class, t_name); //Map doc = new HashMap(); doc.put("_id", t_name); doc.put("totalscore", totalscore); @@ -157,6 +136,7 @@ public void saveData(String t_name, int totalscore, int fcount, int fscore, int doc.put("rtcount", rtcount); doc.put("rtscore", rtscore); doc.put("mcount", mcount); + db.update(doc); System.out.println("Existing document updated"); @@ -170,7 +150,8 @@ public void saveData(String t_name, int totalscore, int fcount, int fscore, int doc.put("rtcount", rtcount); doc.put("rtscore", rtscore); doc.put("mcount", mcount); - db.create(doc); + + db.save(doc); System.out.println("New record successfully inserted"); } @@ -179,26 +160,30 @@ public void saveData(String t_name, int totalscore, int fcount, int fscore, int // delete the selected record from mongoDB public void delSelected(String twitname){ @SuppressWarnings("unchecked") - Map doc = db.get(Map.class, twitname); - db.delete(doc); - System.out.println(twitname + " record deleted"); + Map doc = db.find(Map.class, twitname); + db.remove(doc); + System.out.println(twitname + " record deleted"); } // deletes all the records from mongoDB public void clearAll() { - dbInstance.deleteDatabase(dbname); - db = new StdCouchDbConnector(dbname, dbInstance); - db.createDatabaseIfNotExists(); - System.out.println("Deleted all records"); + client.deleteDB(dbname,"delete database"); + db = client.database(dbname, true); } @SuppressWarnings("rawtypes") public List getCursor () { - ViewQuery q = new ViewQuery().allDocs().includeDocs(true); - return db.queryView(q, Map.class); + List docs = db.view("_all_docs") + .includeDocs(true) + .query(Map.class); + return docs; } public int getCount() { - return db.getAllDocIds().size(); + List docs = db.view("_all_docs") + .includeDocs(true) + .query(Map.class); + + return docs.size(); } } diff --git a/app/src/com/sampleapp/db/DelSelected.java b/app/src/main/java/com/sampleapp/db/DelSelected.java similarity index 98% rename from app/src/com/sampleapp/db/DelSelected.java rename to app/src/main/java/com/sampleapp/db/DelSelected.java index 0f9a474..6865e61 100644 --- a/app/src/com/sampleapp/db/DelSelected.java +++ b/app/src/main/java/com/sampleapp/db/DelSelected.java @@ -68,10 +68,9 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) DBUtil du = DBUtil.getInstance(); du.delSelected(twitname); - //DBCursor cr = du.getCursor(); @SuppressWarnings("rawtypes") List cr = du.getCursor(); - //Object[] records = cr.toArray(); + request.setAttribute("records", cr); request.setAttribute("totinf", du.getCount()); request.getRequestDispatcher("/displayall.jsp").forward(request, response); diff --git a/app/src/com/sampleapp/db/DisplayAll.java b/app/src/main/java/com/sampleapp/db/DisplayAll.java similarity index 99% rename from app/src/com/sampleapp/db/DisplayAll.java rename to app/src/main/java/com/sampleapp/db/DisplayAll.java index bbd9576..e77365c 100644 --- a/app/src/com/sampleapp/db/DisplayAll.java +++ b/app/src/main/java/com/sampleapp/db/DisplayAll.java @@ -67,8 +67,10 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) t @SuppressWarnings("rawtypes") List cr = du.getCursor(); + request.setAttribute("records", cr); request.setAttribute("totinf", du.getCount()); request.getRequestDispatcher("/displayall.jsp").forward(request, response); + } } diff --git a/app/src/com/sampleapp/db/SaveData.java b/app/src/main/java/com/sampleapp/db/SaveData.java similarity index 91% rename from app/src/com/sampleapp/db/SaveData.java rename to app/src/main/java/com/sampleapp/db/SaveData.java index 263ed3a..67a68a1 100644 --- a/app/src/com/sampleapp/db/SaveData.java +++ b/app/src/main/java/com/sampleapp/db/SaveData.java @@ -83,15 +83,28 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) int rtcount = Integer.parseInt(request.getParameter("rtcount")); int rtscore = Integer.parseInt(request.getParameter("rtscore")); int mcount = Integer.parseInt(request.getParameter("mcount")); - + DBUtil du = DBUtil.getInstance(); du.saveData(t_name,totalscore,fcount,fscore,rtcount,rtscore,mcount); - + @SuppressWarnings("rawtypes") List cr = du.getCursor(); + System.out.println("c. records attribute is: "+cr.toString()); request.setAttribute("records", cr); - request.setAttribute("totinf", du.getCount()); + + + /*@SuppressWarnings("unchecked") + List> records = (List>) request.getAttribute("records"); + for (Map record : records) { + String twitname2 = record.get("_id").toString(); + // int mcount2 = Integer.parseInt(record.get("mcount").toString()); + + + System.out.println("my twitname is: "+twitname2); + } */ + + request.setAttribute("totinf", du.getCount()); request.getRequestDispatcher("/displayall.jsp").forward(request, response); } diff --git a/app/src/com/sampleapp/web/DispCalc.java b/app/src/main/java/com/sampleapp/web/DispCalc.java similarity index 100% rename from app/src/com/sampleapp/web/DispCalc.java rename to app/src/main/java/com/sampleapp/web/DispCalc.java diff --git a/app/src/main/webapp/WEB-INF/ibm-web-ext.xml b/app/src/main/webapp/WEB-INF/ibm-web-ext.xml new file mode 100644 index 0000000..78e392f --- /dev/null +++ b/app/src/main/webapp/WEB-INF/ibm-web-ext.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/app/src/main/webapp/WEB-INF/web.xml b/app/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..31b8bc0 --- /dev/null +++ b/app/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,64 @@ + + + bluemix-java-twitter-influence-analyzer + + index.html + index.htm + index.jsp + default.html + default.htm + default.jsp + + + Calculates the Influencer information + DispCalc + DispCalc + com.sampleapp.web.DispCalc + + + DispCalc + /TwitterInfluenceAnalyzer/DispCalc + + + + SaveData + SaveData + com.sampleapp.db.SaveData + + + SaveData + /TwitterInfluenceAnalyzer/SaveData + + + + DisplayAll + DisplayAll + com.sampleapp.db.DisplayAll + + + DisplayAll + /TwitterInfluenceAnalyzer/DisplayAll + + + + DelSelected + DelSelected + com.sampleapp.db.DelSelected + + + DelSelected + /TwitterInfluenceAnalyzer/DelSelected + + + + ClearAll + ClearAll + com.sampleapp.db.ClearAll + + + ClearAll + /TwitterInfluenceAnalyzer/ClearAll + + diff --git a/app/WebContent/bootstrap-alert.js b/app/src/main/webapp/bootstrap-alert.js similarity index 100% rename from app/WebContent/bootstrap-alert.js rename to app/src/main/webapp/bootstrap-alert.js diff --git a/app/WebContent/bootstrap-button.js b/app/src/main/webapp/bootstrap-button.js similarity index 100% rename from app/WebContent/bootstrap-button.js rename to app/src/main/webapp/bootstrap-button.js diff --git a/app/WebContent/bootstrap-carousel.js b/app/src/main/webapp/bootstrap-carousel.js similarity index 100% rename from app/WebContent/bootstrap-carousel.js rename to app/src/main/webapp/bootstrap-carousel.js diff --git a/app/WebContent/bootstrap-collapse.js b/app/src/main/webapp/bootstrap-collapse.js similarity index 100% rename from app/WebContent/bootstrap-collapse.js rename to app/src/main/webapp/bootstrap-collapse.js diff --git a/app/WebContent/bootstrap-dropdown.js b/app/src/main/webapp/bootstrap-dropdown.js similarity index 100% rename from app/WebContent/bootstrap-dropdown.js rename to app/src/main/webapp/bootstrap-dropdown.js diff --git a/app/WebContent/bootstrap-modal.js b/app/src/main/webapp/bootstrap-modal.js similarity index 100% rename from app/WebContent/bootstrap-modal.js rename to app/src/main/webapp/bootstrap-modal.js diff --git a/app/WebContent/bootstrap-popover.js b/app/src/main/webapp/bootstrap-popover.js similarity index 100% rename from app/WebContent/bootstrap-popover.js rename to app/src/main/webapp/bootstrap-popover.js diff --git a/app/WebContent/bootstrap-responsive.css b/app/src/main/webapp/bootstrap-responsive.css similarity index 100% rename from app/WebContent/bootstrap-responsive.css rename to app/src/main/webapp/bootstrap-responsive.css diff --git a/app/WebContent/bootstrap-responsive.min.css b/app/src/main/webapp/bootstrap-responsive.min.css similarity index 100% rename from app/WebContent/bootstrap-responsive.min.css rename to app/src/main/webapp/bootstrap-responsive.min.css diff --git a/app/WebContent/bootstrap-scrollspy.js b/app/src/main/webapp/bootstrap-scrollspy.js similarity index 100% rename from app/WebContent/bootstrap-scrollspy.js rename to app/src/main/webapp/bootstrap-scrollspy.js diff --git a/app/WebContent/bootstrap-tab.js b/app/src/main/webapp/bootstrap-tab.js similarity index 100% rename from app/WebContent/bootstrap-tab.js rename to app/src/main/webapp/bootstrap-tab.js diff --git a/app/WebContent/bootstrap-tooltip.js b/app/src/main/webapp/bootstrap-tooltip.js similarity index 100% rename from app/WebContent/bootstrap-tooltip.js rename to app/src/main/webapp/bootstrap-tooltip.js diff --git a/app/WebContent/bootstrap-transition.js b/app/src/main/webapp/bootstrap-transition.js similarity index 100% rename from app/WebContent/bootstrap-transition.js rename to app/src/main/webapp/bootstrap-transition.js diff --git a/app/WebContent/bootstrap-typeahead.js b/app/src/main/webapp/bootstrap-typeahead.js similarity index 100% rename from app/WebContent/bootstrap-typeahead.js rename to app/src/main/webapp/bootstrap-typeahead.js diff --git a/app/WebContent/bootstrap.css b/app/src/main/webapp/bootstrap.css similarity index 100% rename from app/WebContent/bootstrap.css rename to app/src/main/webapp/bootstrap.css diff --git a/app/WebContent/bootstrap.js b/app/src/main/webapp/bootstrap.js similarity index 100% rename from app/WebContent/bootstrap.js rename to app/src/main/webapp/bootstrap.js diff --git a/app/WebContent/bootstrap.min.css b/app/src/main/webapp/bootstrap.min.css similarity index 100% rename from app/WebContent/bootstrap.min.css rename to app/src/main/webapp/bootstrap.min.css diff --git a/app/WebContent/bootstrap.min.js b/app/src/main/webapp/bootstrap.min.js similarity index 100% rename from app/WebContent/bootstrap.min.js rename to app/src/main/webapp/bootstrap.min.js diff --git a/app/WebContent/default.css b/app/src/main/webapp/default.css similarity index 100% rename from app/WebContent/default.css rename to app/src/main/webapp/default.css diff --git a/app/WebContent/displayall.jsp b/app/src/main/webapp/displayall.jsp similarity index 86% rename from app/WebContent/displayall.jsp rename to app/src/main/webapp/displayall.jsp index f1b1cae..ee9031c 100644 --- a/app/WebContent/displayall.jsp +++ b/app/src/main/webapp/displayall.jsp @@ -123,22 +123,29 @@ List> records = (List>) request.getAttribute("records"); for (Map record : records) { String twitname = record.get("_id").toString(); - int mcount = Integer.parseInt(record.get("mcount").toString()); - int fcount = Integer.parseInt(record.get("fcount").toString()); - int fscore = Integer.parseInt(record.get("fscore").toString()); - int rtcount = Integer.parseInt(record.get("rtcount").toString()); - int rtscore = Integer.parseInt(record.get("rtscore").toString()); - int totalscore = Integer.parseInt(record.get("totalscore").toString()); + String mcount = record.get("mcount").toString(); + String fcount = record.get("fcount").toString(); + String fscore = record.get("fscore").toString(); + String rtcount = record.get("rtcount").toString(); + String rtscore = record.get("rtscore").toString(); + String totalscore = record.get("totalscore").toString(); + // convert values to ints + int mcount2 = (int) Double.parseDouble(mcount); + int fcount2 = (int) Double.parseDouble(fcount); + int fscore2 = (int) Double.parseDouble(fscore); + int rtcount2 = (int) Double.parseDouble(rtcount); + int rtscore2 = (int) Double.parseDouble(rtscore); + int totalscore2 = (int) Double.parseDouble(totalscore); %> <%= twitname %> - <%= mcount %> - <%= fcount %> - <%= fscore %> - <%= rtcount %> - <%= rtscore %> - <%= totalscore %> + <%= mcount2 %> + <%= fcount2 %> + <%= fscore2 %> + <%= rtcount2 %> + <%= rtscore2 %> + <%= totalscore2 %> diff --git a/app/WebContent/index.html b/app/src/main/webapp/index.html similarity index 100% rename from app/WebContent/index.html rename to app/src/main/webapp/index.html diff --git a/app/WebContent/result.jsp b/app/src/main/webapp/result.jsp similarity index 100% rename from app/WebContent/result.jsp rename to app/src/main/webapp/result.jsp diff --git a/app/WebContent/todc-bootstrap.css b/app/src/main/webapp/todc-bootstrap.css similarity index 100% rename from app/WebContent/todc-bootstrap.css rename to app/src/main/webapp/todc-bootstrap.css diff --git a/app/WebContent/twitter_logo.png b/app/src/main/webapp/twitter_logo.png similarity index 100% rename from app/WebContent/twitter_logo.png rename to app/src/main/webapp/twitter_logo.png diff --git a/app/target/classes/com/sampleapp/db/ClearAll.class b/app/target/classes/com/sampleapp/db/ClearAll.class new file mode 100644 index 0000000..fc95cbe Binary files /dev/null and b/app/target/classes/com/sampleapp/db/ClearAll.class differ diff --git a/app/target/classes/com/sampleapp/db/DBUtil.class b/app/target/classes/com/sampleapp/db/DBUtil.class new file mode 100644 index 0000000..0bb47a4 Binary files /dev/null and b/app/target/classes/com/sampleapp/db/DBUtil.class differ diff --git a/app/target/classes/com/sampleapp/db/DelSelected.class b/app/target/classes/com/sampleapp/db/DelSelected.class new file mode 100644 index 0000000..b5e62e0 Binary files /dev/null and b/app/target/classes/com/sampleapp/db/DelSelected.class differ diff --git a/app/target/classes/com/sampleapp/db/DisplayAll.class b/app/target/classes/com/sampleapp/db/DisplayAll.class new file mode 100644 index 0000000..b4a78b7 Binary files /dev/null and b/app/target/classes/com/sampleapp/db/DisplayAll.class differ diff --git a/app/target/classes/com/sampleapp/db/SaveData.class b/app/target/classes/com/sampleapp/db/SaveData.class new file mode 100644 index 0000000..77060b0 Binary files /dev/null and b/app/target/classes/com/sampleapp/db/SaveData.class differ diff --git a/app/target/classes/com/sampleapp/web/DispCalc.class b/app/target/classes/com/sampleapp/web/DispCalc.class new file mode 100644 index 0000000..aff51bb Binary files /dev/null and b/app/target/classes/com/sampleapp/web/DispCalc.class differ diff --git a/app/target/m2e-wtp/web-resources/META-INF/MANIFEST.MF b/app/target/m2e-wtp/web-resources/META-INF/MANIFEST.MF new file mode 100644 index 0000000..8400fd8 --- /dev/null +++ b/app/target/m2e-wtp/web-resources/META-INF/MANIFEST.MF @@ -0,0 +1,5 @@ +Manifest-Version: 1.0 +Built-By: Jake Eden +Build-Jdk: 1.8.0_25 +Created-By: Maven Integration for Eclipse + diff --git a/app/target/m2e-wtp/web-resources/META-INF/maven/com.ibm.jstart/bluemix-java-twitter-influence-analyzer/pom.properties b/app/target/m2e-wtp/web-resources/META-INF/maven/com.ibm.jstart/bluemix-java-twitter-influence-analyzer/pom.properties new file mode 100644 index 0000000..9088848 --- /dev/null +++ b/app/target/m2e-wtp/web-resources/META-INF/maven/com.ibm.jstart/bluemix-java-twitter-influence-analyzer/pom.properties @@ -0,0 +1,7 @@ +#Generated by Maven Integration for Eclipse +#Wed Feb 11 10:06:39 EST 2015 +version=0.0.1-SNAPSHOT +groupId=com.ibm.jstart +m2e.projectName=bluemix-java-twitter-influence-analyzer +m2e.projectLocation=C\:\\Users\\IBM_ADMIN\\lastWorkspace\\bluemix-java-twitter-influence-analyzer +artifactId=bluemix-java-twitter-influence-analyzer diff --git a/app/target/m2e-wtp/web-resources/META-INF/maven/com.ibm.jstart/bluemix-java-twitter-influence-analyzer/pom.xml b/app/target/m2e-wtp/web-resources/META-INF/maven/com.ibm.jstart/bluemix-java-twitter-influence-analyzer/pom.xml new file mode 100644 index 0000000..00df780 --- /dev/null +++ b/app/target/m2e-wtp/web-resources/META-INF/maven/com.ibm.jstart/bluemix-java-twitter-influence-analyzer/pom.xml @@ -0,0 +1,84 @@ + + + + + + + never + + + false + never + + ibm-maven-repo + ibm-maven-repo + http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/repository/ + + + + + + IBM International License Agreement for Non-Warranted Programs + http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/licenses/L-JTHS-8SZMHX/HTML/ + repo + Additional notices http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/licenses/L-JTHS-8SZMHX/HTML/notices.html + + + + 4.0.0 + + com.ibm.jstart + bluemix-java-twitter-influence-analyzer + war + 0.0.1-SNAPSHOT + + bluemix-java-twitter-influence-analyzer + http://maven.apache.org + + + + com.ibm.tools.target + was-liberty + LATEST + provided + pom + + + org.twitter4j + twitter4j-core + 4.0.2 + + + com.cloudant + cloudant-client + 1.0.1 + + + + + ${project.name} + + + maven-war-plugin + 2.1.1 + + false + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.0.2 + + 1.7 + 1.7 + + + + +