diff --git a/applications/content/webapp/content/WEB-INF/actions/content/GetContentLookupList.groovy b/applications/content/webapp/content/WEB-INF/actions/content/GetContentLookupList.groovy index dfb34c88c4..51aea9cd60 100644 --- a/applications/content/webapp/content/WEB-INF/actions/content/GetContentLookupList.groovy +++ b/applications/content/webapp/content/WEB-INF/actions/content/GetContentLookupList.groovy @@ -35,7 +35,7 @@ try { viewIndex = Integer.valueOf((String)parameters.get("VIEW_INDEX")).intValue(); } catch (NumberFormatException nfe) { - viewIndex = 0; + viewIndex = 0; } context.viewIndexFirst = 0; @@ -70,9 +70,9 @@ if (errMsgList) { curFindString = UtilFormatOut.encodeQuery(curFindString); context.curFindString = curFindString; try { - viewSize = Integer.valueOf((String)parameters.get("VIEW_SIZE")).intValue(); + viewSize = Integer.valueOf((String)parameters.get("VIEW_SIZE")).intValue(); } catch (NumberFormatException nfe) { - + } context.viewSize = viewSize; @@ -83,42 +83,42 @@ int highIndex = (viewIndex+1)*viewSize; context.lowIndex = lowIndex; int arraySize = 0; List resultPartialList = null; - conditions = [EntityCondition.makeCondition("contentIdStart", EntityOperator.EQUALS,(String)parameters.get("contentId"))]; + conditions = [EntityCondition.makeCondition("contentIdStart", EntityOperator.EQUALS,(String)parameters.get("contentId"))]; if ((highIndex - lowIndex + 1) > 0) { - // get the results as an entity list iterator - boolean beganTransaction = false; - if(resultPartialList==null){ + // get the results as an entity list iterator + boolean beganTransaction = false; + if(resultPartialList==null){ try { - beganTransaction = TransactionUtil.begin(); - allConditions = EntityCondition.makeCondition( conditions, EntityOperator.AND ); - fieldsToSelect = FastSet.newInstance(); - //fieldsToSelect=["contentId", "contentName", "mimeTypeId"] as Set; - findOptions = new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, true); - EntityListIterator listIt=null; - listIt = delegator.find("ContentAssocViewTo", allConditions, null, null, ["contentId ASC"], findOptions); - resultPartialList = listIt.getPartialList(lowIndex, highIndex - lowIndex + 1); - - arraySize = listIt.getResultsSizeAfterPartialList(); - if (arraySize < highIndex) { - highIndex = arraySize; - } - listIt.close(); - } catch (GenericEntityException e) { - Debug.logError(e, "Failure in operation, rolling back transaction", "GetContentLookupList.groovy"); - try { - // only rollback the transaction if we started one... - TransactionUtil.rollback(beganTransaction, "Error looking up entity values in WebTools Entity Data Maintenance", e); - } catch (GenericEntityException e2) { - Debug.logError(e2, "Could not rollback transaction: " + e2.toString(), "GetContentLookupList.groovy"); - } - // after rolling back, rethrow the exception - throw e; - } finally { - // only commit the transaction if we started one... this will throw an exception if it fails - TransactionUtil.commit(beganTransaction); - } - } + beganTransaction = TransactionUtil.begin(); + allConditions = EntityCondition.makeCondition( conditions, EntityOperator.AND ); + fieldsToSelect = FastSet.newInstance(); + //fieldsToSelect=["contentId", "contentName", "mimeTypeId"] as Set; + findOptions = new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, true); + EntityListIterator listIt=null; + listIt = delegator.find("ContentAssocViewTo", allConditions, null, null, ["contentId ASC"], findOptions); + resultPartialList = listIt.getPartialList(lowIndex, highIndex - lowIndex + 1); + + arraySize = listIt.getResultsSizeAfterPartialList(); + if (arraySize < highIndex) { + highIndex = arraySize; + } + listIt.close(); + } catch (GenericEntityException e) { + Debug.logError(e, "Failure in operation, rolling back transaction", "GetContentLookupList.groovy"); + try { + // only rollback the transaction if we started one... + TransactionUtil.rollback(beganTransaction, "Error looking up entity values in WebTools Entity Data Maintenance", e); + } catch (GenericEntityException e2) { + Debug.logError(e2, "Could not rollback transaction: " + e2.toString(), "GetContentLookupList.groovy"); + } + // after rolling back, rethrow the exception + throw e; + } finally { + // only commit the transaction if we started one... this will throw an exception if it fails + TransactionUtil.commit(beganTransaction); + } + } } context.highIndex = highIndex; context.arraySize = arraySize; diff --git a/applications/content/webapp/content/content/ContentNav.ftl b/applications/content/webapp/content/content/ContentNav.ftl index 873e22e31f..10f3bc6d53 100644 --- a/applications/content/webapp/content/content/ContentNav.ftl +++ b/applications/content/webapp/content/content/ContentNav.ftl @@ -77,13 +77,13 @@ <#-------------------------------------------------------------------------------------call ofbiz function--> function callDocument(ctx) { - var tabitem='${tabButtonItem?if_exists}'; - if(tabitem=="navigateContent") - listDocument='<@ofbizUrl>/views/ListDocument@ofbizUrl>'; + var tabitem='${tabButtonItem?if_exists}'; + if(tabitem=="navigateContent") + listDocument='<@ofbizUrl>/views/ListDocument@ofbizUrl>'; if(tabitem=="LookupContentTree") - listDocument='<@ofbizUrl>/views/ListContentTree@ofbizUrl>'; + listDocument='<@ofbizUrl>/views/ListContentTree@ofbizUrl>'; if(tabitem=="LookupDetailContentTree") - listDocument='<@ofbizUrl>/views/ViewContentDetail@ofbizUrl>'; + listDocument='<@ofbizUrl>/views/ViewContentDetail@ofbizUrl>'; var bindArgs = { url: listDocument, method: 'POST', @@ -199,8 +199,8 @@ } <#------------------------------------------------------pagination function --> function nextPrevDocumentList(url){ - url= '<@ofbizUrl>'+url+'@ofbizUrl>'; - var bindArgs = { + url= '<@ofbizUrl>'+url+'@ofbizUrl>'; + var bindArgs = { url: url, method: 'POST', mimetype: 'text/html', @@ -222,12 +222,12 @@ font-size: 10px; } <#if tabButtonItem?has_content> - <#if tabButtonItem=="LookupContentTree"||tabButtonItem=="LookupDetailContentTree"> + <#if tabButtonItem=="LookupContentTree"||tabButtonItem=="LookupDetailContentTree"> body{background:none;} .left-border{float:left;width:25%;} .contentarea{margin: 0 0 0 0.5em;padding:0 0 0 0.5em;} .leftonly{float:none;min-height:25em;} - #if> + #if> #if> diff --git a/applications/content/webapp/content/lookup/ContentTreeLookupList.ftl b/applications/content/webapp/content/lookup/ContentTreeLookupList.ftl index 4d12fa8dfd..6ea6ded7e3 100644 --- a/applications/content/webapp/content/lookup/ContentTreeLookupList.ftl +++ b/applications/content/webapp/content/lookup/ContentTreeLookupList.ftl @@ -40,7 +40,7 @@
| ${contentData.contentId?if_exists} | -${contentData.contentName?if_exists} | -${contentData.mimeTypeId?if_exists} | -|||
| ${contentData.contentId?if_exists} | -${contentData.contentTypeId?if_exists} | -${contentData.mimeTypeId?if_exists} | -${contentData.statusId?if_exists} | - <#if contentData.caFromDate?has_content> + <#assign alt_row = false/> + <#assign listcount=0> + <#list contentAssoc as contentData> + <#if tabButtonItem=="ListContentTree"> + <#--Form ListContentTree--> +||
| ${contentData.contentId?if_exists} | +${contentData.contentName?if_exists} | +${contentData.mimeTypeId?if_exists} | +|||
| ${contentData.contentId?if_exists} | +${contentData.contentTypeId?if_exists} | +${contentData.mimeTypeId?if_exists} | +${contentData.statusId?if_exists} | + <#if contentData.caFromDate?has_content> <#assign caFromDate = Static["org.ofbiz.base.util.UtilDateTime"].toDateString(contentData.caFromDate, "dd/MM/yyyy")/> #if> -${caFromDate?if_exists} | -${uiLabelMap.CommonDelete} | -${caFromDate?if_exists} | +${uiLabelMap.CommonDelete} | + + + #if> + <#assign alt_row = !alt_row/> + <#assign listcount=listcount+1> + #list> #if>