diff --git a/framework/webtools/config/WebtoolsUiLabels.properties b/framework/webtools/config/WebtoolsUiLabels.properties index 37a4ae3ff7..891a38d464 100644 --- a/framework/webtools/config/WebtoolsUiLabels.properties +++ b/framework/webtools/config/WebtoolsUiLabels.properties @@ -167,6 +167,8 @@ WebtoolsImportFile=Import File WebtoolsImportText=Import Text WebtoolsImportToDataSource=XML Import to DataSource(s) WebtoolsImportUpdateToDB=Import/Update to DB? +WebtoolsIndexName=Index Name +WebtoolsIndexFieldList=Index Field List WebtoolsInduceModelXMLFromDatabase=Induce Model XML from Database WebtoolsInfoLogLevel=Info WebtoolsInfoLogLevelTooltip=The Info level designates informational messages that highlight the progress of the application at coarse-grained level. diff --git a/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntityRefMain.bsh b/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntityRefMain.bsh index 0e7b0383f8..2226248cda 100644 --- a/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntityRefMain.bsh +++ b/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntityRefMain.bsh @@ -22,6 +22,7 @@ import org.ofbiz.entity.model.ModelReader; import org.ofbiz.entity.model.ModelEntity; import org.ofbiz.entity.model.ModelField; import org.ofbiz.entity.model.ModelFieldType; +import org.ofbiz.entity.model.ModelIndex; import org.ofbiz.entity.model.ModelRelation; import org.ofbiz.entity.model.ModelKeyMap; import org.ofbiz.base.util.UtilValidate; @@ -97,9 +98,10 @@ if (security.hasPermission("ENTITY_MAINT", session)) { ModelField field = entity.getField(y); ModelFieldType type = delegator.getEntityFieldType(entity, field.getType()); String javaName = null; - javaName = field.getIsPk() ? "" + field.getName() + "" : field.getName(); - javaNameMap.put("name", javaName); + javaNameMap.put("isPk", new Boolean(field.getIsPk())); + javaNameMap.put("name", field.getName()); javaNameMap.put("colName", field.getColName()); + javaNameMap.put("description", field.getDescription()); javaNameMap.put("type", (field.getType()) != null ? field.getType() : null); javaNameMap.put("javaType", (field.getType() != null && type != null) ? type.getJavaType() : "Undefined"); javaNameMap.put("sqlType", (type != null && type.getSqlType() != null) ? type.getSqlType() : "Undefined"); @@ -108,7 +110,6 @@ if (security.hasPermission("ENTITY_MAINT", session)) { } List relationsList = new ArrayList(); - TreeSet relations = new TreeSet(); for (int r = 0; r < entity.getRelationsSize(); r++) { Map relationMap = new HashMap(); @@ -133,6 +134,7 @@ if (security.hasPermission("ENTITY_MAINT", session)) { keysList.add(keysMap); } relationMap.put("title", relation.getTitle()); + //relationMap.put("description", relation.getDescription()); relationMap.put("relEntity", relation.getRelEntityName()); relationMap.put("fkName", relation.getFkName()); relationMap.put("type", relation.getType()); @@ -142,14 +144,32 @@ if (security.hasPermission("ENTITY_MAINT", session)) { relationsList.add(relationMap); } + List indexList = new ArrayList(); + for (int i = 0; i < entity.getIndexesSize(); i++) { + List fieldNameList = new ArrayList(); + + ModelIndex index = entity.getIndex(i); + for (Iterator fieldIterator = index.getIndexFieldsIterator(); fieldIterator.hasNext();) { + fieldNameList.add((String)fieldIterator.next()); + } + + Map indexMap = new HashMap(); + indexMap.put("name", index.getName()); + //indexMap.put("description", index.getDescription()); + indexMap.put("fieldNameList", fieldNameList); + indexList.add(indexMap); + } + entityMap.put("entityName", entityName); entityMap.put("helperName", helperName); entityMap.put("groupName", groupName); entityMap.put("plainTableName", entity.getPlainTableName()); entityMap.put("title", entity.getTitle()); entityMap.put("description", entity.getDescription()); + //entityMap.put("location", entity.getLocation()); entityMap.put("javaNameList", javaNameList); entityMap.put("relationsList", relationsList); + entityMap.put("indexList", indexList); entitiesList.add(entityMap); } } diff --git a/framework/webtools/webapp/webtools/entity/EntityRefMain.ftl b/framework/webtools/webapp/webtools/entity/EntityRefMain.ftl index fd7e1818a4..66ab32af13 100644 --- a/framework/webtools/webapp/webtools/entity/EntityRefMain.ftl +++ b/framework/webtools/webapp/webtools/entity/EntityRefMain.ftl @@ -16,37 +16,49 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> - +<#assign docLangAttr = locale.toString()?replace("_", "-")> +<#assign langDir = "ltr"> +<#if "ar.iw"?contains(docLangAttr?substring(0, 2))> + <#assign langDir = "rtl"> +#if> + +
|
- ${uiLabelMap.WebtoolsEntity}: ${entity.entityName} | ${uiLabelMap.WebtoolsTable}: ${entity.plainTableName?if_exists}
- ${entity.title}
+
+ |
+ ${uiLabelMap.WebtoolsEntity}: ${entity.entityName}
+ <#if entity.plainTableName?has_content> | ${uiLabelMap.WebtoolsTable}: ${entity.plainTableName}#if>
+
+ ${entity.title}
<#if !forstatic>
<#assign encodeURL = response.encodeURL(controlPath + "/FindGeneric?entityName=" + entity.entityName + "&find=true&VIEW_SIZE=50&VIEW_INDEX=0")>
[${uiLabelMap.WebtoolsViewData}]
@@ -55,56 +67,64 @@ under the License.
<#if entity.description?has_content &&
!entity.description.equalsIgnoreCase("NONE") &&
!entity.description.equalsIgnoreCase("")>
- ${entity.description}
+ ${entity.description}
+ #if>
+ <#if entity.location?has_content>
+ ${entity.location}
#if>
${uiLabelMap.WebtoolsJavaName} |
- ${uiLabelMap.WebtoolsDbName} |
- ${uiLabelMap.WebtoolsFieldType} |
- ${uiLabelMap.WebtoolsJavaType} |
- ${uiLabelMap.WebtoolsSqlType} |
+ ${uiLabelMap.WebtoolsJavaName} |
+ ${uiLabelMap.WebtoolsDbName} |
+ ${uiLabelMap.WebtoolsFieldType} |
+ ${uiLabelMap.WebtoolsJavaType} |
+ ${uiLabelMap.WebtoolsSqlType} |
|
- ${javaName.name} |
- ${javaName.colName} |
+ ${javaName.type}
+ |
+ ${javaName.name}
+ <#if javaName.description?has_content>
+ ${javaName.description}
+ #if>
+ ${javaName.colName} |
+ ${javaName.type} |
<#if javaName.javaType?has_content>
- |
- ${javaName.javaType} |
+ ${javaName.sqlType} ${javaName.javaType} |
+ ${javaName.sqlType} |
<#else>
- |
- ${uiLabelMap.WebtoolsNotFound} |
+ ${uiLabelMap.WebtoolsNotFound} ${uiLabelMap.WebtoolsNotFound} |
+ ${uiLabelMap.WebtoolsNotFound} |
#if>
|
- ${uiLabelMap.WebtoolsRelation} |
- ${uiLabelMap.WebtoolsRelationType} |
- |
+ ${uiLabelMap.WebtoolsRelation} |
+ ${uiLabelMap.WebtoolsRelationType} |
+
- |
- ${relation.title}${relation.relEntity}
-
+ <#if relation.title?has_content>${relation.title} #if>${relation.relEntity}
<#if relation.fkName?has_content>
- ${uiLabelMap.WebtoolsFKName}: ${relation.fkName}
+ ${uiLabelMap.WebtoolsFKName}: ${relation.fkName} + #if> + <#if relation.description?has_content> + ${relation.description} #if>
- |
+
- ${relation.type}:
- <#if relation.length == 3>
-
- #if>
- <#if relation.keysList?has_content>
+ ${relation.type}:
+ <#if relation.length == 3>
+
+ #if>
+ <#if relation.keysList?has_content>
<#list relation.keysList as keyList>
+ #if>
+ ${keyList.row}) <#if keyList.fieldName == keyList.relFieldName> @@ -113,8 +133,26 @@ under the License. ${keyList.fieldName} : ${keyList.relFieldName} #if> #list> - #if> - |
+ ${uiLabelMap.WebtoolsIndexName} |
+ ${uiLabelMap.WebtoolsIndexFieldList} |
+ ${index.name} |
+
+ <#list index.fieldNameList as fieldName>
+ ${fieldName}
+ #list>
|
| |||||||||||||||||||||||||||||||||||