org.gcube.contentmanagement.timeseriesservice.impl.curation.state
Class CurationResource

java.lang.Object
  extended by GCUBEWSResource
      extended by org.gcube.contentmanagement.timeseriesservice.impl.curation.state.CurationResource

public class CurationResource
extends GCUBEWSResource


Field Summary
static java.lang.String ID_COLUMN_SUFFIX
           
 
Constructor Summary
CurationResource()
           
 
Method Summary
 java.util.Iterator<Rule> applyableRules(java.lang.String fieldId)
           
 java.util.Iterator<Rule> applyedRules(java.lang.String fieldID)
           
 void applyRules(RuleItem[] rules, java.lang.String fieldId)
           
 long checkDimension(java.lang.String dimensionId, java.lang.String fieldId, java.lang.String keyId)
          checks how many errors there will be in edit mode for a specific dimension setting
 long checkRules(java.lang.String fieldId, FilterCondition[] filters)
          checks how many errors there will be in edit mode for applying a specific rule
 long checkTypeChange(java.lang.String fieldId, Type newType)
          checks how many errors there will be in edit mode for applying a specific rule
 void closeEditing()
          allows user to exit from edit mode
 ColumnDefinition columnInEditMode()
          returns which column is actually in edit mode
 void editColumn(java.lang.String fieldId, Type type)
          allows user to enter in edit mode for type checking
 void editDimension(java.lang.String fieldId, java.lang.String codelistId, java.lang.String keyId)
          allows user to enter in edit mode form dimension checking
 void editRules(java.lang.String fieldId)
          allows user to enter in edit mode for rules checking
 ColumnDefinition[] getColumnDefinition()
           
 long getCount(boolean onlyErrors)
          returns the count entries for this resource
 java.lang.String getDataAsJson(Select query, boolean onlyErrors)
          returns the entries of the resource as JSon
 Edit getFieldEditor()
           
 java.util.Map<java.lang.String,int[]> getFieldLenght()
           
 CurationHistory getHistory()
           
 java.lang.String getId()
          Returns the id.
 ImportResource getImportResource()
          retrieves the import resource
 State getInitializeEditingState()
           
 java.lang.String getPossibleValues(java.lang.String word)
           
 java.lang.String[] getPropertyNames()
          
 java.lang.String getSourceId()
           
 java.lang.String getSourceName()
           
 SimpleTable getTable()
           
 java.lang.String getTitle()
           
 long getTotalLine()
           
 State getUnderCreationState()
           
 GuessDimensionArray guess(java.lang.String fieldId)
          perform the guessing for a selected field id
 boolean isUnderEdit()
           
 void modifyEntryId(java.lang.String fieldId, java.lang.String newId, long rowId)
           
 void modifyEntryValue(java.lang.String fieldId, java.lang.String newValue, long rowId)
           
 void remove()
          
 void removeAllErrors()
          remove all the rows with wrong field (only in edit mode)
 void removeAllRules(java.lang.String fieldId)
           
 void removeColumn(java.lang.String fieldId)
          removes a column
 void removeError(long rowId)
          remove a row with a wrong field (only in edit mode)
 void replaceById(java.lang.String oldId, java.lang.String newId, java.lang.String fieldId)
           
 void replaceByValue(java.lang.String oldValue, java.lang.String newValue, java.lang.String fieldId)
           
 void saveColumnDefinition()
           
 void setColumn(EntryType columnType, java.lang.String fieldId)
           
 void setColumnDefinition(ColumnDefinition[] columnDefinition)
           
 void setFieldEditor(Edit fieldEditor)
           
 void setFieldLenght(java.util.Map<java.lang.String,int[]> fieldLenght)
           
 void setHistory(CurationHistory history)
           
 void setId(java.lang.String id)
           
 void setLabel(java.lang.String fieldId, java.lang.String label)
           
 void setProperties(java.lang.String title, java.lang.String description, java.lang.String publisher, java.lang.String rights)
           
 void setSourceId(java.lang.String sourceId)
           
 void setSourceName(java.lang.String sourceName)
           
 void setTable(SimpleTable table)
           
 void setTitle(java.lang.String title)
           
 void setTotalLine(int totalLine)
          sets the total resource entries number
 void setUnderCreationState(State underCreationState)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID_COLUMN_SUFFIX

public static final java.lang.String ID_COLUMN_SUFFIX
See Also:
Constant Field Values
Constructor Detail

CurationResource

public CurationResource()
Method Detail

getPropertyNames

public java.lang.String[] getPropertyNames()


getImportResource

public ImportResource getImportResource()
                                 throws org.globus.wsrf.NoSuchResourceException,
                                        org.globus.wsrf.ResourceException
retrieves the import resource

Returns:
a Import Resource
Throws:
org.globus.wsrf.NoSuchResourceException - -
org.globus.wsrf.ResourceException - -

editDimension

public void editDimension(java.lang.String fieldId,
                          java.lang.String codelistId,
                          java.lang.String keyId)
                   throws java.lang.Exception
allows user to enter in edit mode form dimension checking

Parameters:
fieldId - field id
dimensionId - dimension id
keyName - key name
Throws:
java.lang.Exception - -

editRules

public void editRules(java.lang.String fieldId)
               throws java.lang.Exception
allows user to enter in edit mode for rules checking

Parameters:
fieldId - field id
dimensionId - dimension id
keyName - key name
Throws:
java.lang.Exception - -

editColumn

public void editColumn(java.lang.String fieldId,
                       Type type)
                throws java.lang.Exception
allows user to enter in edit mode for type checking

Parameters:
fieldId - field id
dimensionId - dimension id
keyName - key name
Throws:
java.lang.Exception - -

getCount

public long getCount(boolean onlyErrors)
              throws java.lang.Exception
returns the count entries for this resource

Parameters:
onlyErrors - if true returns only the wrong entries
Returns:
the count
Throws:
java.lang.Exception - -

getDataAsJson

public java.lang.String getDataAsJson(Select query,
                                      boolean onlyErrors)
                               throws java.lang.Exception
returns the entries of the resource as JSon

Parameters:
query - the query
onlyErrors - true if the user wants only the wrong entry
Returns:
the String as JSon
Throws:
java.lang.Exception - -

getId

public java.lang.String getId()
                       throws org.globus.wsrf.ResourceException
Returns the id.

Returns:
the id.
Throws:
org.globus.wsrf.ResourceException

getSourceId

public java.lang.String getSourceId()
                             throws org.globus.wsrf.ResourceException
Returns:
Throws:
org.globus.wsrf.ResourceException

getSourceName

public java.lang.String getSourceName()
                               throws org.globus.wsrf.ResourceException
Returns:
Throws:
org.globus.wsrf.ResourceException

getTitle

public java.lang.String getTitle()
                          throws org.globus.wsrf.ResourceException
Returns:
Throws:
org.globus.wsrf.ResourceException

setTitle

public void setTitle(java.lang.String title)
              throws org.globus.wsrf.ResourceException
Parameters:
id -
Throws:
org.globus.wsrf.ResourceException

setId

public void setId(java.lang.String id)
           throws org.globus.wsrf.ResourceException
Parameters:
id -
Throws:
org.globus.wsrf.ResourceException

setSourceId

public void setSourceId(java.lang.String sourceId)
                 throws org.globus.wsrf.ResourceException
Parameters:
sourceId -
Throws:
org.globus.wsrf.ResourceException

setSourceName

public void setSourceName(java.lang.String sourceName)
                   throws org.globus.wsrf.ResourceException
Parameters:
sourceName -
Throws:
org.globus.wsrf.ResourceException

getTable

public SimpleTable getTable()
Returns:

isUnderEdit

public boolean isUnderEdit()
Returns:

getFieldEditor

public Edit getFieldEditor()
Returns:

setFieldEditor

public void setFieldEditor(Edit fieldEditor)
Parameters:
fieldEditor -

getColumnDefinition

public ColumnDefinition[] getColumnDefinition()
Returns:

setColumnDefinition

public void setColumnDefinition(ColumnDefinition[] columnDefinition)
Parameters:
columnDefinition -

saveColumnDefinition

public void saveColumnDefinition()
                          throws java.lang.Exception
Throws:
java.lang.Exception

guess

public GuessDimensionArray guess(java.lang.String fieldId)
                          throws java.lang.Exception
perform the guessing for a selected field id

Parameters:
fieldId - field id
limit - the query limit
Returns:
the Dimension Array
Throws:
java.lang.Exception - -

setLabel

public void setLabel(java.lang.String fieldId,
                     java.lang.String label)
              throws java.lang.Exception
Parameters:
fieldId - field id
label - the label
type - the type
Throws:
java.lang.Exception - -

remove

public void remove()


getUnderCreationState

public State getUnderCreationState()

setUnderCreationState

public void setUnderCreationState(State underCreationState)
Parameters:
underCreationState -

getFieldLenght

public java.util.Map<java.lang.String,int[]> getFieldLenght()
Returns:

setFieldLenght

public void setFieldLenght(java.util.Map<java.lang.String,int[]> fieldLenght)
Parameters:
fieldLenght -

getInitializeEditingState

public State getInitializeEditingState()
                                throws java.lang.Exception
Returns:
a state
Throws:
java.lang.Exception - -

setColumn

public void setColumn(EntryType columnType,
                      java.lang.String fieldId)
               throws java.lang.Exception
Parameters:
columnType - column type
fieldId - field id
dataType - data type
Throws:
java.lang.Exception - -

replaceById

public void replaceById(java.lang.String oldId,
                        java.lang.String newId,
                        java.lang.String fieldId)
                 throws java.lang.Exception
Parameters:
oldId - old id
newId - new id
fieldId - field id
Throws:
java.lang.Exception - -

replaceByValue

public void replaceByValue(java.lang.String oldValue,
                           java.lang.String newValue,
                           java.lang.String fieldId)
                    throws java.lang.Exception
Parameters:
oldValue - old value
newValue - new value
fieldId - field id
Throws:
java.lang.Exception - -

columnInEditMode

public ColumnDefinition columnInEditMode()
                                  throws java.lang.Exception
returns which column is actually in edit mode

Returns:
the column definition
Throws:
java.lang.Exception - -

getTotalLine

public long getTotalLine()
Returns:
the total entries count

setTotalLine

public void setTotalLine(int totalLine)
sets the total resource entries number

Parameters:
totalLine -

removeColumn

public void removeColumn(java.lang.String fieldId)
                  throws java.lang.Exception
removes a column

Parameters:
fieldId - the field id
Throws:
java.lang.Exception - -

checkDimension

public long checkDimension(java.lang.String dimensionId,
                           java.lang.String fieldId,
                           java.lang.String keyId)
                    throws java.lang.Exception
checks how many errors there will be in edit mode for a specific dimension setting

Parameters:
dimensionId - dimension id
fieldId - field id
keyName - key name
Returns:
the error count
Throws:
java.lang.Exception - -

checkRules

public long checkRules(java.lang.String fieldId,
                       FilterCondition[] filters)
                throws java.lang.Exception
checks how many errors there will be in edit mode for applying a specific rule

Parameters:
fieldId - field id
filters - list of the filter representing the applied rules
Returns:
the error count
Throws:
java.lang.Exception - -

checkTypeChange

public long checkTypeChange(java.lang.String fieldId,
                            Type newType)
                     throws java.lang.Exception
checks how many errors there will be in edit mode for applying a specific rule

Parameters:
fieldId - field id
filters - list of the filter representing the applied rules
Returns:
the error count
Throws:
java.lang.Exception - -

closeEditing

public void closeEditing()
                  throws java.lang.Exception
allows user to exit from edit mode

Throws:
java.lang.Exception - -

modifyEntryValue

public void modifyEntryValue(java.lang.String fieldId,
                             java.lang.String newValue,
                             long rowId)
                      throws java.lang.Exception
Parameters:
fieldId - field id
newValue - new value
rowId - row id
Throws:
GCUBEFault - -
java.lang.Exception

getPossibleValues

public java.lang.String getPossibleValues(java.lang.String word)
                                   throws java.lang.Exception
Throws:
java.lang.Exception

modifyEntryId

public void modifyEntryId(java.lang.String fieldId,
                          java.lang.String newId,
                          long rowId)
                   throws java.lang.Exception
Parameters:
fieldId - field id
newId - new id
rowId - row id
Throws:
GCUBEFault - -
java.lang.Exception

removeAllErrors

public void removeAllErrors()
                     throws java.lang.Exception
remove all the rows with wrong field (only in edit mode)

Throws:
java.lang.Exception - -

removeError

public void removeError(long rowId)
                 throws java.lang.Exception
remove a row with a wrong field (only in edit mode)

Parameters:
rowId - the row id
Throws:
java.lang.Exception - -

getHistory

public CurationHistory getHistory()

setHistory

public void setHistory(CurationHistory history)

setTable

public void setTable(SimpleTable table)

applyRules

public void applyRules(RuleItem[] rules,
                       java.lang.String fieldId)
                throws java.lang.Exception
Throws:
java.lang.Exception

applyedRules

public java.util.Iterator<Rule> applyedRules(java.lang.String fieldID)
                                      throws java.lang.Exception
Throws:
java.lang.Exception

applyableRules

public java.util.Iterator<Rule> applyableRules(java.lang.String fieldId)
                                        throws java.lang.Exception
Throws:
java.lang.Exception

removeAllRules

public void removeAllRules(java.lang.String fieldId)
                    throws java.lang.Exception
Throws:
java.lang.Exception

setProperties

public void setProperties(java.lang.String title,
                          java.lang.String description,
                          java.lang.String publisher,
                          java.lang.String rights)
                   throws java.lang.Exception
Throws:
java.lang.Exception