Skip to content

Commit

Permalink
cleaning up TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
jaSunny committed May 26, 2015
1 parent be36ea7 commit a4c9391
Show file tree
Hide file tree
Showing 38 changed files with 29 additions and 466 deletions.
111 changes: 0 additions & 111 deletions src/main/java/de/uni_potsdam/hpi/bpt/bp2014/jcomparser/FileUpload.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
import java.io.*;
import java.io.IOException;
import java.io.StringReader;
import java.util.HashMap;
import java.util.List;


/**
Expand Down Expand Up @@ -145,7 +145,6 @@ public void writeAllScenariosToDatabase(
.evaluate(models, XPathConstants.NODESET);

for (int i = 0; i < xmlModelURIs.getLength(); i++) {
//TODO: avoid string-replacement
String currentXmlUri = xmlModelURIs.item(i).getTextContent();
String[] splittedScenarioURI = currentXmlUri.split("/");
String currentScenarioID =
Expand Down Expand Up @@ -181,65 +180,4 @@ private Document stringToDocument(final String xml) {
}
return null;
}

/**
* TODO: do we want to delete this?
* @param pcm
*/
public void handleFileUpload(List pcm) {
/*
int pcm_size = pcm.size();
String pcm_item = "";
List<String> pcm_list = new ArrayList<String>();
Object xml_path_url = pcm.get(1);
for(int i=0; i < pcm_size; i++) {
pcm_item = (String) pcm.get(i);
xml_path_url = pcm_item;
InputStream xml_content;
try {
xml_content = new FileInputStream(xml_path_url);
pcm_list.add(xml_content);
} catch (IOException e) {
System.out.println("Error in Reading file ");
System.out.println(xml_path_url);
}
}
de.uni_potsdam.hpi.bpt.bp2014.jcomparser.Parser.parsePCM(pcm);
*/
}

public void handleFileRetrieval(String pcm) {
/*
ArrayList<String> pcm_list = new ArrayList<String>();
pcm_list.add(pcm);
de.uni_potsdam.hpi.bpt.bp2014.jcomparser.Parser.parsePCM(pcm_list);
*/
}

// replacing with a settings.java file
/* private String getServerSpecs(String path, String requestedConfig) {
File file = new File(path);
if (requestedConfig.equals("processeditorServerUrl")) {
try {
String processeditorServerUrl = (String) FileUtils.readLines(file).get(23);
return processeditorServerUrl;
} catch (IOException e) {
log.error("Error:", e);
}
} else if (requestedConfig.equals("jcomparserServerUrl")) {
try {
String jcomparserServerUrl = (String) FileUtils.readLines(file).get(26);
return jcomparserServerUrl;
} catch (IOException e) {
log.error("Error:", e);
}
}
System.err.print("ERROR within the getServerSpecs; String requestedConfig not correct defined");
return "";
}*/
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
* The REST API provides an Interface to to manage changes
* or updates in the JEngine Database.
*
* TODO: why doesnt the jcomparser REST have a version in the path?
*/

@Path("jcomparser")
Expand Down Expand Up @@ -71,11 +70,9 @@ public int startComparser(@PathParam("scenarioID") final int scenarioID)
throws IOException, SAXException, ParserConfigurationException {
JComparser comparser = new JComparser();
String scenarioURL = PCM_URL + scenarioID + ".pm";
//TODO: create a db record with the status of the import & return its value with REST call link for further informations
return comparser.fetchAndParseScenarioFromServer(scenarioURL, PROCESS_SERVER_URI);
}

//TODO: implement GET call to get status of scenario import

/**
* Fetches a List of all Scenarios and their IDs from the PE-Server.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/

/**
* TODO: comments are missing!!
*
*/
public class Seed {
static Logger log = Logger.getLogger(Seed.class.getName());
Expand All @@ -42,8 +42,8 @@ public void setDBcontent() {
}

/**
* @param id some id..
* @return
* @param id some some id.
* @return Array list
*/
public ArrayList<Integer> getAllActivityIDByFragmentID(int id) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private void initializeField(Node property) {
case "#targetNode":
setTargetNode(value);
break;
case "sourceMultiplicity": //TODO check for correctness!!
case "sourceMultiplicity":
setMultiplicity(value);
break;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
import de.uni_potsdam.hpi.bpt.bp2014.jcomparser.Connector;
import de.uni_potsdam.hpi.bpt.bp2014.jcomparser.Retrieval;
import org.apache.log4j.Logger;
import org.w3c.dom.*;
import org.w3c.dom.Node;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;

Expand Down Expand Up @@ -167,7 +168,6 @@ private void setVersionNumber() {
NodeList versions = (NodeList) xPath.compile(xPathQuery).evaluate(versionXML, XPathConstants.NODESET);
int maxID = 0;
// We assume that the version that needs to be saved is the newest one
//TODO: Do we want to save versions that are currently not in the Database?
for (int i = 0; i < versions.getLength(); i++) {
xPathQuery = "@id";
int currentID = Integer.parseInt((String) xPath.compile(xPathQuery).evaluate(versions.item(i), XPathConstants.STRING));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,6 @@ public Response getSpecificWebserviceTask(
* @param webserviceID The ID of the webservice tasks
* @param input The new webservice task configuration
* @return
*
* TODO: Make pretty name variables
*/
@PUT
@Path("webservice/{webserviceID}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ private void initializeNewNodeInstanceForFragment() {
int startEvent = dbControlNode.getStartEventID(fragment_id);
int controlNode = dbControlFlow.getNextControlNodeAfterStartEvent(startEvent);
String controlNodeType = dbControlNode.getType(controlNode);
//TODO: type
ControlNodeInstance controlNodeInstance = null;
switch (controlNodeType) {
case "Activity":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public void runAfterTermination() {
*/
protected ControlNodeInstance createControlNode(String type, int id) {
ControlNodeInstance controlNodeInstance = null;
//TODO: type
switch (type) {
case "Activity":
case "EmailTask":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ protected ControlNodeInstance createFollowingNodeInstance(int controlNode_id) {
* @param controlNodeInstance
*/
private void setAutomaticExecutionToFalse(String type, ControlNodeInstance controlNodeInstance) {
//TODO: type
switch (type) {
case "Activity":
case "EmailTask":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ public void startReferences() {
*/
public void setDataObjectInstancesOnChange() {
LinkedList<Integer> outputSets = dbDataFlow.getOutputSetsForControlNode(controlNodeInstance.controlNode_id);
//TODO: Output Set
for (int outputSet : outputSets) {
LinkedList<Integer> dataObjects = dbDataNode.getDataObjectIdsForDataSets(outputSet);
for (int dataObject : dataObjects) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ private void setDataStates(int outputSet_id) {
scenarioInstance.setDataObjectInstanceToNotOnChange(dataObject.getId());
}
}
//TODO: Output Set
if (outputSets.size() != 0) {
int outputSet = outputSets.get(0);
if (outputSets.size() > 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ public Response getAllEmailTasks(
@QueryParam("filter") String filterString) {
DbScenario scenario = new DbScenario();
DbEmailConfiguration mail = new DbEmailConfiguration();
//TODO: add links to detail REST calls for each emailtask
if (!scenario.existScenario(scenarioID)) {
return Response
.status(Response.Status.NOT_FOUND)
Expand Down Expand Up @@ -347,7 +346,6 @@ public Response startNewNamedInstance(
return startNewInstance(uriInfo, scenarioID);
}
ExecutionService executionService = new ExecutionService();
//TODO: add link to detail REST call for more information about new scenarioinstanceID
if (executionService.existScenario(scenarioID)) {
DbScenarioInstance instance = new DbScenarioInstance();
int instanceId = instance.createNewScenarioInstance(scenarioID, name.name);
Expand Down Expand Up @@ -427,7 +425,6 @@ public Response getScenarioInstance(
@PathParam("instanceID") int instanceID) {
ExecutionService executionService = new ExecutionService();
DbScenarioInstance instance = new DbScenarioInstance();
//TODO: add links to detail REST calls for more information about each activity instance
if (!executionService.existScenarioInstance(instanceID)) {
return Response.status(Response.Status.NOT_FOUND)
.entity("{\"message\":\"There is no instance with the id " + instanceID + "\"}")
Expand Down Expand Up @@ -1128,7 +1125,6 @@ public Response getDataObjects(
@PathParam("instanceID") int instanceID,
@QueryParam("filter") String filterString) {
ExecutionService executionService = new ExecutionService();
//TODO: add link to detail REST call for more information about each dataobject
if (!executionService.existScenarioInstance(instanceID)) {
return Response.status(Response.Status.NOT_FOUND)
.type(MediaType.APPLICATION_JSON)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public static String JsonWrapperLinkedList(LinkedList<Integer> content) {
*/
public static String JsonWrapperObject(Object content) {
Gson gson = new Gson();
JsonObject json = new JsonObject(); //TODO: to be adapted to needs here
JsonObject json = new JsonObject();
return gson.toJson(json);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import static org.junit.Assert.assertEquals;

/**
* TODO: comments are missing!!
*
*/
public class DbActivityInstanceTest extends AbstractDatabaseDependentTest {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.junit.Test;
import static org.junit.Assert.*;
/**
* TODO: comments are missing!!
*
*/
public class DbControlFlowTest extends AbstractDatabaseDependentTest {
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import static org.junit.Assert.*;

/**
* TODO: comments are missing!!
*
*/
public class DbControlNodeInstanceTest extends AbstractDatabaseDependentTest {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import static org.junit.Assert.*;

/**
* TODO: comments are missing!!
*
*/
public class DbControlNodeTest extends AbstractDatabaseDependentTest {
/**
Expand Down
Loading

0 comments on commit a4c9391

Please sign in to comment.