Class OperationDefinitionFactory


  • public final class OperationDefinitionFactory
    extends java.lang.Object
    Factory class for OperationDefintions. The actual operation implementation classes are registered in META-INF/spring/applicationContext-operation-beans-definitions.xml in modules/ijc.services.impl module.
    Author:
    Tim Dudgeon
    • Method Detail

      • addTableSetStd

        public static OperationDefinition addTableSetStd​(java.lang.String schemaId,
                                                         java.lang.String dbSchemaName,
                                                         java.lang.String tableName,
                                                         java.lang.String primaryKeyColumnName,
                                                         java.lang.String extraColumns)
      • addTableSetGeneric

        public static OperationDefinition addTableSetGeneric​(java.lang.String schemaId,
                                                             java.lang.String dbSchemaName,
                                                             java.lang.String tableName,
                                                             java.util.List<com.im.commons.db.ddl.DBDatabaseInfo.NativeType> columnDefs,
                                                             java.util.List<java.lang.String> columnNames)
      • addTableSetJChemProperty

        public static OperationDefinition addTableSetJChemProperty​(java.lang.String schemaId,
                                                                   java.lang.String dbSchemaName,
                                                                   java.lang.String tableName,
                                                                   java.util.Map<java.lang.String,​java.lang.String> properties)
        Create a JChem property table
        Parameters:
        schemaId - The ID of the schema
        dbSchemaName - The name of the database schema. Can be null for schema-less DBs.
        tableName - The name of the new property table
        properties - Any initial properties that should be loadeded into the new property table.
        Returns:
        The OperationDefinition
      • addTableSetInlineViewStd

        public static OperationDefinition addTableSetInlineViewStd​(java.lang.String schemaId,
                                                                   java.lang.String dbSchemaName,
                                                                   java.lang.String tableName,
                                                                   java.lang.String sql,
                                                                   java.lang.String primaryKeyColumnName)
      • updateTableSetInlineViewStd

        public static OperationDefinition updateTableSetInlineViewStd​(java.lang.String schemaId,
                                                                      java.lang.String dbSchemaName,
                                                                      java.lang.String tableName,
                                                                      java.lang.String sql)
      • addJCCIndexToJCBTable

        public static OperationDefinition addJCCIndexToJCBTable​(java.lang.String dbSchemaName,
                                                                java.lang.String indexName,
                                                                java.lang.String column,
                                                                java.lang.String tableCreationOperationId,
                                                                java.util.Map<java.lang.String,​java.lang.String> params)
      • addJCCIndexToStdTable

        public static OperationDefinition addJCCIndexToStdTable​(java.lang.String dbSchemaName,
                                                                java.lang.String tableName,
                                                                java.lang.String propertyTableName,
                                                                int tableType,
                                                                int numberOfInts,
                                                                int numberOfOnes,
                                                                int numberOfEdges,
                                                                boolean absoluteStereo,
                                                                boolean duplicateFiltering,
                                                                boolean tautomerDuplicateChecking,
                                                                java.lang.String standardizerConfig,
                                                                java.lang.String indexName,
                                                                java.lang.String column,
                                                                java.lang.String tableCreationOperationId)
      • addChoralIndexToStdTable

        public static OperationDefinition addChoralIndexToStdTable​(java.lang.String tableCreationOperationId,
                                                                   java.util.function.Consumer<com.im.commons.progress.DFFeedback> createJCCIndexFunction)
      • addJPCIndexToStdTable

        public static OperationDefinition addJPCIndexToStdTable​(java.lang.String tableCreationOperationId,
                                                                java.util.function.Consumer<com.im.commons.progress.DFFeedback> createJPCIndexFunction)
      • addTableSetJCB

        public static OperationDefinition addTableSetJCB​(java.lang.String schemaId,
                                                         java.lang.String dbSchemaName,
                                                         java.lang.String tableName,
                                                         java.lang.String propertyTableSchemaName,
                                                         java.lang.String propertyTableName,
                                                         int tableType,
                                                         int numberOfInts,
                                                         int numberOfOnes,
                                                         int numberOfEdges,
                                                         boolean absoluteStereo,
                                                         boolean tautomerDuplicateChecking,
                                                         java.lang.String standardizerConfig)
      • updateTableName

        public static OperationDefinition updateTableName​(java.lang.String schemaId,
                                                          com.im.commons.db.ddl.tablesets.TableSetInfo tableSetInfo,
                                                          int tableIndex,
                                                          java.lang.String newName)
      • updateStandardizer

        public static OperationDefinition updateStandardizer​(java.lang.String schemaId,
                                                             com.im.commons.db.ddl.tablesets.AbstractJChemTableSetInfo tableSetInfo,
                                                             java.lang.String standardizer)
      • updateAbsoluteStereo

        public static OperationDefinition updateAbsoluteStereo​(java.lang.String schemaId,
                                                               com.im.commons.db.ddl.tablesets.AbstractJChemTableSetInfo tableSetInfo,
                                                               boolean absoluteStereo)
      • addDataTree

        public static OperationDefinition addDataTree​(java.lang.String schemaId,
                                                      java.lang.String rootEntityId,
                                                      java.lang.String dataTreeId,
                                                      java.lang.String dataTreeName,
                                                      java.lang.String dataTreeType,
                                                      java.lang.String dataTreeDescription,
                                                      java.util.List<DataTreeInfo.ChildVertexDTO> childVertices)
        Create DataTree
        Parameters:
        schemaId -
        rootEntityId -
        dataTreeId -
        dataTreeName -
        dataTreeType -
        dataTreeDescription -
        childVertices -
        Returns:
        The OperationDefinition
      • updateDataTree

        public static OperationDefinition updateDataTree​(java.lang.String schemaId,
                                                         DataTreeInfo old,
                                                         DataTreeInfo nue)
        Update DataTree
        Parameters:
        schemaId -
        old -
        nue -
        Returns:
        The OperationDefinition
      • deleteDataTree

        public static OperationDefinition deleteDataTree​(java.lang.String schemaId,
                                                         DataTreeInfo old)
        Delete DataTree
        Parameters:
        schemaId -
        old -
        Returns:
        The OperationDefinition
      • deleteRelationship

        public static OperationDefinition deleteRelationship​(java.lang.String schemaId,
                                                             RelationshipInfo old)
        Delete Relationship
        Parameters:
        schemaId -
        old -
        Returns:
        The OperationDefinition
      • addView

        public static OperationDefinition addView​(java.lang.String schemaId,
                                                  java.lang.String dataTreeId,
                                                  java.lang.String viewId,
                                                  java.lang.String viewName,
                                                  java.lang.String viewType,
                                                  java.lang.String viewDescription,
                                                  java.lang.String viewConfiguration,
                                                  java.lang.String owner)
        Create View
        Parameters:
        schemaId -
        dataTreeId -
        viewId -
        viewName -
        viewType -
        viewDescription -
        viewConfiguration -
        owner -
        Returns:
        The OperationDefinition
      • updateView

        public static OperationDefinition updateView​(java.lang.String schemaId,
                                                     java.lang.String dataTreeId,
                                                     ViewConfigInfo old,
                                                     ViewConfigInfo nue)
        Update View
        Parameters:
        dataTreeId -
        old -
        nue -
        Returns:
        The OperationDefinition
      • deleteView

        public static OperationDefinition deleteView​(java.lang.String schemaId,
                                                     java.lang.String dataTreeId,
                                                     ViewConfigInfo old)
        Delete View
        Parameters:
        dataTreeId -
        old -
        Returns:
        The OperationDefinition
      • addQuery

        public static OperationDefinition addQuery​(java.lang.String schemaId,
                                                   java.lang.String dataTreeId,
                                                   java.lang.String queryId,
                                                   java.lang.String queryName,
                                                   java.lang.String queryType,
                                                   java.lang.String queryDescription,
                                                   java.lang.String queryExpression,
                                                   java.lang.String owner)
        Create Query
        Parameters:
        schemaId -
        dataTreeId -
        queryId -
        queryName -
        queryType -
        queryDescription -
        queryExpression -
        owner -
        Returns:
        The OperationDefinition
      • updateQuery

        public static OperationDefinition updateQuery​(java.lang.String schemaId,
                                                      java.lang.String dataTreeId,
                                                      QueryInfo old,
                                                      QueryInfo nue)
        Update Query
        Parameters:
        schemaId -
        old -
        nue -
        Returns:
        The OperationDefinition
      • deleteQuery

        public static OperationDefinition deleteQuery​(java.lang.String schemaId,
                                                      java.lang.String dataTreeId,
                                                      QueryInfo old)
        Delete Query
        Parameters:
        schemaId -
        old -
        Returns:
        The OperationDefinition
      • addExportTemplate

        public static OperationDefinition addExportTemplate​(java.lang.String schemaId,
                                                            java.lang.String dataTreeId,
                                                            java.lang.String exportTemplateID,
                                                            java.lang.String exportTemplateName,
                                                            java.lang.String exportTemplateType,
                                                            java.lang.String description,
                                                            java.lang.String exportTemplateData,
                                                            java.lang.String owner)
      • addScript

        public static OperationDefinition addScript​(java.lang.String schemaId,
                                                    java.lang.String parentId,
                                                    java.lang.String scriptId,
                                                    java.lang.String scriptName,
                                                    java.lang.String scriptType,
                                                    java.lang.String scriptDescription,
                                                    java.lang.String scriptXml,
                                                    java.lang.String owner)
      • addList

        public static OperationDefinition addList​(java.lang.String schemaId,
                                                  java.lang.String parentId,
                                                  java.lang.String listId,
                                                  java.lang.String listName,
                                                  java.lang.String implType,
                                                  java.lang.String listDescription,
                                                  java.util.ArrayList<java.lang.String> values,
                                                  java.lang.String owner)
      • updateList

        public static OperationDefinition updateList​(java.lang.String schemaId,
                                                     java.lang.String entityId,
                                                     ListInfo old,
                                                     ListInfo nue)
        Update List
        Parameters:
        schemaId -
        old -
        nue -
        Returns:
        The OperationDefinition
      • deleteList

        public static OperationDefinition deleteList​(java.lang.String schemaId,
                                                     java.lang.String entityId,
                                                     ListInfo old)
        Delete List
        Parameters:
        schemaId -
        old -
        Returns:
        The OperationDefinition
      • updateSchema

        public static OperationDefinition updateSchema​(java.lang.String schemaId,
                                                       SchemaInfo old,
                                                       SchemaInfo nue)
        Update DataTree
        Parameters:
        schemaId -
        old -
        nue -
        Returns:
        The OperationDefinition
      • addEntity

        public static OperationDefinition addEntity​(java.lang.String schemaId,
                                                    java.lang.String entityId,
                                                    java.lang.String tableCreationOperationId,
                                                    java.lang.String sequenceCreationOperationId,
                                                    java.lang.String pkColumnName,
                                                    java.lang.String idFieldId,
                                                    java.lang.String implType,
                                                    java.lang.String entityName,
                                                    java.lang.String entityDescription,
                                                    java.util.Map<java.lang.String,​java.lang.String> props)
      • promoteEntity

        public static OperationDefinition promoteEntity​(java.lang.String schemaId,
                                                        java.lang.String entityId,
                                                        com.im.commons.db.ddl.tablesets.TableSetInfo tableSetInfo,
                                                        EntityInfo.ValueGeneratorDTO valueGenerator,
                                                        java.lang.String pkColumnName,
                                                        java.lang.String idFieldId,
                                                        java.lang.String entityType,
                                                        java.lang.String entityName,
                                                        java.lang.String entityDescription,
                                                        java.util.Map<java.lang.String,​java.lang.String> props)
      • addSequence

        public static OperationDefinition addSequence​(java.lang.String dbSchemaName,
                                                      java.lang.String seqName)
      • addField

        public static OperationDefinition addField​(java.lang.String schemaId,
                                                   java.lang.String entityId,
                                                   java.lang.String fieldId,
                                                   java.lang.String columnCreationOperationId,
                                                   java.lang.String fieldName,
                                                   java.lang.String implType,
                                                   int tableIndex,
                                                   AbstractFieldInfo.Required required,
                                                   java.util.Map<java.lang.String,​java.lang.String> xAttributes)
        Add field operation.
        Parameters:
        entityId - ID of the entity to which field is added
        fieldId - ID for the new field
        columnCreationOperationId - ID of a previous operation that created the column for the field
        fieldName - Name for the field
        implType - The implementation type contstant for the field
        tableIndex - The index of the table in the TableSet
        required - The required status for the field
        xAttributes - Any Xtra attributes
        Returns:
        The OperationDefinition
      • addDynamicUrlField

        public static OperationDefinition addDynamicUrlField​(java.lang.String schemaId,
                                                             java.lang.String entityId,
                                                             java.lang.String fieldId,
                                                             java.lang.String fieldName,
                                                             java.lang.String fieldType,
                                                             int tableIndex,
                                                             AbstractFieldInfo.Required required,
                                                             java.util.Map<java.lang.String,​java.lang.String> xAttributes,
                                                             java.lang.String calcTemplateFormatPattern,
                                                             java.util.List<java.lang.String> calcTemplateFieldIds)
        Add dynamic url field operation.
        Parameters:
        entityId - ID of the entity to which field is added
        fieldId - ID for the new field
        fieldName - Name for the field
        fieldType - The implementation type contstant for the field
        tableIndex - The index of the table in the TableSet
        required - The required status for the field
        xAttributes - Any Xtra attributes
        calcTemplateFormatPattern - The f ormat pattern for calculated template
        calcTemplateFieldIds - The f ield ids for calculated template
        Returns:
        The OperationDefinition
      • addCalculatedField

        public static OperationDefinition addCalculatedField​(java.lang.String schemaId,
                                                             java.lang.String entityId,
                                                             java.lang.String fieldId,
                                                             java.lang.String fieldName,
                                                             java.lang.String fieldType,
                                                             int tableIndex,
                                                             AbstractFieldInfo.Required required,
                                                             java.util.Map<java.lang.String,​java.lang.String> xAttributes,
                                                             FieldInfo.Script script,
                                                             java.util.List<java.lang.String> calcTemplateFieldIds,
                                                             java.util.List<FieldInfo.CalcFieldArgInfo> calcTemplateFieldArgs,
                                                             java.lang.String owner)
        Add dynamic url field operation.
        Parameters:
        entityId - ID of the entity to which field is added
        fieldId - ID for the new field
        fieldName - Name for the field
        fieldType - The implementation type constant for the field
        tableIndex - The index of the table in the TableSet
        required - The required status for the field
        xAttributes - Any Xtra attributes
        script - The groovy expression.
        calcTemplateFieldIds - The field ids for calculated template
        calcTemplateFieldArgs -
        owner -
        Returns:
        The OperationDefinition
      • promoteField

        public static OperationDefinition promoteField​(java.lang.String schemaId,
                                                       java.lang.String entityId,
                                                       java.lang.String fieldId,
                                                       java.util.List<java.lang.String> colNames,
                                                       java.util.List<java.lang.Integer> colJdbcTypes,
                                                       java.util.List<java.lang.String> colDefaultValues,
                                                       java.lang.String columnCreationOperationId,
                                                       java.lang.String tableCreationOperationId,
                                                       java.lang.String fieldName,
                                                       java.lang.String fieldType,
                                                       int tableIndex,
                                                       AbstractFieldInfo.Required required,
                                                       java.util.List<java.lang.Boolean> oTexts,
                                                       java.util.Map<java.lang.String,​java.lang.String> xAttributes)
      • updateField

        public static OperationDefinition updateField​(java.lang.String schemaId,
                                                      java.lang.String entityId,
                                                      AbstractFieldInfo old,
                                                      AbstractFieldInfo nue)
        Update detail of the field
        Parameters:
        entityId - ID of the entity this field belongs to
        old - The old FieldInfo
        nue - The new FieldInfo
        Returns:
        The OperationDefinition
      • updateField

        public static OperationDefinition updateField​(java.lang.String schemaId,
                                                      java.lang.String entityId,
                                                      AbstractFieldInfo old,
                                                      AbstractFieldInfo nue,
                                                      java.lang.String[] columnOperationIds)
        Update the field allowing a callback to previous operations that changed the column(s) the field uses
        Parameters:
        entityId - ID of the entity this field belongs to
        old - The old FieldInfo
        nue - The new FieldInfo
        columnOperationIds - An array of operations that created or modified columns The array size must equal the numbers of columns. Each element in the array can be null, in which case the DBColumnInfo at that postion in the new FieldInfo will be used, or it can define the ID of a previous operation, in which case the DBColInfo from that operation will be used
      • updateEntity

        public static OperationDefinition updateEntity​(java.lang.String schemaId,
                                                       AbstractEntityInfo old,
                                                       AbstractEntityInfo nue)
        Update detail of the entity
        Parameters:
        schemaId - ID of the schema this entity belongs to
        old - The old entity info
        nue - The new entity info
        Returns:
        The OperationDefinition
      • addColumn

        public static OperationDefinition addColumn​(com.im.commons.db.ddl.tablesets.TableSetInfo tableSetInfo,
                                                    int tableIndex,
                                                    java.lang.String colName,
                                                    java.lang.Class colClass,
                                                    java.lang.String nativeType,
                                                    java.lang.String colDefinition,
                                                    java.lang.Object colDefault,
                                                    boolean isNotNull)
      • addChemicalTermsColumn

        public static OperationDefinition addChemicalTermsColumn​(com.im.commons.db.ddl.tablesets.AbstractJChemTableSetInfo tableSetInfo,
                                                                 java.lang.String colName,
                                                                 java.lang.Class colClass,
                                                                 com.im.commons.db.ddl.DBDatabaseInfo.NativeType nativeType,
                                                                 java.lang.String colDefinition,
                                                                 java.lang.String chemTermsDefinition)
      • updateColumnNotNull

        public static OperationDefinition updateColumnNotNull​(com.im.commons.db.ddl.tablesets.TableSetInfo tableSetInfo,
                                                              int tableIndex,
                                                              com.im.commons.db.ddl.DBColInfo columnInfo,
                                                              boolean isNotNull)
      • updateColumnDefault

        public static OperationDefinition updateColumnDefault​(com.im.commons.db.ddl.tablesets.TableSetInfo tableSetInfo,
                                                              int tableIndex,
                                                              com.im.commons.db.ddl.DBColInfo col,
                                                              java.lang.String defaultValue)
      • updateColumnName

        public static OperationDefinition updateColumnName​(com.im.commons.db.ddl.tablesets.TableSetInfo tableSetInfo,
                                                           int tableIndex,
                                                           com.im.commons.db.ddl.DBColInfo col,
                                                           java.lang.String newName)
      • updateColumnDefinition

        public static OperationDefinition updateColumnDefinition​(com.im.commons.db.ddl.tablesets.TableSetInfo tableSetInfo,
                                                                 int tableIndex,
                                                                 com.im.commons.db.ddl.DBColInfo col,
                                                                 java.lang.String definition)
      • updateChemicalTermsDefinition

        public static OperationDefinition updateChemicalTermsDefinition​(com.im.commons.db.ddl.tablesets.AbstractJChemTableSetInfo tableSetInfo,
                                                                        int tableIndex,
                                                                        com.im.commons.db.ddl.DBColInfo col,
                                                                        java.lang.String newCTExpression)
      • addRelationship

        public static OperationDefinition addRelationship​(java.lang.String schemaId,
                                                          java.lang.String relationshipId,
                                                          java.lang.String name,
                                                          java.lang.String description,
                                                          java.lang.String implType,
                                                          RelationshipInfo.RelationshipType relationshipType,
                                                          java.lang.String srcEntityId,
                                                          java.lang.String srcFieldId,
                                                          java.lang.String destEntityId,
                                                          java.lang.String destFieldId,
                                                          java.lang.String foreignKeySchemaName,
                                                          java.lang.String foreignKeyName,
                                                          RelationshipInfo.JoinTableDTO joinTableDTO,
                                                          java.lang.String joinTableCreationOperationId,
                                                          java.util.List<? extends java.lang.String> foreignKeyCreationOperationIds)
      • addForeignKey

        public static OperationDefinition addForeignKey​(java.lang.String name,
                                                        java.lang.String parentSchema,
                                                        java.lang.String parentTable,
                                                        java.lang.String dependentSchema,
                                                        java.lang.String dependentTable,
                                                        java.lang.String[] parentColumns,
                                                        java.lang.String[] dependentColumns,
                                                        java.lang.String onDeleteRule,
                                                        java.lang.String onUpdateRule)
      • addIndex

        public static OperationDefinition addIndex​(java.lang.String schemaPlusIndexName,
                                                   java.lang.String indexType,
                                                   java.lang.String dbSchemaName,
                                                   java.lang.String schemaPlusTableName,
                                                   java.util.List<java.lang.String> columnNames,
                                                   java.util.List<java.lang.Boolean> order)
      • dropIndex

        public static OperationDefinition dropIndex​(com.im.commons.db.ddl.DBIndexInfo index)
      • addUniqueConstraint

        public static OperationDefinition addUniqueConstraint​(java.lang.String dbSchemaName,
                                                              java.lang.String table,
                                                              java.lang.String constraintName,
                                                              java.util.List<java.lang.String> columnNames)
      • dropUniqueConstraint

        public static OperationDefinition dropUniqueConstraint​(java.lang.String dbSchemaName,
                                                               java.lang.String tableName,
                                                               com.im.commons.db.ddl.DBConstraintInfo constraint)
      • dropForeignKey

        public static OperationDefinition dropForeignKey​(com.im.commons.db.ddl.DBForeignKeyInfo foreignKey)
      • rebuildIndex

        public static OperationDefinition rebuildIndex​(com.im.commons.db.ddl.DBIndexInfo index)
      • rebuildCartridgeIndex

        public static OperationDefinition rebuildCartridgeIndex​(com.im.commons.db.ddl.DBIndexInfo index,
                                                                boolean recalculate)
      • dropSequence

        public static OperationDefinition dropSequence​(java.lang.String dbSchemaName,
                                                       java.lang.String seqName,
                                                       boolean haltOnError)
      • dropTableSet

        public static OperationDefinition dropTableSet​(com.im.commons.db.ddl.tablesets.TableSetInfo tableSetInfo)
      • dropJChemPropertyTable

        public static OperationDefinition dropJChemPropertyTable​(com.im.commons.db.ddl.tablesets.JChemPropertyTableSetInfo tableSetInfo)
      • dropColumn

        public static OperationDefinition dropColumn​(com.im.commons.db.ddl.tablesets.TableSetInfo tableSetInfo,
                                                     int tableIndex,
                                                     com.im.commons.db.ddl.DBColInfo columnInfo)
      • dropChemTermsColumn

        public static OperationDefinition dropChemTermsColumn​(com.im.commons.db.ddl.tablesets.AbstractJChemTableSetInfo tableSetInfo,
                                                              com.im.commons.db.ddl.DBColInfo columnInfo)
      • dropTrigger

        public static OperationDefinition dropTrigger​(com.im.commons.db.ddl.tablesets.TableSetInfo tableSetInfo,
                                                      java.lang.String triggerName)
      • addDFItemXMLMetaData

        public static OperationDefinition addDFItemXMLMetaData​(java.lang.String schemaId,
                                                               java.lang.String parentId,
                                                               java.lang.String itemId,
                                                               java.lang.String genericType,
                                                               java.lang.String implType,
                                                               java.lang.String xml)
      • deleteDFItemXMLMetaData

        public static OperationDefinition deleteDFItemXMLMetaData​(java.lang.String schemaId,
                                                                  java.lang.String parentId,
                                                                  java.lang.String itemId)
      • updateItemsOrder

        public static OperationDefinition updateItemsOrder​(java.lang.String schemaId,
                                                           java.lang.String parentId,
                                                           java.util.List<com.im.commons.Pair<java.lang.String,​java.lang.Integer>> newIndexes)
      • dropMetaDataTables

        public static OperationDefinition dropMetaDataTables()
        Drop all the IJC metadata tables (those with names IJC_*) from the database. Needless to say, this should ONLY be done when the schema is being deleted!
        Returns:
        The OperationDefinition
      • setSharing

        public static OperationDefinition setSharing​(java.lang.String schemaId,
                                                     java.lang.String itemId,
                                                     com.im.commons.sharing.DFSharing newSharing)
      • addEdge

        public static OperationDefinition addEdge​(java.lang.String dataTreeId,
                                                  java.lang.String entityId,
                                                  java.lang.String relationshipId)
      • removeEdge

        public static OperationDefinition removeEdge​(java.lang.String dataTreeId,
                                                     java.lang.String entityId,
                                                     java.lang.String relationshipId)
      • updateFieldPickList

        public static OperationDefinition updateFieldPickList​(java.lang.String entityId,
                                                              java.lang.String fieldId)