Skip to content

Commit

Permalink
AD_Tab.IsRefreshViewOnChangeEvents
Browse files Browse the repository at this point in the history
  • Loading branch information
teosarca committed Mar 26, 2019
1 parent a70ef11 commit 41cfedf
Show file tree
Hide file tree
Showing 7 changed files with 234 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ public interface I_AD_Tab
public static final String COLUMNNAME_AD_Window_ID = "AD_Window_ID";

/**
* Set Schnelleingabe abschalten.
* Set Schnelleingabe einschalten.
*
* <br>Type: YesNo
* <br>Mandatory: true
Expand All @@ -364,7 +364,7 @@ public interface I_AD_Tab
public void setAllowQuickInput (boolean AllowQuickInput);

/**
* Get Schnelleingabe abschalten.
* Get Schnelleingabe einschalten.
*
* <br>Type: YesNo
* <br>Mandatory: true
Expand Down Expand Up @@ -884,6 +884,29 @@ public interface I_AD_Tab
/** Column name IsRefreshAllOnActivate */
public static final String COLUMNNAME_IsRefreshAllOnActivate = "IsRefreshAllOnActivate";

/**
* Set Refresh view on change events.
*
* <br>Type: YesNo
* <br>Mandatory: true
* <br>Virtual Column: false
*/
public void setIsRefreshViewOnChangeEvents (boolean IsRefreshViewOnChangeEvents);

/**
* Get Refresh view on change events.
*
* <br>Type: YesNo
* <br>Mandatory: true
* <br>Virtual Column: false
*/
public boolean isRefreshViewOnChangeEvents();

/** Column definition for IsRefreshViewOnChangeEvents */
public static final org.adempiere.model.ModelColumn<I_AD_Tab, Object> COLUMN_IsRefreshViewOnChangeEvents = new org.adempiere.model.ModelColumn<I_AD_Tab, Object>(I_AD_Tab.class, "IsRefreshViewOnChangeEvents", null);
/** Column name IsRefreshViewOnChangeEvents */
public static final String COLUMNNAME_IsRefreshViewOnChangeEvents = "IsRefreshViewOnChangeEvents";

/**
* Set Search Active.
* This mark activates the search button from toolbar
Expand Down Expand Up @@ -1034,7 +1057,6 @@ public interface I_AD_Tab

/**
* Set Name.
* Alphanumeric identifier of the entity
*
* <br>Type: String
* <br>Mandatory: true
Expand All @@ -1044,7 +1066,6 @@ public interface I_AD_Tab

/**
* Get Name.
* Alphanumeric identifier of the entity
*
* <br>Type: String
* <br>Mandatory: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class X_AD_Tab extends org.compiere.model.PO implements I_AD_Tab, org.com
/**
*
*/
private static final long serialVersionUID = 304317719L;
private static final long serialVersionUID = 644045757L;

/** Standard Constructor */
public X_AD_Tab (Properties ctx, int AD_Tab_ID, String trxName)
Expand All @@ -35,6 +35,7 @@ public X_AD_Tab (Properties ctx, int AD_Tab_ID, String trxName)
setIsInsertRecord (true); // Y
setIsReadOnly (false);
setIsRefreshAllOnActivate (false); // N
setIsRefreshViewOnChangeEvents (false); // N
setIsSearchCollapsed (true); // Y
setIsSingleRow (false);
setIsSortTab (false); // N
Expand Down Expand Up @@ -418,16 +419,16 @@ public int getAD_Window_ID ()
return ii.intValue();
}

/** Set Schnelleingabe abschalten.
@param AllowQuickInput Schnelleingabe abschalten */
/** Set Schnelleingabe einschalten.
@param AllowQuickInput Schnelleingabe einschalten */
@Override
public void setAllowQuickInput (boolean AllowQuickInput)
{
set_Value (COLUMNNAME_AllowQuickInput, Boolean.valueOf(AllowQuickInput));
}

/** Get Schnelleingabe abschalten.
@return Schnelleingabe abschalten */
/** Get Schnelleingabe einschalten.
@return Schnelleingabe einschalten */
@Override
public boolean isAllowQuickInput ()
{
Expand Down Expand Up @@ -864,6 +865,29 @@ public boolean isRefreshAllOnActivate ()
return false;
}

/** Set Refresh view on change events.
@param IsRefreshViewOnChangeEvents Refresh view on change events */
@Override
public void setIsRefreshViewOnChangeEvents (boolean IsRefreshViewOnChangeEvents)
{
set_Value (COLUMNNAME_IsRefreshViewOnChangeEvents, Boolean.valueOf(IsRefreshViewOnChangeEvents));
}

/** Get Refresh view on change events.
@return Refresh view on change events */
@Override
public boolean isRefreshViewOnChangeEvents ()
{
Object oo = get_Value(COLUMNNAME_IsRefreshViewOnChangeEvents);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}

/** Set Search Active.
@param IsSearchActive
This mark activates the search button from toolbar
Expand Down Expand Up @@ -1014,18 +1038,15 @@ public int getMaxQueryRecords ()
}

/** Set Name.
@param Name
Alphanumeric identifier of the entity
*/
@param Name Name */
@Override
public void setName (java.lang.String Name)
{
set_Value (COLUMNNAME_Name, Name);
}

/** Get Name.
@return Alphanumeric identifier of the entity
*/
@return Name */
@Override
public java.lang.String getName ()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ private static boolean loadTabDetails (final GridTabVO vo, final ResultSet rs)
}

vo.allowQuickInput = StringUtils.toBoolean(rs.getString(I_AD_Tab.COLUMNNAME_AllowQuickInput));
vo.refreshViewOnChangeEvents = StringUtils.toBoolean(rs.getString(I_AD_Tab.COLUMNNAME_IsRefreshViewOnChangeEvents));

loadTabDetails_metas(vo, rs); // metas
}
Expand Down Expand Up @@ -520,6 +521,8 @@ private GridTabVO (final Properties ctx, final int windowNo, final int tabNo, fi

@Getter
private boolean allowQuickInput;
@Getter
private boolean refreshViewOnChangeEvents = false;

@Override
public String toString()
Expand Down Expand Up @@ -743,6 +746,7 @@ protected GridTabVO clone(final Properties ctx, final int windowNo)
clone.onlyCurrentDays = 0;

clone.allowQuickInput = allowQuickInput;
clone.refreshViewOnChangeEvents = refreshViewOnChangeEvents;

clone_metas(ctx, windowNo, clone); // metas

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ t.ad_tab_id
, t.maxqueryrecords
, t.EntityType
, t.AllowQuickInput
, t.IsRefreshViewOnChangeEvents
FROM ad_tab t
JOIN ad_table tbl ON t.ad_table_id = tbl.ad_table_id
WHERE t.isactive = 'Y'::bpchar AND tbl.isactive = 'Y'::bpchar;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ trl.ad_language
, t.maxqueryrecords
, t.EntityType
, t.AllowQuickInput
, t.IsRefreshViewOnChangeEvents
FROM ad_tab t
JOIN ad_table tbl ON t.ad_table_id = tbl.ad_table_id
JOIN ad_tab_trl trl ON t.ad_tab_id = trl.ad_tab_id
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
-- 2019-03-25T18:03:12.314
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,576297,0,'IsRefreshViewOnChangeEvents',TO_TIMESTAMP('2019-03-25 18:03:11','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Refresh view on change events','Refresh view on change events',TO_TIMESTAMP('2019-03-25 18:03:11','YYYY-MM-DD HH24:MI:SS'),100)
;

-- 2019-03-25T18:03:12.386
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, CommitWarning,Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName,WEBUI_NameBrowse,WEBUI_NameNew,WEBUI_NameNewBreadcrumb, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Element_ID, t.CommitWarning,t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.WEBUI_NameNewBreadcrumb, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' OR l.IsBaseLanguage='Y') AND t.AD_Element_ID=576297 AND NOT EXISTS (SELECT 1 FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;

-- 2019-03-25T18:03:29.073
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DDL_NoForeignKey,DefaultValue,EntityType,FieldLength,IsActive,IsAdvancedText,IsAllowLogging,IsAlwaysUpdateable,IsAutoApplyValidationRule,IsAutocomplete,IsCalculated,IsDimension,IsDLMPartitionBoundary,IsEncrypted,IsForceIncludeInGeneratedModel,IsGenericZoomKeyColumn,IsGenericZoomOrigin,IsIdentifier,IsKey,IsLazyLoading,IsMandatory,IsParent,IsRangeFilter,IsSelectionColumn,IsShowFilterIncrementButtons,IsStaleable,IsSyncDatabase,IsTranslated,IsUpdateable,IsUseDocSequence,Name,SelectionColumnSeqNo,SeqNo,Updated,UpdatedBy,Version) VALUES (0,564636,576297,0,20,106,'IsRefreshViewOnChangeEvents',TO_TIMESTAMP('2019-03-25 18:03:28','YYYY-MM-DD HH24:MI:SS'),100,'N','N','D',1,'Y','N','Y','N','N','N','N','N','N','N','N','N','N','N','N','N','Y','N','N','N','N','N','N','N','Y','N','Refresh view on change events',0,0,TO_TIMESTAMP('2019-03-25 18:03:28','YYYY-MM-DD HH24:MI:SS'),100,0)
;

-- 2019-03-25T18:03:29.111
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Column_ID=564636 AND NOT EXISTS (SELECT 1 FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;

-- 2019-03-25T18:03:32.657
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ SELECT public.db_alter_table('AD_Tab','ALTER TABLE public.AD_Tab ADD COLUMN IsRefreshViewOnChangeEvents CHAR(1) DEFAULT ''N'' CHECK (IsRefreshViewOnChangeEvents IN (''Y'',''N'')) NOT NULL')
;

-- 2019-03-25T18:03:53.776
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,564636,578093,0,106,TO_TIMESTAMP('2019-03-25 18:03:53','YYYY-MM-DD HH24:MI:SS'),100,1,'D','Y','N','N','N','N','N','N','N','Refresh view on change events',TO_TIMESTAMP('2019-03-25 18:03:53','YYYY-MM-DD HH24:MI:SS'),100)
;

-- 2019-03-25T18:03:53.789
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Field_ID=578093 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;

-- 2019-03-25T18:04:33.808
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=480,Updated=TO_TIMESTAMP('2019-03-25 18:04:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=578093
;

Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
DROP VIEW IF EXISTS ad_tab_v;
CREATE OR REPLACE VIEW ad_tab_v AS
SELECT
-- trl.ad_language
t.ad_tab_id
, t.Template_Tab_ID
, t.ad_window_id
, t.InternalName
, t.ad_table_id
, t.name
, t.description
, t.help
, t.seqno
, t.issinglerow
, t.hastree
, t.isinfotab
, tbl.replicationtype
, tbl.tablename
, tbl.accesslevel
, tbl.issecurityenabled
, tbl.isdeleteable
, tbl.ishighvolume
, tbl.isview
, 'N'::bpchar AS hasassociation
, t.istranslationtab
, t.isreadonly
, t.ad_image_id
, t.tablevel
, t.whereclause
, t.orderbyclause
, t.commitwarning
, t.readonlylogic
, t.displaylogic
, t.ad_column_id
, t.ad_process_id
, t.issorttab
, t.isinsertrecord
, t.isadvancedtab
, t.ad_columnsortorder_id
, t.ad_columnsortyesno_id
, t.included_tab_id
, t.parent_column_id
, t.isrefreshallonactivate
, t.issearchactive
, t.defaultwhereclause
, t.issearchcollapsed
, t.isqueryonload
, t.isgridmodeonly
, t.ad_message_id
, t.ischeckparentschanged
, t.maxqueryrecords
, t.EntityType
, t.AllowQuickInput
, t.IsRefreshViewOnChangeEvents
FROM ad_tab t
JOIN ad_table tbl ON t.ad_table_id = tbl.ad_table_id
WHERE t.isactive = 'Y'::bpchar AND tbl.isactive = 'Y'::bpchar;












DROP VIEW IF EXISTS ad_tab_vt;
CREATE OR REPLACE VIEW ad_tab_vt AS
SELECT
trl.ad_language
, t.ad_tab_id
, t.Template_Tab_ID
, t.ad_window_id
, t.InternalName
, t.ad_table_id
, trl.name
, t.name as Name_BaseLang
, trl.description
, t.description as Description_BaseLang
, trl.help
, t.help as Help_BaseLang
, t.seqno
, t.issinglerow
, t.hastree
, t.isinfotab
, tbl.replicationtype
, tbl.tablename
, tbl.accesslevel
, tbl.issecurityenabled
, tbl.isdeleteable
, tbl.ishighvolume
, tbl.isview
, 'N'::bpchar AS hasassociation
, t.istranslationtab
, t.isreadonly
, t.ad_image_id
, t.tablevel
, t.whereclause
, t.orderbyclause
, trl.commitwarning
, t.CommitWarning as CommitWarning_BaseLang
, t.readonlylogic
, t.displaylogic
, t.ad_column_id
, t.ad_process_id
, t.issorttab
, t.isinsertrecord
, t.isadvancedtab
, t.ad_columnsortorder_id
, t.ad_columnsortyesno_id
, t.included_tab_id
, t.parent_column_id
, t.isrefreshallonactivate
, t.issearchactive
, t.defaultwhereclause
, t.issearchcollapsed
, t.isqueryonload
, t.isgridmodeonly
, t.ad_message_id
, t.ischeckparentschanged
, t.maxqueryrecords
, t.EntityType
, t.AllowQuickInput
, t.IsRefreshViewOnChangeEvents
FROM ad_tab t
JOIN ad_table tbl ON t.ad_table_id = tbl.ad_table_id
JOIN ad_tab_trl trl ON t.ad_tab_id = trl.ad_tab_id
WHERE t.isactive = 'Y'::bpchar AND tbl.isactive = 'Y'::bpchar;

0 comments on commit 41cfedf

Please sign in to comment.