details: https://code.openbravo.com/erp/devel/pi/rev/9c1e0fc3aaad
changeset: 13482:9c1e0fc3aaad
user: Javier Etxarri <javier.echarri <at> openbravo.com>
date: Tue Aug 09 11:49:19 2011 +0200
summary: Fixes issue 16760: Show audit info button is cached
diffstat:
modules/org.openbravo.client.application/src/org/openbravo/client/application/ViewComponent.java
| 26 ++++++++++
modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/BaseComponent.java
| 5 -
2 files changed, 26 insertions(+), 5 deletions(-)
diffs (73 lines):
diff -r 0520348593b2 -r 9c1e0fc3aaad
modules/org.openbravo.client.application/src/org/openbravo/client/application/ViewComponent.java
---
a/modules/org.openbravo.client.application/src/org/openbravo/client/application/ViewComponent.java
Tue Aug 09 11:44:11 2011 +0200
+++
b/modules/org.openbravo.client.application/src/org/openbravo/client/application/ViewComponent.java
Tue Aug 09 11:49:19 2011 +0200
@@ -20,6 +20,7 @@
import javax.inject.Inject;
+import org.apache.commons.codec.digest.DigestUtils;
import org.hibernate.criterion.Restrictions;
import org.openbravo.base.exception.OBException;
import org.openbravo.base.util.OBClassLoader;
@@ -35,6 +36,7 @@
import org.openbravo.erpCommon.obps.ActivationKey;
import org.openbravo.erpCommon.obps.ActivationKey.FeatureRestriction;
import org.openbravo.model.ad.module.Module;
+import org.openbravo.model.ad.ui.Tab;
import org.openbravo.model.ad.ui.Window;
/**
@@ -50,6 +52,8 @@
@Inject
private WeldUtils weldUtils;
+ private static String viewVersionHash = null;
+
@Override
public String generate() {
@@ -160,4 +164,26 @@
return this;
}
+ @Override
+ public String getETag() {
+ String etag = super.getETag();
+
+ return etag + "_" + getViewVersionHash();
+ }
+
+ synchronized private String getViewVersionHash() {
+ String viewVersions = "";
+ final String viewId = getParameter("viewId");
+ OBContext.setAdminMode();
+ try {
+ Window window = OBDal.getInstance().get(Window.class,
correctViewId(viewId));
+ for (Tab t : window.getADTabList()) {
+ viewVersions += t.getTable().isFullyAudited() + "|";
+ }
+ viewVersionHash = DigestUtils.md5Hex(viewVersions);
+ } finally {
+ OBContext.restorePreviousMode();
+ }
+ return viewVersionHash;
+ }
}
diff -r 0520348593b2 -r 9c1e0fc3aaad
modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/BaseComponent.java
---
a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/BaseComponent.java
Tue Aug 09 11:44:11 2011 +0200
+++
b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/BaseComponent.java
Tue Aug 09 11:49:19 2011 +0200
@@ -182,14 +182,9 @@
*/
public String getETag() {
if (hasModulesInDevelopment()) {
- // if (getModule().isInDevelopment() != null &&
getModule().isInDevelopment()) {
-
return OBContext.getOBContext().getLanguage().getId() + "_" +
getLastModified().getTime();
} else {
return OBContext.getOBContext().getLanguage().getId() + "_" +
getModuleVersionHash();
- // return OBContext.getOBContext().getLanguage().getId() + "_" +
getModule().getVersion() +
- // "_"
- // + getModule().isEnabled();
}
}
------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at: http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits