Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HMIFMerdu - 13513049 - Ahmad Naufal Farhan #26

Open
wants to merge 62 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
214b7a7
initial commit
ahmadnaufal Nov 13, 2015
ec92434
added question web service: read and create
ahmadnaufal Nov 13, 2015
255e86e
Home dan login
trymochamad Nov 14, 2015
f6cc9cb
getter for question, and CRUD complete
ahmadnaufal Nov 16, 2015
bc3b5c0
Continue WS (Answer dan Register)
trymochamad Nov 18, 2015
718d22b
Register connect JSP
trymochamad Nov 18, 2015
3f9152c
editing registerws to userws, and refactoring
ahmadnaufal Nov 18, 2015
349e052
login identity service: tokens
ahmadnaufal Nov 18, 2015
9bff9b6
identity login service, and test client (not tested)
ahmadnaufal Nov 22, 2015
b5b9a95
Renaming method & field: changes to database and pushing all
ahmadnaufal Nov 23, 2015
4b261e7
added database dump
ahmadnaufal Nov 23, 2015
2e2888d
Revisit StackExchangeWS (incomplete)
ahmadnaufal Nov 23, 2015
2202d85
Fix dump database stackexchange
ahmadnaufal Nov 23, 2015
b83ef9d
SE WS complete question and answer (vote not done yet)
ahmadnaufal Nov 24, 2015
64ab6f0
Added operation: Question Vote & Answer Vote
squilliams Nov 24, 2015
4499b4e
Answer & Question Vote Operation added
squilliams Nov 24, 2015
ad4820b
Servlet Register
trymochamad Nov 24, 2015
7168e64
Register Servlet
trymochamad Nov 24, 2015
0f0c207
Merge branch
trymochamad Nov 24, 2015
db5a240
SE WS complete question and answer (vote not done yet)
ahmadnaufal Nov 24, 2015
27603a9
IS: Added ServiceAuth
ahmadnaufal Nov 24, 2015
26a6b29
IS: Login fully working, ServiceAuth complete
ahmadnaufal Nov 25, 2015
501b0fe
WS: added verify token for questions
ahmadnaufal Nov 25, 2015
50b8333
edited dump
ahmadnaufal Nov 25, 2015
d32ead2
Register Fixed
trymochamad Nov 25, 2015
cadf118
removed old IS, use StackExchangeIS instead
ahmadnaufal Nov 25, 2015
f779665
edited gitignore
ahmadnaufal Nov 25, 2015
21a0832
cleaning unnecessary files
ahmadnaufal Nov 25, 2015
f8083f8
WS: token validation incomplete
ahmadnaufal Nov 26, 2015
4a9e1e3
WS: token validation complete
ahmadnaufal Nov 26, 2015
1e71724
IS: validation complete
ahmadnaufal Nov 26, 2015
2e6f6d3
Front page & view post initial commit
squilliams Nov 26, 2015
b8d0e90
Merge branch 'master' of http://www.github.com/HMIFMerdu/IF3110-2015-T2
squilliams Nov 26, 2015
dd4b601
Show Question
trymochamad Nov 26, 2015
b4c140e
Fixing display list of question, viewpost initial commit
trymochamad Nov 26, 2015
c0d5e4f
Fix viewpost : displaying answer
squilliams Nov 26, 2015
2da4986
Added answer vote & question vote
squilliams Nov 26, 2015
b780884
IS: added deletion of existing token
ahmadnaufal Nov 26, 2015
adce170
ask question and continue edit question
trymochamad Nov 26, 2015
2e10271
WS: added search question
ahmadnaufal Nov 27, 2015
ee6955f
Fixing question vote
squilliams Nov 27, 2015
0191bc5
cleaning out unused jsp
ahmadnaufal Nov 27, 2015
3ec0be4
Merge
trymochamad Nov 27, 2015
f40b53d
add getUserByToken
ahmadnaufal Nov 27, 2015
ce4db14
Fix Ask Question
trymochamad Nov 27, 2015
93163d6
Merge branch 'master' of https://github.com/HMIFMerdu/IF3110-2015-T2
trymochamad Nov 27, 2015
a449946
WS: question sorted by timestamp
ahmadnaufal Nov 27, 2015
1fbc4ba
Search Question
trymochamad Nov 27, 2015
1173fd8
WS: getUserByToken working
ahmadnaufal Nov 27, 2015
0abed9c
Merge branch 'master' of https://github.com/HMIFMerdu/IF3110-2015-T2
ahmadnaufal Nov 27, 2015
5e92c8b
View Post added feature : Asked by, delete
squilliams Nov 27, 2015
8580b5d
get user by token completed, save and edit question
ahmadnaufal Nov 27, 2015
624b662
merging beberapa file
squilliams Nov 27, 2015
0805bbf
fixing web page
trymochamad Nov 27, 2015
9ae27d0
Merge branch 'master' of https://github.com/HMIFMerdu/IF3110-2015-T2
trymochamad Nov 27, 2015
b61fa85
Fixing Web Pages
trymochamad Nov 27, 2015
b426999
Logout Fixed
trymochamad Nov 27, 2015
88d6f78
Show answer vote, edit, delete
trymochamad Nov 27, 2015
6f5139f
Cut question content on index
squilliams Nov 27, 2015
5482fc4
Updated views
squilliams Nov 27, 2015
2b3fb17
added error display for views
ahmadnaufal Nov 27, 2015
683b05d
Laporan Tugas
trymochamad Nov 27, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
WS: token validation incomplete
ahmadnaufal committed Nov 26, 2015

Verified

This commit was signed with the committer’s verified signature.
narbs91 Narb
commit f8083f86750a696bcb63b3796da058cb8f3f7791
4 changes: 2 additions & 2 deletions StackExchangeWS/build.xml
Original file line number Diff line number Diff line change
@@ -7,8 +7,8 @@
<!-- the Compile on Save feature is turned off for the project. -->
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
<!-- in the project's Project Properties dialog box.-->
<project name="WSSE" default="default" basedir=".">
<description>Builds, tests, and runs the project WSSE.</description>
<project name="StackExchangeWS" default="default" basedir=".">
<description>Builds, tests, and runs the project StackExchangeWS.</description>
<import file="nbproject/build-impl.xml"/>
<!--

35 changes: 0 additions & 35 deletions StackExchangeWS/src/java/Answer/Answer.java
Original file line number Diff line number Diff line change
@@ -47,67 +47,32 @@ public int getAnswer_id() {
return answer_id;
}

/**
* @param answer_id the answer_id to set
*/
public void setAnswer_id(int answer_id) {
this.answer_id = answer_id;
}

/**
* @return the answer_uid
*/
public int getAnswer_uid() {
return answer_uid;
}

/**
* @param answer_uid the answer_uid to set
*/
public void setAnswer_uid(int answer_uid) {
this.answer_uid = answer_uid;
}

/**
* @return the answer_qid
*/
public int getAnswer_qid() {
return answer_qid;
}

/**
* @param answer_qid the answer_qid to set
*/
public void setAnswer_qid(int answer_qid) {
this.answer_qid = answer_qid;
}

/**
* @return the answer_content
*/
public String getAnswer_content() {
return answer_content;
}

/**
* @param answer_content the answer_content to set
*/
public void setAnswer_content(String answer_content) {
this.answer_content = answer_content;
}

/**
* @return the answer_timestamp
*/
public String getAnswer_timestamp() {
return answer_timestamp;
}

/**
* @param answer_timestamp the answer_timestamp to set
*/
public void setAnswer_timestamp(String answer_timestamp) {
this.answer_timestamp = answer_timestamp;
}

}
12 changes: 6 additions & 6 deletions StackExchangeWS/src/java/Answer/AnswersWS.java
Original file line number Diff line number Diff line change
@@ -78,8 +78,8 @@ public int insertAnswer(@WebParam(name = "token") String token,
* @return
*/
@WebMethod(operationName = "getAnswersByQid")
@WebResult(name = "Answers")
public List getAnswersByQid(@WebParam(name = "qid") int qid) {
@WebResult(name = "Answer")
public List<Answer> getAnswersByQid(@WebParam(name = "qid") int qid) {
//TODO write your implementation code here:
List<Answer> answers = new ArrayList<>();

@@ -143,7 +143,8 @@ public int voteanswers(@WebParam(name = "uid") int uid, @WebParam(name = "aid")
Logger.getLogger(QuestionsWS.class.getName()).log(Level.SEVERE, null, ex);
}

return res; }
return res;
}

/**
* Web service operation
@@ -155,15 +156,14 @@ public int getanswervote(@WebParam(name = "aid") int aid) {

try (Statement st = connAns.createStatement()) {
String query;
query = "SELECT SUM(value) FROM vote_answers WHERE aid = ?";
query = "SELECT value FROM vote_answers WHERE aid = ?";
// set the prepared statement by the query and enter the value of where clause
try (PreparedStatement pst = connAns.prepareStatement(query)){
pst.setInt(1, aid);
// execuResultSette select
ret = pst.executeQuery();
while (ret.next()) {
int temp = ret.getInt(1);
res = res + temp;
res += ret.getInt("value");
}
}

107 changes: 38 additions & 69 deletions StackExchangeWS/src/java/Question/Question.java
Original file line number Diff line number Diff line change
@@ -50,75 +50,44 @@ public Question(int _id, int _uid, String _topic, String _content, String _times
question_timestamp = _timestamp;
}

// /**
// * @return the question_id
// */
// public int getQuestion_id() {
// return question_id;
// }
//
// /**
// * @param question_id the question_id to set
// */
// public void setQuestion_id(int question_id) {
// this.question_id = question_id;
// }
//
// /**
// * @return the question_uid
// */
// public int getQuestion_uid() {
// return question_uid;
// }
//
// /**
// * @param question_uid the question_uid to set
// */
// public void setQuestion_uid(int question_uid) {
// this.question_uid = question_uid;
// }
//
// /**
// * @return the question_topic
// */
// public String getQuestion_topic() {
// return question_topic;
// }
//
// /**
// * @param question_topic the question_topic to set
// */
// public void setQuestion_topic(String question_topic) {
// this.question_topic = question_topic;
// }
//
// /**
// * @return the question_content
// */
// public String getQuestion_content() {
// return question_content;
// }
//
// /**
// * @param question_content the question_content to set
// */
// public void setQuestion_content(String question_content) {
// this.question_content = question_content;
// }
//
// /**
// * @return the question_timestamp
// */
// public String getQuestion_timestamp() {
// return question_timestamp;
// }
//
// /**
// * @param question_timestamp the question_timestamp to set
// */
// public void setQuestion_timestamp(String question_timestamp) {
// this.question_timestamp = question_timestamp;
// }
/**
* @return the question_id
*/
public int getQuestion_id() {
return question_id;
}


/**
* @return the question_uid
*/
public int getQuestion_uid() {
return question_uid;
}


/**
* @return the question_topic
*/
public String getQuestion_topic() {
return question_topic;
}


/**
* @return the question_content
*/
public String getQuestion_content() {
return question_content;
}


/**
* @return the question_timestamp
*/
public String getQuestion_timestamp() {
return question_timestamp;
}


}
10 changes: 4 additions & 6 deletions StackExchangeWS/src/java/Question/QuestionsWS.java
Original file line number Diff line number Diff line change
@@ -261,19 +261,17 @@ public int votequestion(@WebParam(name = "uid") int uid, @WebParam(name = "qid")
@WebMethod(operationName = "getquestionvote")
public int getquestionvote(@WebParam(name = "qid") int qid) {
int res = 0;
ResultSet ret;


try (Statement st = conn.createStatement()) {
String query;
query = "SELECT SUM(value) FROM vote_questions WHERE qid = ?";
query = "SELECT value FROM vote_questions WHERE qid = ?";
// set the prepared statement by the query and enter the value of where clause
try (PreparedStatement pst = conn.prepareStatement(query)){
pst.setInt(1, qid);
// execuResultSette select
ret = pst.executeQuery();
ResultSet ret = pst.executeQuery();
while (ret.next()) {
int temp = ret.getInt(1);
res = res + temp;
res += ret.getInt("value");
}
}

40 changes: 1 addition & 39 deletions StackExchangeWS/src/java/User/User.java
Original file line number Diff line number Diff line change
@@ -20,8 +20,6 @@ public class User {
private String name;
@XmlElement(name="email", required=true)
private String email;
@XmlElement(name="password", required=true)
private String password;

/**
* Constructor for Register
@@ -30,11 +28,10 @@ public User() {
uid = 0;
}

public User(int _id, String _name, String _email, String _password) {
public User(int _id, String _name, String _email) {
uid = _id;
name = _name;
email = _email;
password = _password;
}

/**
@@ -44,52 +41,17 @@ public int getUid() {
return uid;
}

/**
* @param uid the uid to set
*/
public void setUid(int uid) {
this.uid = uid;
}

/**
* @return the name
*/
public String getName() {
return name;
}

/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}

/**
* @return the email
*/
public String getEmail() {
return email;
}

/**
* @param email the email to set
*/
public void setEmail(String email) {
this.email = email;
}

/**
* @return the password
*/
public String getPassword() {
return password;
}

/**
* @param password the password to set
*/
public void setPassword(String password) {
this.password = password;
}
}
Loading