Author: hoang_to
Date: 2010-08-24 12:18:03 -0400 (Tue, 24 Aug 2010)
New Revision: 3911
Modified:
exo/portal/branches/3.1.x/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetRegistryServiceImpl.java
exo/portal/branches/3.1.x/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java
Log:
EXOGTN-17: Disable caching and add debug for gadgets while running GateIn in developping
mode
Modified:
exo/portal/branches/3.1.x/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetRegistryServiceImpl.java
===================================================================
---
exo/portal/branches/3.1.x/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetRegistryServiceImpl.java 2010-08-24
16:14:04 UTC (rev 3910)
+++
exo/portal/branches/3.1.x/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetRegistryServiceImpl.java 2010-08-24
16:18:03 UTC (rev 3911)
@@ -26,6 +26,7 @@
import org.exoplatform.application.registry.impl.ApplicationRegistryChromatticLifeCycle;
import org.exoplatform.commons.chromattic.ChromatticLifeCycle;
import org.exoplatform.commons.chromattic.ChromatticManager;
+import org.exoplatform.commons.utils.PropertyManager;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.container.xml.PropertiesParam;
import org.exoplatform.container.xml.ValueParam;
@@ -260,7 +261,9 @@
public boolean isGadgetDeveloper(String username)
{
- return true;
+ if(PropertyManager.isDevelopping())
+ return true;
+ return false;
}
public String getCountry()
Modified:
exo/portal/branches/3.1.x/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java
===================================================================
---
exo/portal/branches/3.1.x/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java 2010-08-24
16:14:04 UTC (rev 3910)
+++
exo/portal/branches/3.1.x/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java 2010-08-24
16:18:03 UTC (rev 3911)
@@ -21,6 +21,7 @@
import org.exoplatform.application.gadget.Gadget;
import org.exoplatform.application.gadget.GadgetRegistryService;
+import org.exoplatform.commons.utils.PropertyManager;
import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.portal.config.DataStorage;
import org.exoplatform.portal.config.model.ApplicationState;
@@ -312,50 +313,24 @@
public boolean isNoCache()
{
- /*
- * try { UserGadgetStorage userGadgetStorage = getGadgetStorage(); String
- * username = Util.getPortalRequestContext().getRemoteUser(); if(username !=
- * null) { String prefs = userGadgetStorage.get(username,
- * getApplicationName(), getApplicationInstanceUniqueId(), PREF_NO_CACHE);
- * return prefs.equals("1"); } } catch (Exception e) {} return false;
- */
- return true;
+ if(PropertyManager.isDevelopping())
+ return true;
+ return false;
}
public void setNoCache(boolean value)
{
- /*
- * try { UserGadgetStorage userGadgetStorage = getGadgetStorage(); String
- * username = Util.getPortalRequestContext().getRemoteUser(); if(username !=
- * null && getGadgetRegistryService().isGadgetDeveloper(username)) {
- * userGadgetStorage.save(username, getApplicationName(),
- * getApplicationInstanceUniqueId(), PREF_NO_CACHE, value ? "1" :
"0"); } }
- * catch (Exception e) {}
- */
}
public boolean isDebug()
{
- /*
- * try { UserGadgetStorage userGadgetStorage = getGadgetStorage(); String
- * username = Util.getPortalRequestContext().getRemoteUser(); if(username !=
- * null) { String prefs = userGadgetStorage.get(username,
- * getApplicationName(), getApplicationInstanceUniqueId(), PREF_DEBUG);
- * return prefs.equals("1"); } } catch (Exception e) {} return false;
- */
- return true;
+ if(PropertyManager.isDevelopping())
+ return true;
+ return false;
}
public void setDebug(boolean value)
{
- /*
- * try { UserGadgetStorage userGadgetStorage = getGadgetStorage(); String
- * username = Util.getPortalRequestContext().getRemoteUser(); if(username !=
- * null && getGadgetRegistryService().isGadgetDeveloper(username)) {
- * userGadgetStorage.save(username, getApplicationName(),
- * getApplicationInstanceUniqueId(), PREF_DEBUG, value ? "1" :
"0"); } }
- * catch (Exception e) {}
- */
}
public boolean isGadgetDeveloper()
Show replies by date