Backed out changeset: 73faec21c2de IDEMPIERE-1196

This commit is contained in:
Elaine Tan 2013-10-31 11:05:23 +08:00
parent df7d83520b
commit 374d7ac576
5 changed files with 8 additions and 44 deletions

View File

@ -6,7 +6,6 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Properties; import java.util.Properties;
import org.compiere.util.CCache;
import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartFactory;
import org.jfree.chart.JFreeChart; import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.CategoryAxis; import org.jfree.chart.axis.CategoryAxis;
@ -25,29 +24,15 @@ import org.jfree.data.time.TimeSeriesCollection;
import org.jfree.data.xy.IntervalXYDataset; import org.jfree.data.xy.IntervalXYDataset;
public class MChart extends X_AD_Chart { public class MChart extends X_AD_Chart {
/** /**
* *
*/ */
private static final long serialVersionUID = 6001892625463139079L; private static final long serialVersionUID = -8851465915516536910L;
private int windowNo=0; private int windowNo=0;
private Dataset dataset; private Dataset dataset;
private HashMap<String,MQuery> queries; private HashMap<String,MQuery> queries;
private static CCache<Integer,MChart> s_cache = new CCache<Integer,MChart>("AD_Chart", 30, 60);
public static MChart get (Properties ctx, int AD_Chart_ID)
{
Integer key = new Integer(AD_Chart_ID);
MChart retValue = (MChart)s_cache.get(key);
if (retValue == null)
{
retValue = new MChart (ctx, AD_Chart_ID, null);
s_cache.put(key, retValue);
}
return retValue;
} // get
public MChart(Properties ctx, int AD_Chart_ID, String trxName) { public MChart(Properties ctx, int AD_Chart_ID, String trxName) {
super(ctx, AD_Chart_ID, trxName); super(ctx, AD_Chart_ID, trxName);

View File

@ -8,7 +8,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Properties; import java.util.Properties;
import org.compiere.util.CCache;
import org.compiere.util.Env; import org.compiere.util.Env;
/** /**
@ -16,26 +15,11 @@ import org.compiere.util.Env;
* *
*/ */
public class MDashboardContent extends X_PA_DashboardContent public class MDashboardContent extends X_PA_DashboardContent
{ {
/** /**
* *
*/ */
private static final long serialVersionUID = -3565359682982006243L; private static final long serialVersionUID = -1360395253302002667L;
private static CCache<Integer,MDashboardContent> s_cache = new CCache<Integer,MDashboardContent>("PA_DashboardContent_ID", 30, 60);
public static MDashboardContent get (Properties ctx, int PA_DashboardContent_ID)
{
Integer key = new Integer(PA_DashboardContent_ID);
MDashboardContent retValue = (MDashboardContent)s_cache.get(key);
if (retValue == null)
{
retValue = new MDashboardContent (ctx, PA_DashboardContent_ID, null);
s_cache.put(key, retValue);
}
return retValue;
} // get
public static int getForSessionColumnCount(boolean isShowInDashboard, int AD_User_ID, int AD_Role_ID) public static int getForSessionColumnCount(boolean isShowInDashboard, int AD_User_ID, int AD_Role_ID)
{ {

View File

@ -336,13 +336,11 @@ public class DashboardController implements EventListener<Event> {
if(url != null) if(url != null)
{ {
try { try {
Map<String,Integer> map = new HashMap<String, Integer>();
map.put("DCID", dc.getPA_DashboardContent_ID());
Component component = null; Component component = null;
List<IDashboardGadgetFactory> f = Service.locator().list(IDashboardGadgetFactory.class).getServices(); List<IDashboardGadgetFactory> f = Service.locator().list(IDashboardGadgetFactory.class).getServices();
for (IDashboardGadgetFactory factory : f) { for (IDashboardGadgetFactory factory : f) {
component = factory.getGadget(url.toString(),content,map); component = factory.getGadget(url.toString(),content);
if(component != null) if(component != null)
break; break;
} }

View File

@ -13,8 +13,6 @@
*****************************************************************************/ *****************************************************************************/
package org.adempiere.webui.factory; package org.adempiere.webui.factory;
import java.util.Map;
import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.Component;
/** /**
@ -29,5 +27,5 @@ public interface IDashboardGadgetFactory {
* @param parent * @param parent
* @return Component instance of DashboardPanel or null * @return Component instance of DashboardPanel or null
*/ */
public Component getGadget(String uri, Component parent, Map<?, ?> args); public Component getGadget(String uri, Component parent);
} }

View File

@ -14,7 +14,6 @@
package org.adempiere.webui.factory; package org.adempiere.webui.factory;
import java.net.URL; import java.net.URL;
import java.util.Map;
import org.adempiere.base.Core; import org.adempiere.base.Core;
import org.adempiere.base.IResourceFinder; import org.adempiere.base.IResourceFinder;
@ -29,12 +28,12 @@ import org.zkoss.zk.ui.Executions;
*/ */
public class ZulDashboardGadgetFactory implements IDashboardGadgetFactory { public class ZulDashboardGadgetFactory implements IDashboardGadgetFactory {
@Override @Override
public Component getGadget(String uri, Component parent, Map<?, ?> args) { public Component getGadget(String uri, Component parent) {
if (uri != null && uri.toLowerCase().endsWith(".zul")) { if (uri != null && uri.toLowerCase().endsWith(".zul")) {
IResourceFinder rf = Core.getResourceFinder(); IResourceFinder rf = Core.getResourceFinder();
URL url = rf.getResource(uri); URL url = rf.getResource(uri);
if(url!=null) if(url!=null)
return Executions.createComponents(url.toString(), parent, args); return Executions.createComponents(url.toString(), parent, null);
} }
return null; return null;
} }