📄 uixmlfileutil.java
字号:
delegator, outputFile));
screenSectionEntityGVL.addAll(writeSqlInserts(
"UiRelatedScreenSection", UtilMisc.toMap("sectionId", sectionId), UtilMisc.toList("relatedScreenSectionId"),
delegator, outputFile));
screenSectionInfoGVL.addAll(writeSqlInserts(
"UiScreenSectionInfo", UtilMisc.toMap("sectionId", sectionId, "partyId", partyId), UtilMisc.toList("attributeId"),
delegator, outputFile));
}
resultString += (String.valueOf(screenSectionEntityGVL.size()) +
" section entities<BR>\n");
resultString += (String.valueOf(screenSectionInfoGVL.size()) +
" section fields");
screenSectionGVI = null;
writeFooter(outputFile);
outputFile.close();
return resultString;
} catch (IOException e) {
Debug.logError(
"[UISQLFileWriter.writeUiScreenSql]: IO Exception - Error was:", module);
Debug.logError(e.getMessage(), module);
return e.getMessage();
} catch (SecurityException se) {
Debug.logError(
"[UISQLFileWriter.writeUiScreenSql]: Security Exception - Error was:", module);
Debug.logError(se.getMessage(), module);
return se.getMessage();
}
}
public String writeUiReportFile(GenericDelegator delegator, String reportId, String filePath) {
HashMap findHashMap = new HashMap();
ArrayList findOrder = null;
ModelEntity modelEntity = null;
GenericValue genericValue = null;
String entityName = "";
String resultString = "";
try {
// Open the file, and replace any existing contents.
FileWriter tempFile = new FileWriter(filePath, false);
PrintWriter outputFile = new PrintWriter( new BufferedWriter(tempFile));
writeHeader(outputFile);
////////////////////
// Write out the SQL for inserting the report.
////////////////////
List reportGVL = null;
reportGVL = writeSqlInserts("UiReport", UtilMisc.toMap("reportId", reportId), UtilMisc.toList("reportId"),
delegator, outputFile);
if (reportGVL.size() <= 0) {
return "No report found with ID \"" + reportId + "\"";
} else {
resultString += (String.valueOf(reportGVL.size()) +
" reports<BR>\n");
}
////////////////////
// Write out the SQL for inserting the screen sections.
////////////////////
// Loop through the reports. (Should be only one.)
Iterator reportGVI = reportGVL.iterator();
while (reportGVI.hasNext()) {
////////////////////
// Write out the SQL for inserting the Fields, Conditions, and OrderBys.
////////////////////
GenericValue reportGV = (GenericValue) reportGVI.next();
writeSqlInserts(
"UiReportField", UtilMisc.toMap("reportId", reportId), UtilMisc.toList("reportFieldId"),
delegator, outputFile);
writeSqlInserts(
"UiReportCriteria", UtilMisc.toMap("reportId", reportId), UtilMisc.toList("reportCriteriaId"),
delegator, outputFile);
writeSqlInserts(
"UiReportOrderBy", UtilMisc.toMap("reportId", reportId), UtilMisc.toList("reportOrderId"),
delegator, outputFile);
}
writeFooter(outputFile);
outputFile.close();
return resultString;
} catch (IOException e) {
Debug.logError(
"[UISQLFileWriter.writeUiScreenSql]: IO Exception - Error was:", module);
Debug.logError(e.getMessage(), module);
return e.getMessage();
} catch (SecurityException se) {
Debug.logError(
"[UISQLFileWriter.writeUiScreenSql]: Security Exception - Error was:", module);
Debug.logError(se.getMessage(), module);
return se.getMessage();
}
}
/**
* DOCUMENT ME!
*
* @param delegator
* @param displayObjectId
* @param filePath
*
* @return
*/
public String writeUiDisplayObjectFile(GenericDelegator delegator,
String displayObjectId, String filePath) {
HashMap findHashMap = new HashMap();
ArrayList findOrder = null;
ModelEntity modelEntity = null;
GenericValue genericValue = null;
String entityName = "";
String resultString = "";
try {
// Open the file, and replace any existing contents.
FileWriter tempFile = new FileWriter(filePath, false);
PrintWriter outputFile = new PrintWriter( new BufferedWriter(tempFile));
writeHeader(outputFile);
////////////////////
// Write out the SQL for inserting the display object.
////////////////////
List uiDisplayObjectGVL = null;
findHashMap = new HashMap();
findHashMap.put("displayObjectId", displayObjectId);
findOrder = new ArrayList();
findOrder.add("displayObjectId");
uiDisplayObjectGVL = writeSqlInserts("UiDisplayObject",
findHashMap, findOrder, delegator, outputFile);
if (uiDisplayObjectGVL.size() <= 0) {
return "No display object found with ID \"" + displayObjectId +
"\"";
} else {
resultString += (String.valueOf(uiDisplayObjectGVL.size()) +
" display objects<BR>\n");
}
////////////////////
// Write out the SQL for inserting the display object attributes.
////////////////////
// Loop through the display objects. (Should be only one).
Iterator displayObjectGVI = uiDisplayObjectGVL.iterator();
List uiDisplayObjectAttribGVL = new LinkedList();
while (displayObjectGVI.hasNext()) {
GenericValue uiDisplayObjectGV = (GenericValue) displayObjectGVI.next();
findHashMap = new HashMap();
findHashMap.put("displayObjectId",
uiDisplayObjectGV.getString("displayObjectId"));
findOrder = new ArrayList();
findOrder.add("displayObjectId");
findOrder.add("displayAttribId");
uiDisplayObjectAttribGVL.addAll(writeSqlInserts(
"UiDisplayObjectAttrib", findHashMap, findOrder,
delegator, outputFile));
}
resultString += (String.valueOf(uiDisplayObjectAttribGVL.size()) +
" display object attributes<BR>\n");
displayObjectGVI = null;
writeFooter(outputFile);
outputFile.close();
return resultString;
} catch (IOException e) {
Debug.logError(
"[UISQLFileWriter.writeUiDisplayObjectSql]: IO Exception - Error was:", module);
Debug.logError(e.getMessage(), module);
return e.getMessage();
} catch (SecurityException se) {
Debug.logError(
"[UISQLFileWriter.writeUiDisplayObjectSql]: Security Exception - Error was:", module);
Debug.logError(se.getMessage(), module);
return se.getMessage();
}
}
/**
* DOCUMENT ME!
*
* @param delegator
* @param displayTypeId
* @param filePath
*
* @return
*/
public String writeUiDisplayTypeFile(GenericDelegator delegator,
String displayTypeId, String filePath) {
HashMap findHashMap = new HashMap();
ArrayList findOrder = null;
ModelEntity modelEntity = null;
GenericValue genericValue = null;
String entityName = "";
String resultString = "";
try {
// Open the file, and replace any existing contents.
FileWriter tempFile = new FileWriter(filePath, false);
PrintWriter outputFile = new PrintWriter( new BufferedWriter(tempFile));
writeHeader(outputFile);
////////////////////
// Write out the SQL for inserting the display type.
////////////////////
List uiDisplayTypeGVL = null;
findHashMap = new HashMap();
findHashMap.put("displayTypeId", displayTypeId);
findOrder = new ArrayList();
findOrder.add("displayTypeId");
uiDisplayTypeGVL = writeSqlInserts("UiDisplayType", findHashMap,
findOrder, delegator, outputFile);
if (uiDisplayTypeGVL.size() <= 0) {
return "No display type found with ID \"" + displayTypeId +
"\"";
} else {
resultString += (String.valueOf(uiDisplayTypeGVL.size()) +
" display types<BR>\n");
}
////////////////////
// Write out the SQL for inserting the display attributes.
////////////////////
// Loop through the display types. (Should be only one).
Iterator displayTypeGVI = uiDisplayTypeGVL.iterator();
List uiDisplayAttribGVL = new LinkedList();
while (displayTypeGVI.hasNext()) {
GenericValue displayTypeGV = (GenericValue) displayTypeGVI.next();
findHashMap = new HashMap();
findHashMap.put("displayTypeId",
displayTypeGV.getString("displayTypeId"));
findOrder = new ArrayList();
findOrder.add("displayTypeId");
findOrder.add("displayAttribId");
uiDisplayAttribGVL.addAll(writeSqlInserts("UiDisplayAttrib",
findHashMap, findOrder, delegator, outputFile));
}
resultString += (String.valueOf(uiDisplayAttribGVL.size()) +
" display attributes<BR>\n");
displayTypeGVI = null;
writeFooter(outputFile);
outputFile.close();
return resultString;
} catch (IOException e) {
Debug.logError(
"[UISQLFileWriter.writeUiDisplayTypeSql]: IO Exception - Error was:", module);
Debug.logError(e.getMessage(), module);
return e.getMessage();
} catch (SecurityException se) {
Debug.logError(
"[UISQLFileWriter.writeUiDisplayTypeSql]: Security Exception - Error was:", module);
Debug.logError(se.getMessage(), module);
return se.getMessage();
}
}
/**
* DOCUMENT ME!
*
* @param delegator
* @param entityId
* @param filePath
*
* @return
*/
public String writeUiEntityFile(GenericDelegator delegator,
String entityId, String filePath) {
HashMap findHashMap = new HashMap();
ArrayList findOrder = null;
ModelEntity modelEntity = null;
GenericValue genericValue = null;
String entityName = "";
String resultString = "";
try {
// Open the file, and replace any existing contents.
FileWriter tempFile = new FileWriter(filePath, false);
PrintWriter outputFile = new PrintWriter( new BufferedWriter(tempFile));
writeHeader(outputFile);
////////////////////
// Write out the SQL for inserting the UI entity.
////////////////////
List uiEntityGVL = null;
findHashMap = new HashMap();
findHashMap.put("entityId", entityId);
findOrder = new ArrayList();
findOrder.add("entityId");
uiEntityGVL = writeSqlInserts("UiEntity", findHashMap, findOrder,
delegator, outputFile);
if (uiEntityGVL.size() <= 0) {
return "No entity found with ID \"" + entityId + "\"";
} else {
resultString += (String.valueOf(uiEntityGVL.size()) +
" UI entities<BR>\n");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -