Skip to content

Commit

Permalink
TEIIDDES-3081
Browse files Browse the repository at this point in the history
 * Added generated result set columns in flat file import processor and
flat file new model contributor:  lastModified, created and size
  • Loading branch information
blafond committed Jun 14, 2017
1 parent 922a20e commit 5b5d1e3
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ private void addGetFilesProcedure(ModelResource mr) throws ModelerCoreException

EObject stringType = datatypeManager.findDatatype("string"); //$NON-NLS-1$
EObject blobType = datatypeManager.findDatatype("blob"); //$NON-NLS-1$
EObject timestampType = datatypeManager.findDatatype("timestamp"); //$NON-NLS-1$
EObject integerType = datatypeManager.findDatatype("int"); //$NON-NLS-1$

Procedure proc = factory.createProcedure();
proc.setName("getFiles"); //$NON-NLS-1$
Expand All @@ -135,20 +137,44 @@ private void addGetFilesProcedure(ModelResource mr) throws ModelerCoreException
column_1.setType(blobType);
}
addValue(result, column_1, result.getColumns());

Column column_2 = factory.createColumn();
column_2.setName("filePath"); //$NON-NLS-1$
if( stringType != null) {
column_2.setType(stringType);
}
addValue(result, column_2, result.getColumns());

Column column_3 = factory.createColumn();
column_3.setName("lastModified"); //$NON-NLS-1$
if( timestampType != null) {
column_3.setType(timestampType);
}
addValue(result, column_3, result.getColumns());

Column column_4 = factory.createColumn();
column_4.setName("created"); //$NON-NLS-1$
if( timestampType != null) {
column_4.setType(timestampType);
}
addValue(result, column_4, result.getColumns());

Column column_5 = factory.createColumn();
column_5.setName("size"); //$NON-NLS-1$
if( integerType != null) {
column_5.setType(integerType);
}
addValue(result, column_5, result.getColumns());

addValue(mr, proc, getModelResourceContents(mr));

}

private void addGetTextFilesProcedure(ModelResource mr) throws ModelerCoreException {
EObject stringType = datatypeManager.findDatatype("string"); //$NON-NLS-1$
EObject clobType = datatypeManager.findDatatype("clob"); //$NON-NLS-1$
EObject timestampType = datatypeManager.findDatatype("timestamp"); //$NON-NLS-1$
EObject integerType = datatypeManager.findDatatype("int"); //$NON-NLS-1$

Procedure proc = factory.createProcedure();
proc.setName("getTextFiles"); //$NON-NLS-1$
Expand Down Expand Up @@ -176,6 +202,27 @@ private void addGetTextFilesProcedure(ModelResource mr) throws ModelerCoreExcept
}
addValue(result, column_2, result.getColumns());

Column column_3 = factory.createColumn();
column_3.setName("lastModified"); //$NON-NLS-1$
if( timestampType != null) {
column_3.setType(timestampType);
}
addValue(result, column_3, result.getColumns());

Column column_4 = factory.createColumn();
column_4.setName("created"); //$NON-NLS-1$
if( timestampType != null) {
column_4.setType(timestampType);
}
addValue(result, column_4, result.getColumns());

Column column_5 = factory.createColumn();
column_5.setName("size"); //$NON-NLS-1$
if( integerType != null) {
column_5.setType(integerType);
}
addValue(result, column_5, result.getColumns());

addValue(mr, proc, getModelResourceContents(mr));

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ private void addGetFilesProcedure(ModelResource mr) throws ModelerCoreException

EObject stringType = datatypeManager.findDatatype("string"); //$NON-NLS-1$
EObject blobType = datatypeManager.findDatatype("blob"); //$NON-NLS-1$
EObject timestampType = datatypeManager.findDatatype("timestamp"); //$NON-NLS-1$
EObject integerType = datatypeManager.findDatatype("int"); //$NON-NLS-1$

Procedure proc = factory.createProcedure();
proc.setName(GET_FILES);
Expand Down Expand Up @@ -162,13 +164,36 @@ private void addGetFilesProcedure(ModelResource mr) throws ModelerCoreException
}
addValue(result, column_2, result.getColumns());

Column column_3 = factory.createColumn();
column_3.setName("lastModified"); //$NON-NLS-1$
if( timestampType != null) {
column_3.setType(timestampType);
}
addValue(result, column_3, result.getColumns());

Column column_4 = factory.createColumn();
column_4.setName("created"); //$NON-NLS-1$
if( timestampType != null) {
column_4.setType(timestampType);
}
addValue(result, column_4, result.getColumns());

Column column_5 = factory.createColumn();
column_5.setName("size"); //$NON-NLS-1$
if( integerType != null) {
column_5.setType(integerType);
}
addValue(result, column_5, result.getColumns());

addValue(mr, proc, getModelResourceContents(mr));

}

private void addGetTextFilesProcedure(ModelResource mr) throws ModelerCoreException {
EObject stringType = datatypeManager.findDatatype("string"); //$NON-NLS-1$
EObject clobType = datatypeManager.findDatatype("clob"); //$NON-NLS-1$
EObject timestampType = datatypeManager.findDatatype("timestamp"); //$NON-NLS-1$
EObject integerType = datatypeManager.findDatatype("int"); //$NON-NLS-1$

Procedure proc = factory.createProcedure();
proc.setName(GET_TEXT_FILES);
Expand Down Expand Up @@ -198,6 +223,27 @@ private void addGetTextFilesProcedure(ModelResource mr) throws ModelerCoreExcept
}
addValue(result, column_2, result.getColumns());

Column column_3 = factory.createColumn();
column_3.setName("lastModified"); //$NON-NLS-1$
if( timestampType != null) {
column_3.setType(timestampType);
}
addValue(result, column_3, result.getColumns());

Column column_4 = factory.createColumn();
column_4.setName("created"); //$NON-NLS-1$
if( timestampType != null) {
column_4.setType(timestampType);
}
addValue(result, column_4, result.getColumns());

Column column_5 = factory.createColumn();
column_5.setName("size"); //$NON-NLS-1$
if( integerType != null) {
column_5.setType(integerType);
}
addValue(result, column_5, result.getColumns());

addValue(mr, proc, getModelResourceContents(mr));

}
Expand Down

0 comments on commit 5b5d1e3

Please sign in to comment.