Class MLookupFactory


  • public class MLookupFactory
    extends Object
    Create MLookups
    Version:
    $Id: MLookupFactory.java,v 1.3 2006/07/30 00:58:04 jjanke Exp $
    Author:
    Jorg Janke, Teo Sarca, SC ARHIPAC SERVICE SRL
  • BF [ 1734394 ] MLookupFactory.getLookup_TableDirEmbed is not translated
  • BF [ 1714261 ] MLookupFactory: TableDirEmbed -> TableEmbed not supported
  • BF [ 1672820 ] Sorting should be language-sensitive
  • BF [ 1739530 ] getLookup_TableDirEmbed error when BaseColumn is sql query
  • BF [ 1739544 ] getLookup_TableEmbed error for self referencing references
  • BF [ 1817768 ] Isolate hardcoded table direct columns, Teo Sarca
  • BF [ 2933367 ] Virtual Column Identifiers are not working https://sourceforge.net/p/adempiere/bugs/2291/, Carlos Ruiz, GlobalQSS
  • BF [ 2561593 ] Multi-tenant problem with webui
    • Constructor Detail

      • MLookupFactory

        public MLookupFactory()
    • Method Detail

      • get

        public static MLookup get​(Properties ctx,
                                  int WindowNo,
                                  int Column_ID,
                                  int AD_Reference_ID,
                                  Language language,
                                  String ColumnName,
                                  int AD_Reference_Value_ID,
                                  boolean IsParent,
                                  String ValidationCode)
                           throws Exception
        Create MLookup
        Parameters:
        ctx - context for access
        WindowNo - window no
        AD_Reference_ID - display type
        Column_ID - AD_Column_ID or AD_Process_Para_ID
        language - report language
        ColumnName - key column name
        AD_Reference_Value_ID - AD_Reference (List, Table)
        IsParent - parent (prevents query to directly access value)
        ValidationCode - optional SQL validation
        Returns:
        MLookup
        Throws:
        Exception - if Lookup could not be created
      • getLookupInfo

        public static MLookupInfo getLookupInfo​(Properties ctx,
                                                int WindowNo,
                                                int Column_ID,
                                                int AD_Reference_ID)
      • getLookupInfo

        public static MLookupInfo getLookupInfo​(Properties ctx,
                                                int WindowNo,
                                                int TabNo,
                                                int Column_ID,
                                                int AD_Reference_ID)
      • get

        public static MLookup get​(Properties ctx,
                                  int WindowNo,
                                  int TabNo,
                                  int Column_ID,
                                  int AD_Reference_ID)
        Create MLookup
        Parameters:
        ctx - context for access
        WindowNo - window no
        TabNo - TabNo
        Column_ID - AD_Column_ID or AD_Process_Para_ID
        AD_Reference_ID - display type
        Returns:
        MLookup
      • getLookupInfo

        public static MLookupInfo getLookupInfo​(Properties ctx,
                                                int WindowNo,
                                                int Column_ID,
                                                int AD_Reference_ID,
                                                Language language,
                                                String ColumnName,
                                                int AD_Reference_Value_ID,
                                                boolean IsParent,
                                                String ValidationCode)
        Get Information for Lookups based on Column_ID for Table Columns or Process Parameters. The SQL returns three columns:
                        Key, Value, Name, IsActive      (where either key or value is null)
          
        Parameters:
        ctx - context for access
        language - report language
        WindowNo - window no
        Column_ID - AD_Column_ID or AD_Process_Para_ID
        ColumnName - key column name
        AD_Reference_ID - display type
        AD_Reference_Value_ID - AD_Reference (List, Table)
        IsParent - parent (prevents query to directly access value)
        ValidationCode - optional SQL validation
        Returns:
        lookup info structure
      • getLookupInfo

        public static MLookupInfo getLookupInfo​(Properties ctx,
                                                int WindowNo,
                                                int tabNo,
                                                int Column_ID,
                                                int AD_Reference_ID,
                                                Language language,
                                                String ColumnName,
                                                int AD_Reference_Value_ID,
                                                boolean IsParent,
                                                String ValidationCode)
        Get Information for Lookups based on Column_ID for Table Columns or Process Parameters. The SQL returns three columns:
                        Key, Value, Name, IsActive      (where either key or value is null)
          
        Parameters:
        ctx - context for access
        language - report language
        WindowNo - window no
        tabNo - tab no
        Column_ID - AD_Column_ID or AD_Process_Para_ID
        ColumnName - key column name
        AD_Reference_ID - display type
        AD_Reference_Value_ID - AD_Reference (List, Table)
        IsParent - parent (prevents query to directly access value)
        ValidationCode - optional SQL validation
        Returns:
        lookup info structure
      • getLookup_List

        public static MLookupInfo getLookup_List​(Language language,
                                                 int AD_Reference_Value_ID)
        Get Lookup SQL for Lists
        Parameters:
        language - report language
        AD_Reference_Value_ID - reference value
        Returns:
        SELECT NULL, Value, Name, IsActive FROM AD_Ref_List
      • getLookup_ListEmbed

        public static String getLookup_ListEmbed​(Language language,
                                                 int AD_Reference_Value_ID,
                                                 String linkColumnName)
        Get Lookup SQL for List
        Parameters:
        language - report Language
        AD_Reference_Value_ID - reference value
        linkColumnName - link column name
        Returns:
        SELECT Name FROM AD_Ref_List WHERE AD_Reference_ID=x AND Value=linkColumn
      • getLookup_TableEmbed

        public static String getLookup_TableEmbed​(Language language,
                                                  String BaseColumn,
                                                  String BaseTable,
                                                  int AD_Reference_Value_ID)
        Get Embedded Lookup SQL for Table Lookup
        Parameters:
        language - report language
        BaseColumn - base column name
        BaseTable - base table name
        AD_Reference_Value_ID - reference value
        Returns:
        SELECT Name FROM Table
      • getLookup_TableDirEmbed

        public static String getLookup_TableDirEmbed​(Language language,
                                                     String ColumnName,
                                                     String BaseTable,
                                                     String BaseColumn)
        Get embedded SQL for TableDir Lookup
        Parameters:
        language - report language
        ColumnName - column name
        BaseTable - base table
        BaseColumn - base column
        Returns:
        SELECT Column FROM TableName WHERE BaseTable.BaseColumn=TableName.ColumnName