-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from nicolasmoreau/master
Guided query interface
- Loading branch information
Showing
54 changed files
with
1,348 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
portal.ejb/src/main/java/org/vamdc/portal/session/preview/PersistableQueryInterface.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.vamdc.portal.session.preview; | ||
|
||
import java.util.List; | ||
|
||
import org.vamdc.portal.entity.query.HttpHeadResponse; | ||
import org.vamdc.portal.entity.security.User; | ||
import org.vamdc.portal.session.queryBuilder.FormHolder; | ||
import org.vamdc.portal.session.queryBuilder.QueryData; | ||
import org.vamdc.portal.session.queryLog.QueryLog; | ||
|
||
public interface PersistableQueryInterface { | ||
public List<HttpHeadResponse> getNodesResponse(); | ||
public User getUser(); | ||
public QueryLog getQueryLog(); | ||
public QueryData getQueryData(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
portal.ejb/src/main/java/org/vamdc/portal/session/queryBuilder/QueryPersister.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package org.vamdc.portal.session.queryBuilder; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Date; | ||
import java.util.List; | ||
|
||
|
||
import org.vamdc.portal.entity.query.HttpHeadResponse; | ||
import org.vamdc.portal.entity.query.Query; | ||
import org.vamdc.portal.entity.query.HttpHeadResponse.Response; | ||
import org.vamdc.portal.session.preview.PersistableQueryInterface; | ||
|
||
|
||
public class QueryPersister { | ||
private PersistableQueryInterface queryManager; | ||
|
||
public QueryPersister(PersistableQueryInterface queryManager){ | ||
this.queryManager = queryManager; | ||
} | ||
|
||
public Query constructQuery(){ | ||
Query result=null; | ||
if (queryManager.getQueryData().getEditQueryId() !=null) | ||
result = queryManager.getQueryLog().getQuery(queryManager.getQueryData().getEditQueryId()); | ||
else | ||
result = new Query(); | ||
result.setComments(queryManager.getQueryData().getComments()); | ||
result.setQueryString(queryManager.getQueryData().getQueryString()); | ||
result.setResponses(selectRespondedNodes()); | ||
result.setUser(queryManager.getUser()); | ||
result.setDate(new Date()); | ||
return result; | ||
} | ||
|
||
private List<HttpHeadResponse> selectRespondedNodes() { | ||
ArrayList<HttpHeadResponse> responses = new ArrayList<HttpHeadResponse>(); | ||
|
||
for (HttpHeadResponse response:queryManager.getNodesResponse()){ | ||
if (response.getStatus()==Response.OK || response.getStatus()==Response.TRUNCATED) | ||
responses.add(response); | ||
} | ||
return responses; | ||
} | ||
|
||
|
||
} |
60 changes: 0 additions & 60 deletions
60
portal.ejb/src/main/java/org/vamdc/portal/session/queryBuilder/QueryTree.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.