org.gcube.contentmanagement.codelistmanager.managers
Class CodeListCuration

java.lang.Object
  extended by org.gcube.common.dbinterface.persistence.ObjectStateControl
      extended by org.gcube.contentmanagement.codelistmanager.managers.CodeListCuration

public class CodeListCuration
extends org.gcube.common.dbinterface.persistence.ObjectStateControl


Field Summary
protected  String agencyId
           
protected  String codeListImportId
           
protected  CodeListType codelistType
           
protected  Calendar creationDate
           
protected  String description
           
protected  String id
           
protected  boolean isFinal
           
protected  Hashtable<String,TableField> labelFieldMapping
           
protected  Calendar lastModifyDate
           
protected  String name
           
protected  org.gcube.common.dbinterface.tables.SimpleTable table
           
protected  float version
           
 
Constructor Summary
CodeListCuration()
           
CodeListCuration(String name, String description, String agencyId, boolean isFinal, float version)
           
CodeListCuration(String name, String description, String agencyId, boolean isFinal, float version, CodeListType type)
           
 
Method Summary
 void changeColumnType(String fieldId, TableField.ColumnType columnType, String... codelistReferenceId)
           
static void destroy(String id)
           
static CodeListCuration get(String id)
           
 String getAgencyId()
           
static Iterator<CodeListCuration> getAll()
           
 String getCodeListImportId()
           
 CodeListType getCodelistType()
           
 int getCount()
           
 Calendar getCreationDate()
           
 Iterator<List<String>> getData()
           
 String getDescription()
           
 List<String> getFieldsIdByColumnType(TableField.ColumnType columnType)
           
protected  CodeListCurationHandler getHandler()
           
 String getId()
           
 Integer[] getInvalidRows(String fieldId, ColumnReference columnDefinition)
           
 Integer[] getInvalidRows(String fieldId, org.gcube.common.dbinterface.types.Type type)
           
 Hashtable<String,TableField> getLabelFieldMapping()
           
 Calendar getLastModifyDate()
           
 String getName()
           
 Iterator<List<String>> getRowsData(Integer... rowsIds)
           
 org.gcube.common.dbinterface.tables.SimpleTable getTable()
           
 String getTableName()
           
 float getVersion()
           
 boolean isFinal()
           
 boolean isMappingFinished()
           
 boolean remove()
           
 boolean removeColumn(String fieldId)
           
 boolean removeRows(int... rowsId)
           
 void replaceValue(String fieldId, String newValue, int row)
           
 void setAgencyId(String agencyId)
           
 void setCodelistType(CodeListType codelistType)
           
 void setDescription(String description)
           
 void setFinal(boolean isFinal)
           
 void setLabelFieldMapping(Hashtable<String,TableField> labelFieldMapping)
           
 void setName(String name)
           
 void setVersion(float version)
           
 boolean start(CodeListImport importManager)
           
 boolean store()
           
 void updateCount()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected String id

labelFieldMapping

protected Hashtable<String,TableField> labelFieldMapping

agencyId

protected String agencyId

name

protected String name

description

protected String description

creationDate

protected Calendar creationDate

lastModifyDate

protected Calendar lastModifyDate

isFinal

protected boolean isFinal

version

protected float version

codelistType

protected CodeListType codelistType

codeListImportId

protected String codeListImportId

table

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

CodeListCuration

public CodeListCuration()

CodeListCuration

public CodeListCuration(String name,
                        String description,
                        String agencyId,
                        boolean isFinal,
                        float version,
                        CodeListType type)

CodeListCuration

public CodeListCuration(String name,
                        String description,
                        String agencyId,
                        boolean isFinal,
                        float version)
Method Detail

getId

public String getId()
Returns:
the id

getHandler

protected CodeListCurationHandler getHandler()

getTable

public org.gcube.common.dbinterface.tables.SimpleTable getTable()
Returns:
the table

getCount

public int getCount()
Returns:
the count

updateCount

public void updateCount()

getVersion

public float getVersion()
Returns:
the version

setVersion

public void setVersion(float version)
Parameters:
version - the version to set

setAgencyId

public void setAgencyId(String agencyId)
Parameters:
agencyId - the agencyId to set

setFinal

public void setFinal(boolean isFinal)
Parameters:
isFinal - the isFinal to set

getCodelistType

public CodeListType getCodelistType()
Returns:
the codelistType

setCodelistType

public void setCodelistType(CodeListType codelistType)
Parameters:
codelistType - the codelistType to set

isFinal

public boolean isFinal()
Returns:
the isFinal

getCodeListImportId

public String getCodeListImportId()
Returns:
the codeListImportId

getCreationDate

public Calendar getCreationDate()
Returns:
the creationDate

getLastModifyDate

public Calendar getLastModifyDate()
Returns:
the lastModified

getAgencyId

public String getAgencyId()
Returns:
the agencyId

getLabelFieldMapping

public Hashtable<String,TableField> getLabelFieldMapping()
Returns:
the labelFieldMapping

setLabelFieldMapping

public void setLabelFieldMapping(Hashtable<String,TableField> labelFieldMapping)
Parameters:
labelFieldMapping - the labelFieldMapping to set

getTableName

public String getTableName()
Returns:
the tableName

getName

public String getName()
Returns:
the name

setName

public void setName(String name)
Parameters:
name - the name to set

getDescription

public String getDescription()
Returns:
the description

setDescription

public void setDescription(String description)
Parameters:
description - the description to set

start

public boolean start(CodeListImport importManager)
Parameters:
importManager -
parent -
fieldsMask -
Returns:

getFieldsIdByColumnType

public List<String> getFieldsIdByColumnType(TableField.ColumnType columnType)

removeColumn

public boolean removeColumn(String fieldId)
Parameters:
fieldId -
Returns:

removeRows

public boolean removeRows(int... rowsId)
Parameters:
rowsId -
Returns:

getData

public Iterator<List<String>> getData()
                               throws Exception
Returns:
Throws:
Exception

getRowsData

public Iterator<List<String>> getRowsData(Integer... rowsIds)
                                   throws Exception
Parameters:
rowsIds -
Returns:
Throws:
Exception

store

public boolean store()

remove

public boolean remove()
Returns:

isMappingFinished

public boolean isMappingFinished()
Returns:

getAll

public static Iterator<CodeListCuration> getAll()
                                         throws Exception
Returns:
Throws:
Exception

get

public static CodeListCuration get(String id)
                            throws Exception
Parameters:
id -
Returns:
Throws:
Exception

destroy

public static void destroy(String id)
                    throws Exception
Parameters:
id -
Throws:
Exception

changeColumnType

public void changeColumnType(String fieldId,
                             TableField.ColumnType columnType,
                             String... codelistReferenceId)
                      throws Exception
Throws:
Exception

getInvalidRows

public Integer[] getInvalidRows(String fieldId,
                                ColumnReference columnDefinition)
                         throws Exception
Throws:
Exception

getInvalidRows

public Integer[] getInvalidRows(String fieldId,
                                org.gcube.common.dbinterface.types.Type type)
                         throws Exception
Throws:
Exception

replaceValue

public void replaceValue(String fieldId,
                         String newValue,
                         int row)
                  throws Exception
Throws:
Exception


Copyright © 2013. All Rights Reserved.