Пример #1
0
 public function initSettings($pa_settings = null)
 {
     $va_settings = is_array($pa_settings) ? $pa_settings : array();
     $va_settings['refineries'] = array('formatType' => FT_TEXT, 'displayType' => DT_SELECT, 'width' => 40, 'height' => 6, 'takesLocale' => false, 'default' => '', 'options' => ca_data_importer_items::getAvailableRefineries(), 'label' => _t('Refineries'), 'description' => _t('Select the refinery that preforms the correct function to alter your data source as it maps to CollectiveAccess.'));
     $va_settings['original_values'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 10, 'takesLocale' => false, 'default' => '', 'label' => _t('Original values'), 'description' => _t('Return-separated list of values from the data source to be replaced.  For example photo is used in the data source, but photograph is used in CollectiveAccess.'));
     $va_settings['replacement_values'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 10, 'takesLocale' => false, 'default' => '', 'label' => _t('Replacement values'), 'description' => _t('Return-separated list of CollectiveAccess list item idnos that correspond to the mapped values from the original data source.  For example sound recording (entered in the Original values column) maps to audio_digital, which is entered here in the Replacement values column.'));
     $va_settings['skipGroupIfEmpty'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 10, 'takesLocale' => false, 'default' => 0, 'options' => array(_t('yes') => 1, _t('no') => 0), 'label' => _t('Skip group if empty'), 'description' => _t('Skip all of the elements in the group if value for this element is empty.  For example, a field called Description Type would be irrelevant if the Description field is empty.'));
     $va_settings['skipIfEmpty'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 10, 'takesLocale' => false, 'default' => 0, 'options' => array(_t('yes') => 1, _t('no') => 0), 'label' => _t('Skip mapping if empty'), 'description' => _t('Skip mapping if value for this element is empty.'));
     $va_settings['skipGroupIfValue'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 10, 'takesLocale' => false, 'default' => 0, 'label' => _t('Skip group if value'), 'description' => _t('Skip all of the elements in the group if value for this element is equal to the specified value(s).'));
     $va_settings['skipGroupIfNotValue'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 10, 'takesLocale' => false, 'default' => 0, 'label' => _t('Skip group if not value'), 'description' => _t('Skip all of the elements in the group if value for this element is not equal to any of the specified values(s).'));
     $va_settings['skipRowIfEmpty'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 10, 'takesLocale' => false, 'default' => 0, 'options' => array(_t('yes') => 1, _t('no') => 0), 'label' => _t('Skip row if empty'), 'description' => _t('Skip row if value for this element is empty.  For example, do not import the row if the Description field is empty.'));
     $va_settings['skipRowIfValue'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 10, 'takesLocale' => false, 'default' => 0, 'label' => _t('Skip row if value'), 'description' => _t('Skip the row if value for this element is equal to the specified value(s).'));
     $va_settings['skipRowIfNotValue'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 10, 'takesLocale' => false, 'default' => 0, 'label' => _t('Skip row if value is not'), 'description' => _t('Skip the row if value for this element is not equal to any of the specified value(s).'));
     $va_settings['skipGroupIfExpression'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 10, 'takesLocale' => false, 'default' => 0, 'label' => _t('Skip group if expression'), 'description' => _t('Skip all of the elements in the group if value for the expression is true.'));
     $va_settings['default'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 2, 'takesLocale' => false, 'default' => '', 'label' => _t('Default value'), 'description' => _t('Value to use if data source value is blank.'));
     $va_settings['delimiter'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 10, 'height' => 1, 'takesLocale' => false, 'default' => '', 'label' => _t('Delimiter'), 'description' => _t('Delimiter to split repeating values on.'));
     $va_settings['restrictToTypes'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 10, 'height' => 1, 'takesLocale' => false, 'default' => '', 'label' => _t('Restrict to types'), 'description' => _t('Restricts the the mapping to only records of the designated type.  For example the Duration field is only applicable to objects of the type moving_image and not photograph.'));
     $va_settings['prefix'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 10, 'height' => 1, 'takesLocale' => false, 'default' => '', 'label' => _t('Prefix'), 'description' => _t('Text to prepend to value prior to import.'));
     $va_settings['suffix'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 10, 'height' => 1, 'takesLocale' => false, 'default' => '', 'label' => _t('Suffix'), 'description' => _t('Text to append to value prior to import.'));
     $va_settings['formatWithTemplate'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 2, 'takesLocale' => false, 'default' => '', 'label' => _t('Format with template'), 'description' => _t('Format imported value with provided template. Template may include caret (^) prefixed placeholders that refer to data source values.'));
     $va_settings['maxLength'] = array('formatType' => FT_NUMBER, 'displayType' => DT_FIELD, 'width' => 10, 'height' => 1, 'takesLocale' => false, 'default' => '', 'label' => _t('Maximum length'), 'description' => _t('Truncate to specified length if value exceeds that length.'));
     $va_settings['errorPolicy'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 1, 'takesLocale' => false, 'default' => '', 'options' => array(_t('ignore') => "ignore", _t('stop') => "stop"), 'label' => _t('Error policy'), 'description' => _t('Determines how errors are handled for the mapping.  Options are to ignore the error, stop the import when an error is encountered and to receive a prompt when the error is encountered.'));
     $va_settings['relationshipType'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 2, 'takesLocale' => false, 'default' => '', 'label' => _t('Relationship type'), 'description' => _t('Relationship type to use when linking to a related record.'));
     $va_settings['convertNewlinesToHTML'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 2, 'takesLocale' => false, 'default' => '', 'label' => _t('Convert newlines to HTML'), 'description' => _t('Convert newline characters in text to HTML <BR/> tags.'));
     $this->SETTINGS = new ModelSettings($this, 'settings', $va_settings);
 }
 public function initSettings($pa_settings = null)
 {
     $va_settings = is_array($pa_settings) ? $pa_settings : array();
     $va_settings['refineries'] = array('formatType' => FT_TEXT, 'displayType' => DT_SELECT, 'width' => 40, 'height' => 6, 'takesLocale' => false, 'default' => '', 'options' => ca_data_importer_items::getAvailableRefineries(), 'label' => _t('Refineries'), 'description' => _t('Select the refinery that preforms the correct function to alter your data source as it maps to CollectiveAccess.'));
     $va_settings['original_values'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 10, 'takesLocale' => false, 'default' => '', 'label' => _t('Original values'), 'description' => _t('Return-separated list of values from the data source to be replaced.  For example photo is used in the data source, but photograph is used in CollectiveAccess.'));
     $va_settings['replacement_values'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 10, 'takesLocale' => false, 'default' => '', 'label' => _t('Replacement values'), 'description' => _t('Return-separated list of CollectiveAccess list item idnos that correspond to the mapped values from the original data source.  For example sound recording (entered in the Original values column) maps to audio_digital, which is entered here in the Replacement values column.'));
     $va_settings['skipIfEmpty'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 10, 'takesLocale' => false, 'default' => 0, 'options' => array(_t('yes') => 1, _t('no') => 0), 'label' => _t('Skip mapping if empty'), 'description' => _t('Skip mapping if value for this element is empty.'));
     $va_settings['skipIfValue'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 10, 'takesLocale' => false, 'default' => 0, 'label' => _t('Skip mapping if value'), 'description' => _t('Skip mapping if value for this element is equal to the specified value(s).'));
     $va_settings['skipIfNotValue'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 10, 'takesLocale' => false, 'default' => 0, 'label' => _t('Skip mapping if not value'), 'description' => _t('Skip mapping if value for this element is not equal to the specified value(s).'));
     $va_settings['skipIfExpression'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 10, 'takesLocale' => false, 'default' => 0, 'label' => _t('Skip if expression'), 'description' => _t('Skip mapping if value for the expression is true.'));
     $va_settings['skipGroupIfEmpty'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 10, 'takesLocale' => false, 'default' => 0, 'options' => array(_t('yes') => 1, _t('no') => 0), 'label' => _t('Skip group if empty'), 'description' => _t('Skip all of the elements in the group if value for this element is empty.  For example, a field called Description Type would be irrelevant if the Description field is empty.'));
     $va_settings['skipGroupIfValue'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 10, 'takesLocale' => false, 'default' => 0, 'label' => _t('Skip group if value'), 'description' => _t('Skip all of the elements in the group if value for this element is equal to the specified value(s).'));
     $va_settings['skipGroupIfNotValue'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 10, 'takesLocale' => false, 'default' => 0, 'label' => _t('Skip group if not value'), 'description' => _t('Skip all of the elements in the group if value for this element is not equal to any of the specified values(s).'));
     $va_settings['skipGroupIfExpression'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 10, 'takesLocale' => false, 'default' => 0, 'label' => _t('Skip group if expression'), 'description' => _t('Skip all of the elements in the group if value for the expression is true.'));
     $va_settings['skipRowIfEmpty'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 10, 'takesLocale' => false, 'default' => 0, 'options' => array(_t('yes') => 1, _t('no') => 0), 'label' => _t('Skip row if empty'), 'description' => _t('Skip row if value for this element is empty.  For example, do not import the row if the Description field is empty.'));
     $va_settings['skipRowIfValue'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 10, 'takesLocale' => false, 'default' => 0, 'label' => _t('Skip row if value'), 'description' => _t('Skip the row if value for this element is equal to the specified value(s).'));
     $va_settings['skipRowIfNotValue'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 10, 'takesLocale' => false, 'default' => 0, 'label' => _t('Skip row if value is not'), 'description' => _t('Skip the row if value for this element is not equal to any of the specified value(s).'));
     $va_settings['skipRowIfExpression'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 10, 'takesLocale' => false, 'default' => 0, 'label' => _t('Skip row if expression'), 'description' => _t('Skip the row if value for the expression is true.'));
     $va_settings['default'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 2, 'takesLocale' => false, 'default' => '', 'label' => _t('Default value'), 'description' => _t('Value to use if data source value is blank.'));
     $va_settings['delimiter'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 10, 'height' => 1, 'takesLocale' => false, 'default' => '', 'label' => _t('Delimiter'), 'description' => _t('Delimiter to split repeating values on.'));
     $va_settings['restrictToTypes'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 10, 'height' => 1, 'takesLocale' => false, 'default' => '', 'label' => _t('Restrict to types'), 'description' => _t('Restricts the the mapping to only records of the designated type.  For example the Duration field is only applicable to objects of the type moving_image and not photograph.'));
     $va_settings['prefix'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 10, 'height' => 1, 'takesLocale' => false, 'default' => '', 'label' => _t('Prefix'), 'description' => _t('Text to prepend to value prior to import.'));
     $va_settings['suffix'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 10, 'height' => 1, 'takesLocale' => false, 'default' => '', 'label' => _t('Suffix'), 'description' => _t('Text to append to value prior to import.'));
     $va_settings['formatWithTemplate'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 2, 'takesLocale' => false, 'default' => '', 'label' => _t('Format with template'), 'description' => _t('Format imported value with provided template. Template may include caret (^) prefixed placeholders that refer to data source values.'));
     $va_settings['applyRegularExpressions'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 4, 'takesLocale' => false, 'default' => '', 'label' => _t('Apply one or more regular expression-based substitutions to a soruce value prior to import.'), 'description' => _t('A list of Perl-compatible regular expressions. Each expression has two parts, a matching expression and a substitution expression, and is expressed as a JSON object with <em>match</em> and <em>replaceWith</em> keys. Ex. [{"match": "([\\d]+)\\.([\\d]+)", "replaceWith": "\\1:\\2"}, {"match": "[^\\d:]+", "replaceWith": ""}] '));
     $va_settings['maxLength'] = array('formatType' => FT_NUMBER, 'displayType' => DT_FIELD, 'width' => 10, 'height' => 1, 'takesLocale' => false, 'default' => '', 'label' => _t('Maximum length'), 'description' => _t('Truncate to specified length if value exceeds that length.'));
     $va_settings['errorPolicy'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 1, 'takesLocale' => false, 'default' => '', 'options' => array(_t('ignore') => "ignore", _t('stop') => "stop"), 'label' => _t('Error policy'), 'description' => _t('Determines how errors are handled for the mapping.  Options are to ignore the error, stop the import when an error is encountered and to receive a prompt when the error is encountered.'));
     $va_settings['relationshipType'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 2, 'takesLocale' => false, 'default' => '', 'label' => _t('Relationship type'), 'description' => _t('Relationship type to use when linking to a related record.'));
     $va_settings['convertNewlinesToHTML'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 2, 'takesLocale' => false, 'default' => '', 'label' => _t('Convert newlines to HTML'), 'description' => _t('Convert newline characters in text to HTML &lt;BR/&gt; tags.'));
     $va_settings['useAsSingleValue'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 2, 'takesLocale' => false, 'default' => '', 'label' => _t('Use as single value'), 'description' => _t('Force repeating values to be imported as a single value concatenated with the specified delimiter.'));
     $va_settings['matchOn'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 2, 'takesLocale' => false, 'default' => '', 'label' => _t('Match on'), 'description' => _t('List indicating sequence of checks for an existing record; values of array can be "label" and "idno". Ex. array("idno", "label") will first try to match on idno and then label if the first match fails.'));
     $va_settings['truncateLongLabels'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 1, 'takesLocale' => false, 'default' => '', 'label' => _t('Truncate long labels?'), 'description' => _t('Truncate preferred and non-preferred labels that exceed the maximum length to fit.'));
     $va_settings['lookahead'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 1, 'takesLocale' => false, 'default' => '0', 'label' => _t('Lookahead'), 'description' => _t('Number of rows ahead of the current row to pull value from.'));
     $va_settings['useParentAsSubject'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 2, 'takesLocale' => false, 'default' => '', 'label' => _t('Use parent as subject'), 'description' => _t('Import parent of subject instead of subject. This option is primarily useful when you are using a hierarchy builder refinery mapped to parent_id to create the entire hierarchy (including subject) and want the bottom-most level of the hierarchy to be the subject.'));
     $va_settings['treatAsIdentifiersForMultipleRows'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 2, 'takesLocale' => false, 'default' => '', 'label' => _t('Treat value as identifiers for multiple rows'), 'description' => _t('Explode value on delimiter and use as identifiers for multiple rows.'));
     $va_settings['displaynameFormat'] = array('formatType' => FT_TEXT, 'displayType' => DT_FIELD, 'width' => 40, 'height' => 2, 'takesLocale' => false, 'default' => '', 'label' => _t('Display name format'), 'description' => _t('Transform label using options for formatting entity display names. Default is to use value as is. Other options are surnameCommaForename, forenameCommaSurname, forenameSurname. See DataMigrationUtils::splitEntityName().'));
     $this->SETTINGS = new ModelSettings($this, 'settings', $va_settings);
 }