Skip to content

Commit

Permalink
Merge pull request #1992 from dangkhanhtrung/release-candidate-2.2
Browse files Browse the repository at this point in the history
Update API dossier template and import tool
  • Loading branch information
tranvietlam92 authored Jul 2, 2019
2 parents cfc8a2d + 134c9d9 commit e34500c
Show file tree
Hide file tree
Showing 47 changed files with 240 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,14 @@ public Response addDossierTemplate(HttpServletRequest request, HttpHeaders heade
String templateName = HtmlUtil.escape(input.getTemplateName());
String templateNo = HtmlUtil.escape(input.getTemplateNo());
String description = HtmlUtil.escape(input.getDescription());
String newFormScript = input.getNewFormScript();

// if (!auth.hasResource(serviceContext, DossierTemplate.class.getName(), ActionKeys.ADD_ENTRY)) {
// throw new UnauthorizationException();
// }

DossierTemplate dossierTemplate = actions.updateDossierTemplate(groupId, 0l, templateName,
templateNo, description, serviceContext);
templateNo, description, newFormScript, serviceContext);

DossierTemplateInputModel result = DossierTemplateUtils.mappingForTemplatePOST(dossierTemplate);

Expand Down Expand Up @@ -190,13 +191,14 @@ public Response updateDossierTemplateDetail(HttpServletRequest request, HttpHead
String templateName = HtmlUtil.escape(input.getTemplateName());
String templateNo = HtmlUtil.escape(input.getTemplateNo());
String description = HtmlUtil.escape(input.getDescription());
String newFormScript = input.getNewFormScript();

// if (!auth.hasResource(serviceContext, DossierTemplate.class.getName(), ActionKeys.ADD_ENTRY)) {
// throw new UnauthorizationException();
// }

DossierTemplate dossierTemplate = actions.updateDossierTemplate(groupId, id, templateName,
templateNo, description, serviceContext);
templateNo, description, newFormScript, serviceContext);

DossierTemplateDetailModel result = DossierTemplateUtils.mappingForTemplateGetDetail(dossierTemplate);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public Response addDossierImportData(HttpServletRequest request, HttpHeaders hea
DossierTemplateLocalServiceUtil.updateDossierTemplateDB(user.getUserId(), groupId,
"TT130_BVHTTDL",
"Cấp phép nhập khẩu văn hóa phẩm không nhằm mục đích kinh doanh thuộc thẩm quyền của Bộ Văn hóa, Thể thao và Du lịch",
"", serviceContext);
"", StringPool.BLANK, serviceContext);
}

DossierPart part1 = DossierPartLocalServiceUtil.fetchByTemplatePartNo(groupId, dossierTemplateNo, "TP1");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public static List<DossierTemplateDataModel> mappingToDossierTemplateList(List<D
model.setTemplateName(doc.get(DossierTemplateTerm.TEMPLATE_NAME));
model.setTemplateNo(doc.get(DossierTemplateTerm.TEMPLATE_NO));
model.setDescription(doc.get(DossierTemplateTerm.DESCRIPTION));
model.setNewFormScript(doc.get(DossierTemplateTerm.NEWFORM_SCRIPT));

outputs.add(model);
}
Expand All @@ -50,6 +51,7 @@ public static DossierTemplateInputModel mappingForTemplatePOST(DossierTemplate d
output.setDescription(dossierTemplate.getDescription());
output.setTemplateName(dossierTemplate.getTemplateName());
output.setTemplateNo(dossierTemplate.getTemplateNo());
output.setNewFormScript(dossierTemplate.getNewFormScript());

return output;
}
Expand All @@ -65,7 +67,8 @@ public static DossierTemplateDetailModel mappingForTemplateGetDetail(DossierTemp
APIDateTimeUtils._NORMAL_PARTTERN));
output.setModifiedDate(APIDateTimeUtils.convertDateToString(dossierTemplate.getModifiedDate(),
APIDateTimeUtils._NORMAL_PARTTERN));

output.setNewFormScript(dossierTemplate.getNewFormScript());

List<DossierTemplatePartDataModel> inputs = new ArrayList<DossierTemplatePartDataModel>();

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -765,9 +765,11 @@ public static boolean processUpdateDossierTemplate(DossierTemplate template, Str
String templateNo = template.getTemplateNo();
String templateName = template.getTemplateName();
String description = template.getDescription();
String newFormScript = template.getNewFormScript();

// Update serviceInfo
DossierTemplateActions actionTemp = new DossierTemplateActionsImpl();
actionTemp.updateDossierTemplateDB(userId, groupId, templateNo, templateName, description, serviceContext);
actionTemp.updateDossierTemplateDB(userId, groupId, templateNo, templateName, description, newFormScript, serviceContext);
// Update fileName
Parts parts = template.getParts();
if (parts != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
* &lt;element name="templateName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="templateNo" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="newFormScript" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
Expand All @@ -44,7 +45,8 @@
"modifiedDate",
"templateName",
"description",
"templateNo"
"templateNo",
"newFormScript"
})
public class DossierTemplateDataModel {

Expand All @@ -54,6 +56,7 @@ public class DossierTemplateDataModel {
protected String templateName;
protected String description;
protected String templateNo;
protected String newFormScript;

/**
* Gets the value of the dossierTemplateId property.
Expand Down Expand Up @@ -199,4 +202,27 @@ public void setTemplateNo(String value) {
this.templateNo = value;
}

/**
* Gets the value of the newFormScript property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getNewFormScript() {
return newFormScript;
}

/**
* Sets the value of the newFormScript property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setNewFormScript(String value) {
this.templateNo = value;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
* &lt;element name="templateName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="templateNo" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="newFormScript" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="dossierParts" type="{}DossierTemplatePartDataModel" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
Expand All @@ -49,6 +50,7 @@
"templateName",
"description",
"templateNo",
"newFormScript",
"dossierParts"
})
@XmlRootElement(name = "DossierTemplateDetailModel")
Expand All @@ -60,6 +62,7 @@ public class DossierTemplateDetailModel {
protected String templateName;
protected String description;
protected String templateNo;
protected String newFormScript;
protected List<DossierTemplatePartDataModel> dossierParts;

/**
Expand Down Expand Up @@ -206,6 +209,30 @@ public void setTemplateNo(String value) {
this.templateNo = value;
}

/**
* Gets the value of the newFormScript property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getNewFormScript() {
return newFormScript;
}

/**
* Sets the value of the newFormScript property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setNewFormScript(String value) {
this.templateNo = value;
}

/**
* Gets the value of the dossierParts property.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
* &lt;element name="templateName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="templateNo" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="newFormScript" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
Expand All @@ -42,7 +43,8 @@
"dossierTemplateId",
"templateName",
"description",
"templateNo"
"templateNo",
"newFormScript"
})
@XmlRootElement(name = "DossierTemplateInputModel")
public class DossierTemplateInputModel {
Expand All @@ -54,7 +56,9 @@ public class DossierTemplateInputModel {
protected String description;
@FormParam(value = "templateNo")
protected String templateNo;

@FormParam(value = "newFormScript")
protected String newFormScript;

/**
* Gets the value of the dossierTemplateId property.
*
Expand Down Expand Up @@ -151,4 +155,27 @@ public void setTemplateNo(String value) {
this.templateNo = value;
}

/**
* Gets the value of the newFormScript property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getNewFormScript() {
return newFormScript;
}

/**
* Sets the value of the newFormScript property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setNewFormScript(String value) {
this.newFormScript = value;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2019.06.21 at 04:27:41 PM ICT
// Generated on: 2019.07.02 at 10:50:30 AM ICT
//


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2019.06.21 at 04:27:41 PM ICT
// Generated on: 2019.07.02 at 10:50:30 AM ICT
//


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2019.06.21 at 04:27:41 PM ICT
// Generated on: 2019.07.02 at 10:50:30 AM ICT
//


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2019.06.21 at 04:27:41 PM ICT
// Generated on: 2019.07.02 at 10:50:30 AM ICT
//


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2019.06.21 at 04:27:41 PM ICT
// Generated on: 2019.07.02 at 10:50:30 AM ICT
//


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2019.06.21 at 04:27:41 PM ICT
// Generated on: 2019.07.02 at 10:50:30 AM ICT
//


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2019.06.21 at 04:27:41 PM ICT
// Generated on: 2019.07.02 at 10:50:30 AM ICT
//


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2019.06.21 at 04:27:41 PM ICT
// Generated on: 2019.07.02 at 10:50:30 AM ICT
//


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2019.06.21 at 04:27:41 PM ICT
// Generated on: 2019.07.02 at 10:50:30 AM ICT
//


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2019.06.21 at 04:27:41 PM ICT
// Generated on: 2019.07.02 at 10:50:30 AM ICT
//


Expand Down Expand Up @@ -46,6 +46,13 @@
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/element>
* &lt;element name="newFormScript">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;maxLength value="65535"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;/element>
* &lt;element ref="{}parts"/>
* &lt;/sequence>
* &lt;/restriction>
Expand All @@ -60,6 +67,7 @@
"templateNo",
"templateName",
"description",
"newFormScript",
"parts"
})
@XmlRootElement(name = "DossierTemplate")
Expand All @@ -72,6 +80,8 @@ public class DossierTemplate {
@XmlElement(required = true)
protected String description;
@XmlElement(required = true)
protected String newFormScript;
@XmlElement(required = true)
protected Parts parts;

/**
Expand Down Expand Up @@ -146,6 +156,30 @@ public void setDescription(String value) {
this.description = value;
}

/**
* Gets the value of the newFormScript property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getNewFormScript() {
return newFormScript;
}

/**
* Sets the value of the newFormScript property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setNewFormScript(String value) {
this.newFormScript = value;
}

/**
* Gets the value of the parts property.
*
Expand Down
Loading

0 comments on commit e34500c

Please sign in to comment.