Skip to content

Commit

Permalink
Revert "Canan-591 - take 12"
Browse files Browse the repository at this point in the history
This reverts commit b5ba02c.
  • Loading branch information
lexevs authored and safrant committed May 7, 2019
1 parent b4fc21e commit 0f43857
Show file tree
Hide file tree
Showing 9 changed files with 161 additions and 217 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -341,13 +341,13 @@ public boolean isWithProperties() {
return withProperties;
}

// public ComposingElementBean getTheComposingElement() {
// return theComposingElement;
// }
public ComposingElementBean getTheComposingElement() {
return theComposingElement;
}

// public void setTheComposingElement(ComposingElementBean theComposingElement) {
// this.theComposingElement = theComposingElement;
// }
public void setTheComposingElement(ComposingElementBean theComposingElement) {
this.theComposingElement = theComposingElement;
}

// used for DWR ajax in bodySubmitChemicalAssociation.jsp
public String getDomainId() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public Response setup(@Context HttpServletRequest httpRequest, @DefaultValue("")
return Response.ok(dropdownMap).header("Access-Control-Allow-Credentials", "true").header("Access-Control-Allow-Origin", "*").header("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS").header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization").build();

} catch (Exception e) {
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(CommonUtil.wrapErrorMessageInList("Error while setting up drop down lists " + e.getMessage())).build();
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(CommonUtil.wrapErrorMessageInList("Error while setting up drop down lists" + e.getMessage())).build();

}
}
Expand Down Expand Up @@ -98,7 +98,7 @@ public Response saveComposingElement(@Context HttpServletRequest httpRequest, Si
@POST
@Path("/removeComposingElement")
@Produces ("application/json")
public Response removeComposingElement(@Context HttpServletRequest httpRequest, @DefaultValue("") @QueryParam("composingElementId") String composingElementId, SimpleNanomaterialEntityBean nanoBean) {
public Response removeComposingElement(@Context HttpServletRequest httpRequest, SimpleNanomaterialEntityBean nanoBean) {

try {
NanomaterialEntityBO nanomaterialEntityBO =
Expand All @@ -107,7 +107,7 @@ public Response removeComposingElement(@Context HttpServletRequest httpRequest,
return Response.status(Response.Status.UNAUTHORIZED)
.entity("Session expired").build();

SimpleNanomaterialEntityBean nano = nanomaterialEntityBO.removeComposingElement(nanoBean, composingElementId, httpRequest);
SimpleNanomaterialEntityBean nano = nanomaterialEntityBO.removeComposingElement(nanoBean, httpRequest);
List<String> errors = nano.getErrors();
return (errors == null || errors.size() == 0) ?
Response.ok(nano).build() :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,36 +87,31 @@ public void persistNanomaterialEntityDropdowns(HttpServletRequest request,
"averageLengthUnit", "otherAverageLengthUnit",
entityBean.getCarbonNanotube().getAverageLengthUnit());

List ces = entityBean.getComposingElements();
if (ces.size()>0) {


ComposingElementBean theComposingElement = entityBean
.getComposingElements().get(0);
if (entityBean.getDomainEntity() instanceof Emulsion) {
InitSetup.getInstance().persistLookup(request, "emulsion",
"composingElementType", "otherComposingElementType",
theComposingElement.getDomain().getType());
} else {
InitSetup.getInstance().persistLookup(request, "composing element",
"type", "otherType",
theComposingElement.getDomain().getType());
}
ComposingElementBean theComposingElement = entityBean
.getTheComposingElement();
if (entityBean.getDomainEntity() instanceof Emulsion) {
InitSetup.getInstance().persistLookup(request, "emulsion",
"composingElementType", "otherComposingElementType",
theComposingElement.getDomain().getType());
} else {
InitSetup.getInstance().persistLookup(request, "composing element",
"valueUnit", "otherValueUnit",
theComposingElement.getDomain().getValueUnit());
InitSetup.getInstance().persistLookup(request, "molecular formula",
"type", "otherType",
theComposingElement.getDomain().getMolecularFormulaType());

InitSetup.getInstance().persistLookup(
request,
"imaging function",
"modality",
"otherModality",
theComposingElement.getTheFunction().getImagingFunction()
.getModality());
theComposingElement.getDomain().getType());
}
InitSetup.getInstance().persistLookup(request, "composing element",
"valueUnit", "otherValueUnit",
theComposingElement.getDomain().getValueUnit());
InitSetup.getInstance().persistLookup(request, "molecular formula",
"type", "otherType",
theComposingElement.getDomain().getMolecularFormulaType());

InitSetup.getInstance().persistLookup(
request,
"imaging function",
"modality",
"otherModality",
theComposingElement.getTheFunction().getImagingFunction()
.getModality());

InitSetup.getInstance().persistLookup(request, "file", "type",
"otherType", entityBean.getTheFile().getDomainFile().getType());
Expand Down
Loading

0 comments on commit 0f43857

Please sign in to comment.