org.gcube.contentmanagement.timeseriesservice.impl.editing
Class DimensionEditor

java.lang.Object
  extended by org.gcube.contentmanagement.timeseriesservice.impl.editing.EditProxy
      extended by org.gcube.contentmanagement.timeseriesservice.impl.editing.Edit
          extended by org.gcube.contentmanagement.timeseriesservice.impl.editing.DimensionEditor
All Implemented Interfaces:
Serializable

public class DimensionEditor
extends Edit

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.gcube.contentmanagement.timeseriesservice.impl.editing.Edit
Edit.TYPE
 
Field Summary
protected  org.gcube.common.dbinterface.tables.SimpleTable dimensionTable
           
 
Fields inherited from class org.gcube.contentmanagement.timeseriesservice.impl.editing.Edit
COUNT_ALIAS, CURATION_TABLE_ALIAS, DIMENSION_TABLE_ALIAS, editorType, fieldId, fieldlength, historyEditorList, internalColumndefinition, isUnderInitialization, resourceId, resourceTable, ROW_ID_LABEL, withoutErrors
 
Constructor Summary
DimensionEditor(String resourceId, String fieldId, String codelistId, String keyId, org.gcube.common.dbinterface.tables.SimpleTable resourceTable, int[] fieldlength, int resourceTableCount, boolean withoutErrors)
          constructor
 
Method Summary
 long check()
          checks how many errors there will be in edit mode for a specific dimension setting
 String getCodelistId()
           
 org.gcube.common.dbinterface.tables.SimpleTable getDimensionTable()
           
 String getDimensionTableNameHuman()
          returns the table name human readable
 List<org.gcube.contentmanagement.timeseriesservice.stubs.ErrorPair> getDistinctErrors()
           
 String getFieldId()
           
 int[] getFieldLength()
           
 String getKeyId()
           
 org.gcube.common.dbinterface.types.Type getKeyType()
           
 String getPossibleValues(String word)
           
 org.gcube.contentmanagement.timeseriesservice.stubs.types.ColumnDefinition getTemporaryColumnDefinition(org.gcube.contentmanagement.timeseriesservice.stubs.types.ColumnDefinition oldColumnDefinition)
           
 void internalInitialize(org.gcube.common.dbinterface.pool.DBSession session)
          initializes the Field Editor
 void modifyDistinctEntryId(String fieldId, String newId, long rowId, String dimensionId, String keyName)
           
 void modifyDistinctEntryValue(String fieldId, long rowId, String newValue)
           
 void modifyEntryId(String fieldId, String newId, long rowId)
          modifies an entry with a specific fieldId with the entry corresponding to the newId in the entry with selected row id
 void replaceDistinctIds(String fieldId, String oldId, String newId, String keyName)
           
 void replaceDistinctValue(String fieldId, String newValue, String oldValue)
           
 void replaceEntryValueWithId(String oldValue, String newId, String fieldId)
           
 void replaceIds(String fieldId, String oldId, String newId)
           
 void replaceValue(int rowId, Object value)
           
 void setCodelistId(String codelistId)
          sets the dimension id
 void setDimensionTableNameHuman(String dimensionTableNameHuman)
          sets the dimension table name human
 void setFieldLength(int[] fieldLength)
           
 void setKeyName(String keyId)
          sets the key name
 void setKeyType(org.gcube.common.dbinterface.types.Type keyType)
          set the key type
 
Methods inherited from class org.gcube.contentmanagement.timeseriesservice.impl.editing.Edit
dismiss, errorCount, getCorrectsTable, getCorrectsTableName, getEditorType, getHistoryItems, getIsUnderInitialization, getResultAsJson, getWrongsTable, getWrongsTableName, initialize, removeAllErrors, removeSingleError, save, setHistoryItems, setIsUnderInitialization, setIsUnderInitialization, totalCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dimensionTable

protected org.gcube.common.dbinterface.tables.SimpleTable dimensionTable
Constructor Detail

DimensionEditor

public DimensionEditor(String resourceId,
                       String fieldId,
                       String codelistId,
                       String keyId,
                       org.gcube.common.dbinterface.tables.SimpleTable resourceTable,
                       int[] fieldlength,
                       int resourceTableCount,
                       boolean withoutErrors)
                throws Exception
constructor

Parameters:
resourceId - the associated resource id
fieldId - the field id
dimensionId - the dimension id
keyName - the key name
resourceTableName - the resource table name
withoutError - the error check
fieldlength - the length of the fields
resourceTableCount - the number of entries in the original table
Throws:
Exception - -
Method Detail

internalInitialize

public void internalInitialize(org.gcube.common.dbinterface.pool.DBSession session)
                        throws Exception
initializes the Field Editor

Specified by:
internalInitialize in class Edit
Throws:
Exception

getFieldId

public String getFieldId()
Overrides:
getFieldId in class Edit
Returns:
the filed id

getKeyType

public org.gcube.common.dbinterface.types.Type getKeyType()
Returns:
the key type

setKeyType

public void setKeyType(org.gcube.common.dbinterface.types.Type keyType)
set the key type

Parameters:
keyType - key type to set

getKeyId

public String getKeyId()
Returns:
the key name

setKeyName

public void setKeyName(String keyId)
sets the key name

Parameters:
keyName - key name to set

getCodelistId

public String getCodelistId()
Returns:
the dimension id

setCodelistId

public void setCodelistId(String codelistId)
sets the dimension id

Parameters:
dimensionId - dimension id

getDimensionTableNameHuman

public String getDimensionTableNameHuman()
returns the table name human readable

Returns:
the table name

setDimensionTableNameHuman

public void setDimensionTableNameHuman(String dimensionTableNameHuman)
sets the dimension table name human

Parameters:
dimensionTableNameHuman - the table name

modifyEntryId

public void modifyEntryId(String fieldId,
                          String newId,
                          long rowId)
                   throws Exception
modifies an entry with a specific fieldId with the entry corresponding to the newId in the entry with selected row id

Specified by:
modifyEntryId in class EditProxy
Parameters:
fieldId - the field id
newId - the new id
rowId - the row id
Throws:
Exception - -

modifyDistinctEntryId

public void modifyDistinctEntryId(String fieldId,
                                  String newId,
                                  long rowId,
                                  String dimensionId,
                                  String keyName)
                           throws Exception
Specified by:
modifyDistinctEntryId in class EditProxy
Parameters:
fieldId -
newId -
rowId -
dimensionId -
keyName -
Throws:
Exception

modifyDistinctEntryValue

public void modifyDistinctEntryValue(String fieldId,
                                     long rowId,
                                     String newValue)
                              throws Exception
Specified by:
modifyDistinctEntryValue in class EditProxy
Parameters:
fieldId -
rowId -
newValue -
Throws:
Exception

replaceIds

public void replaceIds(String fieldId,
                       String oldId,
                       String newId)
                throws Exception
Specified by:
replaceIds in class EditProxy
Parameters:
fieldId - field id
oldId - old value id
newId - new value id
Throws:
Exception - -

replaceDistinctValue

public void replaceDistinctValue(String fieldId,
                                 String newValue,
                                 String oldValue)
                          throws Exception
Specified by:
replaceDistinctValue in class EditProxy
Parameters:
fieldId - field id
newValue - new value
oldValue - old value
Throws:
Exception - -

replaceDistinctIds

public void replaceDistinctIds(String fieldId,
                               String oldId,
                               String newId,
                               String keyName)
                        throws Exception
Specified by:
replaceDistinctIds in class EditProxy
Parameters:
fieldId - field id
oldValue - old value
newValue - new value
Throws:
Exception - -

getFieldLength

public int[] getFieldLength()
Overrides:
getFieldLength in class Edit
Returns:
a map of field and length

setFieldLength

public void setFieldLength(int[] fieldLength)
Parameters:
fieldLength - the field length

replaceEntryValueWithId

public void replaceEntryValueWithId(String oldValue,
                                    String newId,
                                    String fieldId)
                             throws Exception
Specified by:
replaceEntryValueWithId in class EditProxy
Parameters:
oldValue - old value
newId - new value id
fieldId - field id
Throws:
Exception - -

getDistinctErrors

public List<org.gcube.contentmanagement.timeseriesservice.stubs.ErrorPair> getDistinctErrors()
                                                                                      throws Exception
Specified by:
getDistinctErrors in class EditProxy
Returns:
Throws:
Exception

check

public long check()
           throws Exception
checks how many errors there will be in edit mode for a specific dimension setting

Specified by:
check in class Edit
Parameters:
dimensionId - dimension id
fieldId - field id
keyName - key name
Returns:
the error count
Throws:
Exception - -

getDimensionTable

public org.gcube.common.dbinterface.tables.SimpleTable getDimensionTable()
Returns:
the dimensionTable

replaceValue

public void replaceValue(int rowId,
                         Object value)
                  throws Exception
Specified by:
replaceValue in class EditProxy
Throws:
Exception

getPossibleValues

public String getPossibleValues(String word)
                         throws Exception
Specified by:
getPossibleValues in class EditProxy
Throws:
Exception

getTemporaryColumnDefinition

public org.gcube.contentmanagement.timeseriesservice.stubs.types.ColumnDefinition getTemporaryColumnDefinition(org.gcube.contentmanagement.timeseriesservice.stubs.types.ColumnDefinition oldColumnDefinition)
                                                                                                        throws Exception
Specified by:
getTemporaryColumnDefinition in class EditProxy
Throws:
Exception


Copyright © 2012. All Rights Reserved.