• User's guide
  • API
Search Results for

    Show / Hide Table of Contents
    • Concepts
    • Installation
    • Configuration
      • Overview
      • License
      • Datasources
      • Configuration
      • Plug-Ins
      • Codepages
      • Environment Variables
      • Include files
      • Example
    • Jobs
      • Jobs
      • Include
      • Multi-Threaded Jobs
      • Tracking Jobs
    • Tasks
      • Overview
      • Copy Check
      • Excel
      • File Compare
      • File Copy
      • File Dump
      • File Edit
      • File Format
      • Foreach
      • Generate
      • IMS/DB Data Conversion
      • JCL Submit
      • Listcat
      • Log
      • Powershell
      • Set Environment Variable
      • Sql
      • Stored Procedure Compare
      • Table Compare
      • Table Copy
      • Table Load
      • Table Scan
      • Table Unload
      • User Script
    • Layouts
      • Overview
      • XML Definition
      • COBOL Definition
      • Field data Types
    • Extensibility
      • Extending Ianus
      • Column Comparators
      • Column Converters
      • Record Comparators
      • File Editors
      • User Script
      • Record Layout Match Class
      • Column Layout Match Class
      • User Fields
      • Codepages
      • Resources
    • Usage
      • Command Line
      • Monitors
      • Programmatically
      • Unit Testing
    • Known Issues
    • Disclaimers

    Codepages

    Ianus implements a pluggable resource mechanism. Resources are global data items to be used by user plugins.

    Resources can be of the following types:

    • string
    • list
    • dictionary

    Definition

    Resources can be defined in the Ianus configuration, in the resources element as well as in a job with the task resource. Both configuration elements and resource task share the same syntax.

    The element resource defines a resource. A resource has the following attribute:

    Attribute Type Purpose Default
    name string Name of the resource
    type string Type of the resource (list, dictionary, string) string
    overwrite bool If set to true, the definition overwrites pre-existimg ones false

    The element item defines a resource item.

    Usage

    Resources can be accessed using Environment.Resources dictionary.

    Examples

    Resource definition in configuration

    	<resources>
    		<resource name="Dict01" type="dictionary">
    			<item key="01">Elem 01</item>
    			<item key="02">Elem 02</item>
    		</resource>
    		<resource name="ListA" type="list">
    			<item>String 1</item>
    			<item>String 2</item>
    			<item>String 3</item>
    		</resource>
    		<resource name="Stringazza" type="string">I am a string</resource>
    		<include>%IANUS_HOME%\Test\Config\IDCARD_RULES.xml</include>
    	</resources>
    

    Resource definition in a job

    <job>
    	<resource name="Dict02" type="dictionary" overwrite="false">
    		<item key="A">Elem A</item>
    		<item key="B">Elem B</item>
    	</resource>
    </job>
    
    ### Accessing the resource
    ```cs
    		public void Initialize(HPE.Ianus.Environment e, Task t, string name, Codepage cp)
            {
                Patterns = (List<string>)Env.Resources["IDCARD_VALID_PATTERNS"];
                Rules = (Dictionary<string, string>)Env.Resources["IDCARD_INVALID_RULES"];
            }
    
    In This Article
    Back to top Copyright 2021 - Hewlett-Packard Enterprise