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:
java.io.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
 
Constructor Summary
DimensionEditor(java.lang.String resourceId, java.lang.String fieldId, java.lang.String codelistId, java.lang.String keyId, 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
 java.lang.String getCodelistId()
           
 SimpleTable getDimensionTable()
           
 java.lang.String getDimensionTableNameHuman()
          returns the table name human readable
 java.util.List<ErrorPair> getDistinctErrors()
           
 java.lang.String getFieldId()
           
 int[] getFieldLength()
           
 java.lang.String getKeyId()
           
 Type getKeyType()
           
 java.lang.String getPossibleValues(java.lang.String word)
           
 org.gcube.contentmanagement.timeseriesservice.stubs.ColumnDefinition getTemporaryColumnDefinition(org.gcube.contentmanagement.timeseriesservice.stubs.ColumnDefinition oldColumnDefinition)
           
 void internalInitialize(DBSession session)
          initializes the Field Editor
 void modifyDistinctEntryId(java.lang.String fieldId, java.lang.String newId, long rowId, java.lang.String dimensionId, java.lang.String keyName)
           
 void modifyDistinctEntryValue(java.lang.String fieldId, long rowId, java.lang.String newValue)
           
 void modifyEntryId(java.lang.String fieldId, java.lang.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(java.lang.String fieldId, java.lang.String oldId, java.lang.String newId, java.lang.String keyName)
           
 void replaceDistinctValue(java.lang.String fieldId, java.lang.String newValue, java.lang.String oldValue)
           
 void replaceEntryValueWithId(java.lang.String oldValue, java.lang.String newId, java.lang.String fieldId)
           
 void replaceIds(java.lang.String fieldId, java.lang.String oldId, java.lang.String newId)
           
 void replaceValue(int rowId, java.lang.Object value)
           
 void setCodelistId(java.lang.String codelistId)
          sets the dimension id
 void setDimensionTableNameHuman(java.lang.String dimensionTableNameHuman)
          sets the dimension table name human
 void setFieldLength(int[] fieldLength)
           
 void setKeyName(java.lang.String keyId)
          sets the key name
 void setKeyType(Type keyType)
          set the key type
 
Methods inherited from class org.gcube.contentmanagement.timeseriesservice.impl.editing.Edit
dismiss, errorCount, getEditorType, getHistoryItems, getIsUnderInitialization, getResultAsJson, initialize, removeAllErrors, removeSingleError, save, setHistoryItems, setIsUnderInitialization, totalCount
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DimensionEditor

public DimensionEditor(java.lang.String resourceId,
                       java.lang.String fieldId,
                       java.lang.String codelistId,
                       java.lang.String keyId,
                       SimpleTable resourceTable,
                       int[] fieldlength,
                       int resourceTableCount,
                       boolean withoutErrors)
                throws java.lang.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:
java.lang.Exception - -
Method Detail

internalInitialize

public void internalInitialize(DBSession session)
                        throws java.lang.Exception
initializes the Field Editor

Throws:
java.lang.Exception

getFieldId

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

getKeyType

public Type getKeyType()
Returns:
the key type

setKeyType

public void setKeyType(Type keyType)
set the key type

Parameters:
keyType - key type to set

getKeyId

public java.lang.String getKeyId()
Returns:
the key name

setKeyName

public void setKeyName(java.lang.String keyId)
sets the key name

Parameters:
keyName - key name to set

getCodelistId

public java.lang.String getCodelistId()
Returns:
the dimension id

setCodelistId

public void setCodelistId(java.lang.String codelistId)
sets the dimension id

Parameters:
dimensionId - dimension id

getDimensionTableNameHuman

public java.lang.String getDimensionTableNameHuman()
returns the table name human readable

Returns:
the table name

setDimensionTableNameHuman

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

Parameters:
dimensionTableNameHuman - the table name

modifyEntryId

public void modifyEntryId(java.lang.String fieldId,
                          java.lang.String newId,
                          long rowId)
                   throws java.lang.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:
java.lang.Exception - -

modifyDistinctEntryId

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

modifyDistinctEntryValue

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

replaceIds

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

replaceDistinctValue

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

replaceDistinctIds

public void replaceDistinctIds(java.lang.String fieldId,
                               java.lang.String oldId,
                               java.lang.String newId,
                               java.lang.String keyName)
                        throws java.lang.Exception
Specified by:
replaceDistinctIds in class EditProxy
Parameters:
fieldId - field id
oldValue - old value
newValue - new value
Throws:
java.lang.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(java.lang.String oldValue,
                                    java.lang.String newId,
                                    java.lang.String fieldId)
                             throws java.lang.Exception
Specified by:
replaceEntryValueWithId in class EditProxy
Parameters:
oldValue - old value
newId - new value id
fieldId - field id
Throws:
java.lang.Exception - -

getDistinctErrors

public java.util.List<ErrorPair> getDistinctErrors()
                                            throws java.lang.Exception
Specified by:
getDistinctErrors in class EditProxy
Returns:
Throws:
java.lang.Exception

check

public long check()
           throws java.lang.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:
java.lang.Exception - -

getDimensionTable

public SimpleTable getDimensionTable()
Returns:
the dimensionTable

replaceValue

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

getPossibleValues

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

getTemporaryColumnDefinition

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