com.atlassian.jira.imports.config
Class ValueMappingHelperImpl

java.lang.Object
  extended by com.atlassian.jira.imports.config.ValueMappingHelperImpl
All Implemented Interfaces:
ValueMappingHelper

public class ValueMappingHelperImpl
extends Object
implements ValueMappingHelper


Field Summary
protected  DatabaseConnectionBean connectionBean
           
protected  Map mappingDefinitions
           
 
Fields inherited from interface com.atlassian.jira.imports.config.ValueMappingHelper
NULL_VALUE, VALUE_CONFIG_PREFIX
 
Constructor Summary
ValueMappingHelperImpl(DatabaseConnectionBean connectionBean, List mappingDefinitions)
           
 
Method Summary
 void copyFromProperties(org.apache.commons.configuration.PropertiesConfiguration configFile)
           
 void copyToNewProperties(org.apache.commons.configuration.PropertiesConfiguration configFile)
           
 Collection getAvailableFields()
          Return ValueMappingDefinition objects for each field that can have their values mapped
 Collection getDistinctValuesForField(String fieldName)
          Returns a collection of String objects representing a unique value of the field
 Collection getFieldsForValueMapping()
          Returns a collection of ValueMappingDefinition objects that have been selected for value mappings
 OrderableField getJiraField(String fieldName)
          Returns the JIRA field this field is being mapped to, if known
 Long getValueCountForField(String fieldName)
          Returns a count of the number of unique values for that field
 String getValueMapping(String fieldName, String value)
          Gets whatever value the field and value pair is mapped to.
 String getValueMappingFieldName(String fieldName, String value)
          Returns the HTML field name for the input area for a given field and value combination
 String getValueMappingForImport(String fieldName, String value)
          Gets whatever value the field and value pair is mapped to for import.
 boolean isMapValueForField(String fieldName)
          Returns wheteher or not the field has been selected for mapping
 void populateFieldForValueMappings(Map actionParams)
           
 void populateValueMappings(Map actionParams)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connectionBean

protected final DatabaseConnectionBean connectionBean

mappingDefinitions

protected final Map mappingDefinitions
Constructor Detail

ValueMappingHelperImpl

public ValueMappingHelperImpl(DatabaseConnectionBean connectionBean,
                              List mappingDefinitions)
Method Detail

getAvailableFields

public Collection getAvailableFields()
Description copied from interface: ValueMappingHelper
Return ValueMappingDefinition objects for each field that can have their values mapped

Specified by:
getAvailableFields in interface ValueMappingHelper
Returns:
List of ValueMappingDefinition. Never null

getValueCountForField

public Long getValueCountForField(String fieldName)
Description copied from interface: ValueMappingHelper
Returns a count of the number of unique values for that field

Specified by:
getValueCountForField in interface ValueMappingHelper
Returns:
Null if not calculated.

isMapValueForField

public boolean isMapValueForField(String fieldName)
Description copied from interface: ValueMappingHelper
Returns wheteher or not the field has been selected for mapping

Specified by:
isMapValueForField in interface ValueMappingHelper
Returns:
true if field is selected for mappping

populateFieldForValueMappings

public void populateFieldForValueMappings(Map actionParams)
Specified by:
populateFieldForValueMappings in interface ValueMappingHelper

getFieldsForValueMapping

public Collection getFieldsForValueMapping()
Description copied from interface: ValueMappingHelper
Returns a collection of ValueMappingDefinition objects that have been selected for value mappings

Specified by:
getFieldsForValueMapping in interface ValueMappingHelper
Returns:
Collection of ValueMappingDefinition. never null

getDistinctValuesForField

public Collection getDistinctValuesForField(String fieldName)
Description copied from interface: ValueMappingHelper
Returns a collection of String objects representing a unique value of the field

Specified by:
getDistinctValuesForField in interface ValueMappingHelper
Returns:
Collection of String. Never null

getValueMappingFieldName

public String getValueMappingFieldName(String fieldName,
                                       String value)
Description copied from interface: ValueMappingHelper
Returns the HTML field name for the input area for a given field and value combination

Specified by:
getValueMappingFieldName in interface ValueMappingHelper
Returns:
a HTML field name

getValueMapping

public String getValueMapping(String fieldName,
                              String value)
Description copied from interface: ValueMappingHelper
Gets whatever value the field and value pair is mapped to. ValueMappingHelper.NULL_VALUE if the field is to be cleared, blank if it is to be imported as-is.

Specified by:
getValueMapping in interface ValueMappingHelper
Returns:
String of the what the pair is mapped to

populateValueMappings

public void populateValueMappings(Map actionParams)
Specified by:
populateValueMappings in interface ValueMappingHelper

getJiraField

public OrderableField getJiraField(String fieldName)
Description copied from interface: ValueMappingHelper
Returns the JIRA field this field is being mapped to, if known

Specified by:
getJiraField in interface ValueMappingHelper
Returns:
OrderableField the field is mapping to. Null if unknown

copyFromProperties

public void copyFromProperties(org.apache.commons.configuration.PropertiesConfiguration configFile)
Specified by:
copyFromProperties in interface ValueMappingHelper

copyToNewProperties

public void copyToNewProperties(org.apache.commons.configuration.PropertiesConfiguration configFile)
Specified by:
copyToNewProperties in interface ValueMappingHelper

getValueMappingForImport

public String getValueMappingForImport(String fieldName,
                                       String value)
Description copied from interface: ValueMappingHelper
Gets whatever value the field and value pair is mapped to for import. That is, will return an empty string if the value is cleaered and the original value if no mapping is needed

Specified by:
getValueMappingForImport in interface ValueMappingHelper
Returns:
String of the what the pair is mapped to


Copyright © 2002-2007 Atlassian. All Rights Reserved.