IDEMPIERE-1265 Add Adaxa Sales Management. Add chart support to dashboard.
This commit is contained in:
parent
b173f3889b
commit
8a31f38f1a
|
@ -0,0 +1,86 @@
|
||||||
|
SET SQLBLANKLINES ON
|
||||||
|
SET DEFINE OFF
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:14:15 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,Version,AD_Table_ID,AD_Column_ID,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Name,IsAllowCopy,Updated,CreatedBy,AD_Org_ID,IsActive,Created,UpdatedBy,IsToolbarButton,IsAlwaysUpdateable,AD_Client_ID,EntityType,IsEncrypted,AD_Element_ID,IsSecure) VALUES (0,'N',1,50010,210876,'N','N','N',0,'N',22,'N',19,'N','N','Y','db439ec4-6b77-4ff5-8776-8072546bc082','Y','AD_Chart_ID','Chart','Y',TO_DATE('2013-10-04 14:14:00','YYYY-MM-DD HH24:MI:SS'),100,0,'Y',TO_DATE('2013-10-04 14:14:00','YYYY-MM-DD HH24:MI:SS'),100,'N','N',0,'D','N',54268,'N')
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:14:22 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
ALTER TABLE PA_DashboardContent ADD AD_Chart_ID NUMBER(10) DEFAULT NULL
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:14:24 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
ALTER TABLE PA_DashboardContent ADD CONSTRAINT ADChart_PADashboardContent FOREIGN KEY (AD_Chart_ID) REFERENCES ad_chart(ad_chart_id)
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:15:34 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,AD_Field_UU,IsDisplayed,IsFieldOnly,UpdatedBy,AD_Org_ID,Created,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,IsQuickEntry,AD_Client_ID,ColumnSpan,NumLines,IsDefaultFocus,IsAdvancedField) VALUES (0,'N',50010,0,'N','N',210876,220,'Y',202524,'N','D','Chart','f123637a-5269-42a3-ac5f-5dd3fac19b8a','Y','N',100,0,TO_DATE('2013-10-04 14:15:25','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2013-10-04 14:15:25','YYYY-MM-DD HH24:MI:SS'),'Y','Y',190,1,'N',0,2,1,'N','N')
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:17:27 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
UPDATE AD_Field SET SeqNo=110, IsDisplayed='Y', XPosition=4,Updated=TO_DATE('2013-10-04 14:17:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=57344
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:17:27 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
UPDATE AD_Field SET SeqNo=120, IsDisplayed='Y', XPosition=1,Updated=TO_DATE('2013-10-04 14:17:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=51013
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:17:27 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
UPDATE AD_Field SET SeqNo=130,Updated=TO_DATE('2013-10-04 14:17:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200262
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:17:27 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
UPDATE AD_Field SET SeqNo=140,Updated=TO_DATE('2013-10-04 14:17:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200261
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:17:27 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
UPDATE AD_Field SET SeqNo=150,Updated=TO_DATE('2013-10-04 14:17:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200263
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:17:27 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
UPDATE AD_Field SET SeqNo=160, IsDisplayed='Y', XPosition=1,Updated=TO_DATE('2013-10-04 14:17:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202524
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:17:27 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
UPDATE AD_Field SET SeqNo=170, IsDisplayed='Y', XPosition=2,Updated=TO_DATE('2013-10-04 14:17:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56504
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:17:27 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
UPDATE AD_Field SET SeqNo=180, IsDisplayed='Y', XPosition=4,Updated=TO_DATE('2013-10-04 14:17:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200268
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:17:27 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
UPDATE AD_Field SET SeqNo=190, IsDisplayed='Y', XPosition=2,Updated=TO_DATE('2013-10-04 14:17:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200260
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:17:27 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
UPDATE AD_Field SET SeqNo=200, IsDisplayed='Y', XPosition=4,Updated=TO_DATE('2013-10-04 14:17:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202286
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:18:25 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
UPDATE AD_Field SET DisplayLogic='@AD_Process_ID@!0',Updated=TO_DATE('2013-10-04 14:18:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200261
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:18:32 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
UPDATE AD_Field SET DisplayLogic='@AD_Process_ID@!0',Updated=TO_DATE('2013-10-04 14:18:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200263
|
||||||
|
;
|
||||||
|
|
||||||
|
SELECT register_migration_script('201310040834_IDEMPIERE-1265.sql') FROM dual
|
||||||
|
;
|
||||||
|
|
|
@ -0,0 +1,84 @@
|
||||||
|
-- Oct 4, 2013 2:14:15 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,Version,AD_Table_ID,AD_Column_ID,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Name,IsAllowCopy,Updated,CreatedBy,AD_Org_ID,IsActive,Created,UpdatedBy,IsToolbarButton,IsAlwaysUpdateable,AD_Client_ID,EntityType,IsEncrypted,AD_Element_ID,IsSecure) VALUES (0,'N',1,50010,210876,'N','N','N',0,'N',22,'N',19,'N','N','Y','db439ec4-6b77-4ff5-8776-8072546bc082','Y','AD_Chart_ID','Chart','Y',TO_TIMESTAMP('2013-10-04 14:14:00','YYYY-MM-DD HH24:MI:SS'),100,0,'Y',TO_TIMESTAMP('2013-10-04 14:14:00','YYYY-MM-DD HH24:MI:SS'),100,'N','N',0,'D','N',54268,'N')
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:14:22 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
ALTER TABLE PA_DashboardContent ADD COLUMN AD_Chart_ID NUMERIC(10) DEFAULT NULL
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:14:24 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
ALTER TABLE PA_DashboardContent ADD CONSTRAINT ADChart_PADashboardContent FOREIGN KEY (AD_Chart_ID) REFERENCES ad_chart(ad_chart_id)
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:15:34 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,AD_Field_UU,IsDisplayed,IsFieldOnly,UpdatedBy,AD_Org_ID,Created,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,IsQuickEntry,AD_Client_ID,ColumnSpan,NumLines,IsDefaultFocus,IsAdvancedField) VALUES (0,'N',50010,0,'N','N',210876,220,'Y',202524,'N','D','Chart','f123637a-5269-42a3-ac5f-5dd3fac19b8a','Y','N',100,0,TO_TIMESTAMP('2013-10-04 14:15:25','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2013-10-04 14:15:25','YYYY-MM-DD HH24:MI:SS'),'Y','Y',190,1,'N',0,2,1,'N','N')
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:17:27 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
UPDATE AD_Field SET SeqNo=110, IsDisplayed='Y', XPosition=4,Updated=TO_TIMESTAMP('2013-10-04 14:17:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=57344
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:17:27 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
UPDATE AD_Field SET SeqNo=120, IsDisplayed='Y', XPosition=1,Updated=TO_TIMESTAMP('2013-10-04 14:17:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=51013
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:17:27 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
UPDATE AD_Field SET SeqNo=130,Updated=TO_TIMESTAMP('2013-10-04 14:17:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200262
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:17:27 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
UPDATE AD_Field SET SeqNo=140,Updated=TO_TIMESTAMP('2013-10-04 14:17:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200261
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:17:27 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
UPDATE AD_Field SET SeqNo=150,Updated=TO_TIMESTAMP('2013-10-04 14:17:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200263
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:17:27 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
UPDATE AD_Field SET SeqNo=160, IsDisplayed='Y', XPosition=1,Updated=TO_TIMESTAMP('2013-10-04 14:17:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202524
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:17:27 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
UPDATE AD_Field SET SeqNo=170, IsDisplayed='Y', XPosition=2,Updated=TO_TIMESTAMP('2013-10-04 14:17:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56504
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:17:27 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
UPDATE AD_Field SET SeqNo=180, IsDisplayed='Y', XPosition=4,Updated=TO_TIMESTAMP('2013-10-04 14:17:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200268
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:17:27 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
UPDATE AD_Field SET SeqNo=190, IsDisplayed='Y', XPosition=2,Updated=TO_TIMESTAMP('2013-10-04 14:17:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200260
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:17:27 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
UPDATE AD_Field SET SeqNo=200, IsDisplayed='Y', XPosition=4,Updated=TO_TIMESTAMP('2013-10-04 14:17:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202286
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:18:25 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
UPDATE AD_Field SET DisplayLogic='@AD_Process_ID@!0',Updated=TO_TIMESTAMP('2013-10-04 14:18:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200261
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Oct 4, 2013 2:18:32 PM MYT
|
||||||
|
-- IDEMPIERE-1265 Add Adaxa Sales Management
|
||||||
|
UPDATE AD_Field SET DisplayLogic='@AD_Process_ID@!0',Updated=TO_TIMESTAMP('2013-10-04 14:18:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200263
|
||||||
|
;
|
||||||
|
|
||||||
|
SELECT register_migration_script('201310040834_IDEMPIERE-1265.sql') FROM dual
|
||||||
|
;
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,17 @@ public interface I_PA_DashboardContent
|
||||||
|
|
||||||
/** Load Meta Data */
|
/** Load Meta Data */
|
||||||
|
|
||||||
|
/** Column name AD_Chart_ID */
|
||||||
|
public static final String COLUMNNAME_AD_Chart_ID = "AD_Chart_ID";
|
||||||
|
|
||||||
|
/** Set Chart */
|
||||||
|
public void setAD_Chart_ID (int AD_Chart_ID);
|
||||||
|
|
||||||
|
/** Get Chart */
|
||||||
|
public int getAD_Chart_ID();
|
||||||
|
|
||||||
|
public org.compiere.model.I_AD_Chart getAD_Chart() throws RuntimeException;
|
||||||
|
|
||||||
/** Column name AD_Client_ID */
|
/** Column name AD_Client_ID */
|
||||||
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
|
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
|
||||||
|
|
||||||
|
@ -251,6 +262,15 @@ public interface I_PA_DashboardContent
|
||||||
*/
|
*/
|
||||||
public boolean isShowInDashboard();
|
public boolean isShowInDashboard();
|
||||||
|
|
||||||
|
/** Column name IsShowinLogin */
|
||||||
|
public static final String COLUMNNAME_IsShowinLogin = "IsShowinLogin";
|
||||||
|
|
||||||
|
/** Set IsShowinLogin */
|
||||||
|
public void setIsShowinLogin (boolean IsShowinLogin);
|
||||||
|
|
||||||
|
/** Get IsShowinLogin */
|
||||||
|
public boolean isShowinLogin();
|
||||||
|
|
||||||
/** Column name Line */
|
/** Column name Line */
|
||||||
public static final String COLUMNNAME_Line = "Line";
|
public static final String COLUMNNAME_Line = "Line";
|
||||||
|
|
||||||
|
@ -342,13 +362,13 @@ public interface I_PA_DashboardContent
|
||||||
/** Column name ZulFilePath */
|
/** Column name ZulFilePath */
|
||||||
public static final String COLUMNNAME_ZulFilePath = "ZulFilePath";
|
public static final String COLUMNNAME_ZulFilePath = "ZulFilePath";
|
||||||
|
|
||||||
/** Set ZUL File Path.
|
/** Set Gadget URI.
|
||||||
* Absolute path to zul file
|
* URI for Dashboard Gadget
|
||||||
*/
|
*/
|
||||||
public void setZulFilePath (String ZulFilePath);
|
public void setZulFilePath (String ZulFilePath);
|
||||||
|
|
||||||
/** Get ZUL File Path.
|
/** Get Gadget URI.
|
||||||
* Absolute path to zul file
|
* URI for Dashboard Gadget
|
||||||
*/
|
*/
|
||||||
public String getZulFilePath();
|
public String getZulFilePath();
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,19 +92,6 @@ public interface I_PA_DashboardContent_Access
|
||||||
|
|
||||||
public org.compiere.model.I_AD_User getAD_User() throws RuntimeException;
|
public org.compiere.model.I_AD_User getAD_User() throws RuntimeException;
|
||||||
|
|
||||||
/** Column name ColumnNo */
|
|
||||||
public static final String COLUMNNAME_ColumnNo = "ColumnNo";
|
|
||||||
|
|
||||||
/** Set Column No.
|
|
||||||
* Dashboard content column number
|
|
||||||
*/
|
|
||||||
public void setColumnNo (int ColumnNo);
|
|
||||||
|
|
||||||
/** Get Column No.
|
|
||||||
* Dashboard content column number
|
|
||||||
*/
|
|
||||||
public int getColumnNo();
|
|
||||||
|
|
||||||
/** Column name Created */
|
/** Column name Created */
|
||||||
public static final String COLUMNNAME_Created = "Created";
|
public static final String COLUMNNAME_Created = "Created";
|
||||||
|
|
||||||
|
@ -134,54 +121,6 @@ public interface I_PA_DashboardContent_Access
|
||||||
*/
|
*/
|
||||||
public boolean isActive();
|
public boolean isActive();
|
||||||
|
|
||||||
/** Column name IsCollapsedByDefault */
|
|
||||||
public static final String COLUMNNAME_IsCollapsedByDefault = "IsCollapsedByDefault";
|
|
||||||
|
|
||||||
/** Set Collapsed By Default.
|
|
||||||
* Flag to set the initial state of collapsible field group.
|
|
||||||
*/
|
|
||||||
public void setIsCollapsedByDefault (boolean IsCollapsedByDefault);
|
|
||||||
|
|
||||||
/** Get Collapsed By Default.
|
|
||||||
* Flag to set the initial state of collapsible field group.
|
|
||||||
*/
|
|
||||||
public boolean isCollapsedByDefault();
|
|
||||||
|
|
||||||
/** Column name IsShowInDashboard */
|
|
||||||
public static final String COLUMNNAME_IsShowInDashboard = "IsShowInDashboard";
|
|
||||||
|
|
||||||
/** Set Show in Dashboard.
|
|
||||||
* Show the dashlet in the dashboard
|
|
||||||
*/
|
|
||||||
public void setIsShowInDashboard (boolean IsShowInDashboard);
|
|
||||||
|
|
||||||
/** Get Show in Dashboard.
|
|
||||||
* Show the dashlet in the dashboard
|
|
||||||
*/
|
|
||||||
public boolean isShowInDashboard();
|
|
||||||
|
|
||||||
/** Column name IsShowinLogin */
|
|
||||||
public static final String COLUMNNAME_IsShowinLogin = "IsShowinLogin";
|
|
||||||
|
|
||||||
/** Set IsShowinLogin */
|
|
||||||
public void setIsShowinLogin (boolean IsShowinLogin);
|
|
||||||
|
|
||||||
/** Get IsShowinLogin */
|
|
||||||
public boolean isShowinLogin();
|
|
||||||
|
|
||||||
/** Column name Line */
|
|
||||||
public static final String COLUMNNAME_Line = "Line";
|
|
||||||
|
|
||||||
/** Set Line No.
|
|
||||||
* Unique line for this document
|
|
||||||
*/
|
|
||||||
public void setLine (int Line);
|
|
||||||
|
|
||||||
/** Get Line No.
|
|
||||||
* Unique line for this document
|
|
||||||
*/
|
|
||||||
public int getLine();
|
|
||||||
|
|
||||||
/** Column name PA_DashboardContent_Access_ID */
|
/** Column name PA_DashboardContent_Access_ID */
|
||||||
public static final String COLUMNNAME_PA_DashboardContent_Access_ID = "PA_DashboardContent_Access_ID";
|
public static final String COLUMNNAME_PA_DashboardContent_Access_ID = "PA_DashboardContent_Access_ID";
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class X_PA_DashboardContent extends PO implements I_PA_DashboardContent,
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = 20130626L;
|
private static final long serialVersionUID = 20131004L;
|
||||||
|
|
||||||
/** Standard Constructor */
|
/** Standard Constructor */
|
||||||
public X_PA_DashboardContent (Properties ctx, int PA_DashboardContent_ID, String trxName)
|
public X_PA_DashboardContent (Properties ctx, int PA_DashboardContent_ID, String trxName)
|
||||||
|
@ -81,6 +81,31 @@ public class X_PA_DashboardContent extends PO implements I_PA_DashboardContent,
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public org.compiere.model.I_AD_Chart getAD_Chart() throws RuntimeException
|
||||||
|
{
|
||||||
|
return (org.compiere.model.I_AD_Chart)MTable.get(getCtx(), org.compiere.model.I_AD_Chart.Table_Name)
|
||||||
|
.getPO(getAD_Chart_ID(), get_TrxName()); }
|
||||||
|
|
||||||
|
/** Set Chart.
|
||||||
|
@param AD_Chart_ID Chart */
|
||||||
|
public void setAD_Chart_ID (int AD_Chart_ID)
|
||||||
|
{
|
||||||
|
if (AD_Chart_ID < 1)
|
||||||
|
set_Value (COLUMNNAME_AD_Chart_ID, null);
|
||||||
|
else
|
||||||
|
set_Value (COLUMNNAME_AD_Chart_ID, Integer.valueOf(AD_Chart_ID));
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Get Chart.
|
||||||
|
@return Chart */
|
||||||
|
public int getAD_Chart_ID ()
|
||||||
|
{
|
||||||
|
Integer ii = (Integer)get_Value(COLUMNNAME_AD_Chart_ID);
|
||||||
|
if (ii == null)
|
||||||
|
return 0;
|
||||||
|
return ii.intValue();
|
||||||
|
}
|
||||||
|
|
||||||
public org.compiere.model.I_AD_Process getAD_Process() throws RuntimeException
|
public org.compiere.model.I_AD_Process getAD_Process() throws RuntimeException
|
||||||
{
|
{
|
||||||
return (org.compiere.model.I_AD_Process)MTable.get(getCtx(), org.compiere.model.I_AD_Process.Table_Name)
|
return (org.compiere.model.I_AD_Process)MTable.get(getCtx(), org.compiere.model.I_AD_Process.Table_Name)
|
||||||
|
@ -364,6 +389,27 @@ public class X_PA_DashboardContent extends PO implements I_PA_DashboardContent,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Set IsShowinLogin.
|
||||||
|
@param IsShowinLogin IsShowinLogin */
|
||||||
|
public void setIsShowinLogin (boolean IsShowinLogin)
|
||||||
|
{
|
||||||
|
set_Value (COLUMNNAME_IsShowinLogin, Boolean.valueOf(IsShowinLogin));
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Get IsShowinLogin.
|
||||||
|
@return IsShowinLogin */
|
||||||
|
public boolean isShowinLogin ()
|
||||||
|
{
|
||||||
|
Object oo = get_Value(COLUMNNAME_IsShowinLogin);
|
||||||
|
if (oo != null)
|
||||||
|
{
|
||||||
|
if (oo instanceof Boolean)
|
||||||
|
return ((Boolean)oo).booleanValue();
|
||||||
|
return "Y".equals(oo);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/** Set Line No.
|
/** Set Line No.
|
||||||
@param Line
|
@param Line
|
||||||
Unique line for this document
|
Unique line for this document
|
||||||
|
@ -488,17 +534,17 @@ public class X_PA_DashboardContent extends PO implements I_PA_DashboardContent,
|
||||||
return (String)get_Value(COLUMNNAME_ProcessParameters);
|
return (String)get_Value(COLUMNNAME_ProcessParameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Set ZUL File Path.
|
/** Set Gadget URI.
|
||||||
@param ZulFilePath
|
@param ZulFilePath
|
||||||
Absolute path to zul file
|
URI for Dashboard Gadget
|
||||||
*/
|
*/
|
||||||
public void setZulFilePath (String ZulFilePath)
|
public void setZulFilePath (String ZulFilePath)
|
||||||
{
|
{
|
||||||
set_Value (COLUMNNAME_ZulFilePath, ZulFilePath);
|
set_Value (COLUMNNAME_ZulFilePath, ZulFilePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Get ZUL File Path.
|
/** Get Gadget URI.
|
||||||
@return Absolute path to zul file
|
@return URI for Dashboard Gadget
|
||||||
*/
|
*/
|
||||||
public String getZulFilePath ()
|
public String getZulFilePath ()
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class X_PA_DashboardContent_Access extends PO implements I_PA_DashboardCo
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = 20130903L;
|
private static final long serialVersionUID = 20131004L;
|
||||||
|
|
||||||
/** Standard Constructor */
|
/** Standard Constructor */
|
||||||
public X_PA_DashboardContent_Access (Properties ctx, int PA_DashboardContent_Access_ID, String trxName)
|
public X_PA_DashboardContent_Access (Properties ctx, int PA_DashboardContent_Access_ID, String trxName)
|
||||||
|
@ -125,115 +125,6 @@ public class X_PA_DashboardContent_Access extends PO implements I_PA_DashboardCo
|
||||||
return ii.intValue();
|
return ii.intValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Set Column No.
|
|
||||||
@param ColumnNo
|
|
||||||
Dashboard content column number
|
|
||||||
*/
|
|
||||||
public void setColumnNo (int ColumnNo)
|
|
||||||
{
|
|
||||||
set_Value (COLUMNNAME_ColumnNo, Integer.valueOf(ColumnNo));
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Get Column No.
|
|
||||||
@return Dashboard content column number
|
|
||||||
*/
|
|
||||||
public int getColumnNo ()
|
|
||||||
{
|
|
||||||
Integer ii = (Integer)get_Value(COLUMNNAME_ColumnNo);
|
|
||||||
if (ii == null)
|
|
||||||
return 0;
|
|
||||||
return ii.intValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Set Collapsed By Default.
|
|
||||||
@param IsCollapsedByDefault
|
|
||||||
Flag to set the initial state of collapsible field group.
|
|
||||||
*/
|
|
||||||
public void setIsCollapsedByDefault (boolean IsCollapsedByDefault)
|
|
||||||
{
|
|
||||||
set_Value (COLUMNNAME_IsCollapsedByDefault, Boolean.valueOf(IsCollapsedByDefault));
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Get Collapsed By Default.
|
|
||||||
@return Flag to set the initial state of collapsible field group.
|
|
||||||
*/
|
|
||||||
public boolean isCollapsedByDefault ()
|
|
||||||
{
|
|
||||||
Object oo = get_Value(COLUMNNAME_IsCollapsedByDefault);
|
|
||||||
if (oo != null)
|
|
||||||
{
|
|
||||||
if (oo instanceof Boolean)
|
|
||||||
return ((Boolean)oo).booleanValue();
|
|
||||||
return "Y".equals(oo);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Set Show in Dashboard.
|
|
||||||
@param IsShowInDashboard
|
|
||||||
Show the dashlet in the dashboard
|
|
||||||
*/
|
|
||||||
public void setIsShowInDashboard (boolean IsShowInDashboard)
|
|
||||||
{
|
|
||||||
set_Value (COLUMNNAME_IsShowInDashboard, Boolean.valueOf(IsShowInDashboard));
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Get Show in Dashboard.
|
|
||||||
@return Show the dashlet in the dashboard
|
|
||||||
*/
|
|
||||||
public boolean isShowInDashboard ()
|
|
||||||
{
|
|
||||||
Object oo = get_Value(COLUMNNAME_IsShowInDashboard);
|
|
||||||
if (oo != null)
|
|
||||||
{
|
|
||||||
if (oo instanceof Boolean)
|
|
||||||
return ((Boolean)oo).booleanValue();
|
|
||||||
return "Y".equals(oo);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Set IsShowinLogin.
|
|
||||||
@param IsShowinLogin IsShowinLogin */
|
|
||||||
public void setIsShowinLogin (boolean IsShowinLogin)
|
|
||||||
{
|
|
||||||
set_Value (COLUMNNAME_IsShowinLogin, Boolean.valueOf(IsShowinLogin));
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Get IsShowinLogin.
|
|
||||||
@return IsShowinLogin */
|
|
||||||
public boolean isShowinLogin ()
|
|
||||||
{
|
|
||||||
Object oo = get_Value(COLUMNNAME_IsShowinLogin);
|
|
||||||
if (oo != null)
|
|
||||||
{
|
|
||||||
if (oo instanceof Boolean)
|
|
||||||
return ((Boolean)oo).booleanValue();
|
|
||||||
return "Y".equals(oo);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Set Line No.
|
|
||||||
@param Line
|
|
||||||
Unique line for this document
|
|
||||||
*/
|
|
||||||
public void setLine (int Line)
|
|
||||||
{
|
|
||||||
set_ValueNoCheck (COLUMNNAME_Line, Integer.valueOf(Line));
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Get Line No.
|
|
||||||
@return Unique line for this document
|
|
||||||
*/
|
|
||||||
public int getLine ()
|
|
||||||
{
|
|
||||||
Integer ii = (Integer)get_Value(COLUMNNAME_Line);
|
|
||||||
if (ii == null)
|
|
||||||
return 0;
|
|
||||||
return ii.intValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Set PA_DashboardContent_Access_ID.
|
/** Set PA_DashboardContent_Access_ID.
|
||||||
@param PA_DashboardContent_Access_ID PA_DashboardContent_Access_ID */
|
@param PA_DashboardContent_Access_ID PA_DashboardContent_Access_ID */
|
||||||
public void setPA_DashboardContent_Access_ID (int PA_DashboardContent_Access_ID)
|
public void setPA_DashboardContent_Access_ID (int PA_DashboardContent_Access_ID)
|
||||||
|
|
|
@ -38,8 +38,10 @@ import org.adempiere.webui.factory.IDashboardGadgetFactory;
|
||||||
import org.adempiere.webui.report.HTMLExtension;
|
import org.adempiere.webui.report.HTMLExtension;
|
||||||
import org.adempiere.webui.session.SessionManager;
|
import org.adempiere.webui.session.SessionManager;
|
||||||
import org.adempiere.webui.theme.ThemeManager;
|
import org.adempiere.webui.theme.ThemeManager;
|
||||||
|
import org.adempiere.webui.util.ChartRenderer;
|
||||||
import org.adempiere.webui.window.ZkReportViewerProvider;
|
import org.adempiere.webui.window.ZkReportViewerProvider;
|
||||||
import org.compiere.model.I_AD_Menu;
|
import org.compiere.model.I_AD_Menu;
|
||||||
|
import org.compiere.model.MChart;
|
||||||
import org.compiere.model.MDashboardContent;
|
import org.compiere.model.MDashboardContent;
|
||||||
import org.compiere.model.MDashboardContentAccess;
|
import org.compiere.model.MDashboardContentAccess;
|
||||||
import org.compiere.model.MDashboardPreference;
|
import org.compiere.model.MDashboardPreference;
|
||||||
|
@ -368,6 +370,17 @@ public class DashboardController implements EventListener<Event> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//chart
|
||||||
|
int AD_Chart_ID = dc.getAD_Chart_ID();
|
||||||
|
if (AD_Chart_ID > 0) {
|
||||||
|
Panel chartPanel = new Panel();
|
||||||
|
MChart chartModel = new MChart(Env.getCtx(), AD_Chart_ID, null);
|
||||||
|
ChartRenderer renderer = new ChartRenderer(chartModel);
|
||||||
|
renderer.render(chartPanel, 300);
|
||||||
|
content.appendChild(chartPanel);
|
||||||
|
panelEmpty = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (panelEmpty)
|
if (panelEmpty)
|
||||||
panel.detach();
|
panel.detach();
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,36 +14,14 @@
|
||||||
package org.adempiere.webui.editor;
|
package org.adempiere.webui.editor;
|
||||||
|
|
||||||
|
|
||||||
import java.awt.image.BufferedImage;
|
import org.adempiere.webui.util.ChartRenderer;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.logging.Level;
|
|
||||||
|
|
||||||
import org.adempiere.webui.apps.AEnv;
|
|
||||||
import org.compiere.model.GridField;
|
import org.compiere.model.GridField;
|
||||||
import org.compiere.model.MChart;
|
import org.compiere.model.MChart;
|
||||||
import org.compiere.model.MQuery;
|
|
||||||
import org.compiere.util.CLogger;
|
import org.compiere.util.CLogger;
|
||||||
import org.compiere.util.Env;
|
import org.compiere.util.Env;
|
||||||
import org.jfree.chart.ChartRenderingInfo;
|
|
||||||
import org.jfree.chart.JFreeChart;
|
|
||||||
import org.jfree.chart.encoders.EncoderUtil;
|
|
||||||
import org.jfree.chart.encoders.ImageFormat;
|
|
||||||
import org.jfree.chart.entity.CategoryItemEntity;
|
|
||||||
import org.jfree.chart.entity.ChartEntity;
|
|
||||||
import org.jfree.chart.entity.PieSectionEntity;
|
|
||||||
import org.jfree.chart.entity.XYItemEntity;
|
|
||||||
import org.jfree.data.time.TimeSeries;
|
|
||||||
import org.jfree.data.time.TimeSeriesCollection;
|
|
||||||
import org.jfree.data.time.TimeSeriesDataItem;
|
|
||||||
import org.zkoss.image.AImage;
|
|
||||||
import org.zkoss.zk.ui.event.Event;
|
import org.zkoss.zk.ui.event.Event;
|
||||||
import org.zkoss.zk.ui.event.EventListener;
|
|
||||||
import org.zkoss.zk.ui.event.Events;
|
import org.zkoss.zk.ui.event.Events;
|
||||||
import org.zkoss.zk.ui.event.MouseEvent;
|
|
||||||
import org.zkoss.zul.Area;
|
|
||||||
import org.zkoss.zul.Imagemap;
|
|
||||||
import org.zkoss.zul.Panel;
|
import org.zkoss.zul.Panel;
|
||||||
import org.zkoss.zul.Panelchildren;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is based on org.compiere.grid.ed.WImageEditor and WGraph written by Low Heng Sin.
|
* This class is based on org.compiere.grid.ed.WImageEditor and WGraph written by Low Heng Sin.
|
||||||
|
@ -56,31 +34,23 @@ public class WChartEditor extends WEditor
|
||||||
{
|
{
|
||||||
private static final String[] LISTENER_EVENTS = {Events.ON_CLICK};
|
private static final String[] LISTENER_EVENTS = {Events.ON_CLICK};
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private static final CLogger logger;
|
|
||||||
|
|
||||||
static
|
|
||||||
{
|
|
||||||
logger = CLogger.getCLogger(WChartEditor.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
private MChart chartModel = null;
|
private MChart chartModel = null;
|
||||||
|
|
||||||
/** Logger */
|
/** Logger */
|
||||||
private static CLogger log = CLogger.getCLogger(WChartEditor.class);
|
@SuppressWarnings("unused")
|
||||||
|
private static final CLogger log = CLogger.getCLogger(WChartEditor.class);
|
||||||
|
|
||||||
public WChartEditor(GridField gridField, int windowNo)
|
public WChartEditor(GridField gridField, int windowNo)
|
||||||
{
|
{
|
||||||
super(new Panel(), gridField);
|
super(new Panel(), gridField);
|
||||||
chartModel = new MChart(Env.getCtx(), gridField.getAD_Chart_ID(), null);
|
chartModel = new MChart(Env.getCtx(), gridField.getAD_Chart_ID(), null);
|
||||||
chartModel.setWindowNo(windowNo);
|
chartModel.setWindowNo(windowNo);
|
||||||
init();
|
init();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createChart() {
|
private void createChart() {
|
||||||
|
ChartRenderer renderer = new ChartRenderer(chartModel);
|
||||||
render(chartModel.createChart());
|
renderer.render(getComponent(), 400);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -88,107 +58,6 @@ public class WChartEditor extends WEditor
|
||||||
return (Panel) component;
|
return (Panel) component;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void render(JFreeChart chart) {
|
|
||||||
ChartRenderingInfo info = new ChartRenderingInfo();
|
|
||||||
int width = 400;
|
|
||||||
int height = chartModel.getWinHeight();
|
|
||||||
BufferedImage bi = chart.createBufferedImage(width, height,
|
|
||||||
BufferedImage.TRANSLUCENT, info);
|
|
||||||
try {
|
|
||||||
byte[] bytes = EncoderUtil.encode(bi, ImageFormat.PNG, true);
|
|
||||||
|
|
||||||
AImage image = new AImage("", bytes);
|
|
||||||
Imagemap myImage = new Imagemap();
|
|
||||||
|
|
||||||
Panel panel = getComponent();
|
|
||||||
myImage.setContent(image);
|
|
||||||
if (panel.getPanelchildren() != null) {
|
|
||||||
panel.getPanelchildren().getChildren().clear();
|
|
||||||
panel.getPanelchildren().appendChild(myImage);
|
|
||||||
} else {
|
|
||||||
Panelchildren pc = new Panelchildren();
|
|
||||||
panel.appendChild(pc);
|
|
||||||
pc.appendChild(myImage);
|
|
||||||
pc.setSclass("chart-field");
|
|
||||||
}
|
|
||||||
|
|
||||||
int count = 0;
|
|
||||||
for (Iterator<?> it = info.getEntityCollection().getEntities()
|
|
||||||
.iterator(); it.hasNext();) {
|
|
||||||
ChartEntity entity = (ChartEntity) it.next();
|
|
||||||
|
|
||||||
String key = null;
|
|
||||||
String seriesName = null;
|
|
||||||
if (entity instanceof CategoryItemEntity)
|
|
||||||
{
|
|
||||||
CategoryItemEntity item = ((CategoryItemEntity)entity);
|
|
||||||
Comparable<?> colKey = item.getColumnKey();
|
|
||||||
Comparable<?> rowKey = item.getRowKey();
|
|
||||||
if (colKey != null && rowKey !=null)
|
|
||||||
{
|
|
||||||
key = colKey.toString();
|
|
||||||
seriesName = rowKey.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (entity instanceof PieSectionEntity)
|
|
||||||
{
|
|
||||||
Comparable<?> sectionKey = ((PieSectionEntity)entity).getSectionKey();
|
|
||||||
if (sectionKey != null)
|
|
||||||
{
|
|
||||||
key = sectionKey.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (entity instanceof XYItemEntity)
|
|
||||||
{
|
|
||||||
XYItemEntity item = ((XYItemEntity)entity);
|
|
||||||
if ( item.getDataset() instanceof TimeSeriesCollection )
|
|
||||||
{
|
|
||||||
TimeSeriesCollection data = (TimeSeriesCollection) item.getDataset();
|
|
||||||
TimeSeries series = data.getSeries(item.getSeriesIndex());
|
|
||||||
TimeSeriesDataItem dataitem = series.getDataItem(item.getItem());
|
|
||||||
seriesName = series.getKey().toString();
|
|
||||||
key = dataitem.getPeriod().toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( key == null )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
Area area = new Area();
|
|
||||||
myImage.appendChild(area);
|
|
||||||
area.setCoords(entity.getShapeCoords());
|
|
||||||
area.setShape(entity.getShapeType());
|
|
||||||
area.setTooltiptext(entity.getToolTipText());
|
|
||||||
area.setId(count+"_WG__" + seriesName + "__" + key);
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
|
|
||||||
myImage.addEventListener(Events.ON_CLICK, new EventListener<Event>() {
|
|
||||||
public void onEvent(Event event) throws Exception {
|
|
||||||
MouseEvent me = (MouseEvent) event;
|
|
||||||
String areaId = me.getArea();
|
|
||||||
if (areaId != null) {
|
|
||||||
String[] strs = areaId.split("__");
|
|
||||||
if (strs.length == 3)
|
|
||||||
{
|
|
||||||
chartMouseClicked(strs[2], strs[1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.log(Level.SEVERE, "", e);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void chartMouseClicked(String key, String category) {
|
|
||||||
MQuery query = chartModel.getQuery("null".equals(category) ? key : category + "__" + key);
|
|
||||||
if (query != null)
|
|
||||||
AEnv.zoom(query);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void init()
|
private void init()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -242,17 +111,11 @@ public class WChartEditor extends WEditor
|
||||||
|
|
||||||
public void onEvent(Event event) throws Exception
|
public void onEvent(Event event) throws Exception
|
||||||
{
|
{
|
||||||
if (Events.ON_CLICK.equals(event.getName()))
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void dynamicDisplay() {
|
public void dynamicDisplay() {
|
||||||
super.dynamicDisplay();
|
super.dynamicDisplay();
|
||||||
createChart();
|
createChart();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,153 @@
|
||||||
|
package org.adempiere.webui.util;
|
||||||
|
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
import org.adempiere.webui.apps.AEnv;
|
||||||
|
import org.compiere.model.MChart;
|
||||||
|
import org.compiere.model.MQuery;
|
||||||
|
import org.compiere.util.CLogger;
|
||||||
|
import org.jfree.chart.ChartRenderingInfo;
|
||||||
|
import org.jfree.chart.JFreeChart;
|
||||||
|
import org.jfree.chart.encoders.EncoderUtil;
|
||||||
|
import org.jfree.chart.encoders.ImageFormat;
|
||||||
|
import org.jfree.chart.entity.CategoryItemEntity;
|
||||||
|
import org.jfree.chart.entity.ChartEntity;
|
||||||
|
import org.jfree.chart.entity.PieSectionEntity;
|
||||||
|
import org.jfree.chart.entity.XYItemEntity;
|
||||||
|
import org.jfree.data.time.TimeSeries;
|
||||||
|
import org.jfree.data.time.TimeSeriesCollection;
|
||||||
|
import org.jfree.data.time.TimeSeriesDataItem;
|
||||||
|
import org.zkoss.image.AImage;
|
||||||
|
import org.zkoss.zk.ui.event.Event;
|
||||||
|
import org.zkoss.zk.ui.event.EventListener;
|
||||||
|
import org.zkoss.zk.ui.event.Events;
|
||||||
|
import org.zkoss.zk.ui.event.MouseEvent;
|
||||||
|
import org.zkoss.zul.Area;
|
||||||
|
import org.zkoss.zul.Imagemap;
|
||||||
|
import org.zkoss.zul.Panel;
|
||||||
|
import org.zkoss.zul.Panelchildren;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Paul Bowden, Adaxa Pty Ltd
|
||||||
|
* @author hengsin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class ChartRenderer {
|
||||||
|
|
||||||
|
private static final CLogger log = CLogger.getCLogger(ChartRenderer.class);
|
||||||
|
|
||||||
|
private MChart chartModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param chartModel
|
||||||
|
*/
|
||||||
|
public ChartRenderer(MChart chartModel) {
|
||||||
|
this.chartModel = chartModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param panel
|
||||||
|
* @param width
|
||||||
|
*/
|
||||||
|
public void render(Panel panel, int width) {
|
||||||
|
JFreeChart chart = chartModel.createChart();
|
||||||
|
|
||||||
|
ChartRenderingInfo info = new ChartRenderingInfo();
|
||||||
|
int height = chartModel.getWinHeight();
|
||||||
|
BufferedImage bi = chart.createBufferedImage(width, height,
|
||||||
|
BufferedImage.TRANSLUCENT, info);
|
||||||
|
try {
|
||||||
|
byte[] bytes = EncoderUtil.encode(bi, ImageFormat.PNG, true);
|
||||||
|
|
||||||
|
AImage image = new AImage("", bytes);
|
||||||
|
Imagemap myImage = new Imagemap();
|
||||||
|
|
||||||
|
myImage.setContent(image);
|
||||||
|
if (panel.getPanelchildren() != null) {
|
||||||
|
panel.getPanelchildren().getChildren().clear();
|
||||||
|
panel.getPanelchildren().appendChild(myImage);
|
||||||
|
} else {
|
||||||
|
Panelchildren pc = new Panelchildren();
|
||||||
|
panel.appendChild(pc);
|
||||||
|
pc.appendChild(myImage);
|
||||||
|
pc.setSclass("chart-field");
|
||||||
|
}
|
||||||
|
|
||||||
|
int count = 0;
|
||||||
|
for (Iterator<?> it = info.getEntityCollection().getEntities()
|
||||||
|
.iterator(); it.hasNext();) {
|
||||||
|
ChartEntity entity = (ChartEntity) it.next();
|
||||||
|
|
||||||
|
String key = null;
|
||||||
|
String seriesName = null;
|
||||||
|
if (entity instanceof CategoryItemEntity)
|
||||||
|
{
|
||||||
|
CategoryItemEntity item = ((CategoryItemEntity)entity);
|
||||||
|
Comparable<?> colKey = item.getColumnKey();
|
||||||
|
Comparable<?> rowKey = item.getRowKey();
|
||||||
|
if (colKey != null && rowKey !=null)
|
||||||
|
{
|
||||||
|
key = colKey.toString();
|
||||||
|
seriesName = rowKey.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (entity instanceof PieSectionEntity)
|
||||||
|
{
|
||||||
|
Comparable<?> sectionKey = ((PieSectionEntity)entity).getSectionKey();
|
||||||
|
if (sectionKey != null)
|
||||||
|
{
|
||||||
|
key = sectionKey.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (entity instanceof XYItemEntity)
|
||||||
|
{
|
||||||
|
XYItemEntity item = ((XYItemEntity)entity);
|
||||||
|
if ( item.getDataset() instanceof TimeSeriesCollection )
|
||||||
|
{
|
||||||
|
TimeSeriesCollection data = (TimeSeriesCollection) item.getDataset();
|
||||||
|
TimeSeries series = data.getSeries(item.getSeriesIndex());
|
||||||
|
TimeSeriesDataItem dataitem = series.getDataItem(item.getItem());
|
||||||
|
seriesName = series.getKey().toString();
|
||||||
|
key = dataitem.getPeriod().toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( key == null )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
Area area = new Area();
|
||||||
|
myImage.appendChild(area);
|
||||||
|
area.setCoords(entity.getShapeCoords());
|
||||||
|
area.setShape(entity.getShapeType());
|
||||||
|
area.setTooltiptext(entity.getToolTipText());
|
||||||
|
area.setId(count+"_WG__" + seriesName + "__" + key);
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
myImage.addEventListener(Events.ON_CLICK, new EventListener<Event>() {
|
||||||
|
public void onEvent(Event event) throws Exception {
|
||||||
|
MouseEvent me = (MouseEvent) event;
|
||||||
|
String areaId = me.getArea();
|
||||||
|
if (areaId != null) {
|
||||||
|
String[] strs = areaId.split("__");
|
||||||
|
if (strs.length == 3)
|
||||||
|
{
|
||||||
|
chartMouseClicked(strs[2], strs[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.log(Level.SEVERE, "", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void chartMouseClicked(String key, String category) {
|
||||||
|
MQuery query = chartModel.getQuery("null".equals(category) ? key : category + "__" + key);
|
||||||
|
if (query != null)
|
||||||
|
AEnv.zoom(query);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue