Scope

  • The XML Editor can export an XML configuration as used for YADE 1.11 to a compatible .ini format as used for YADE 1.10 and earlier.
  • The following examples have been created by use of the XML Editor

Prerequisites

The XML Editor feature for exporting compatible configuration files makes use of a Java based Plugin.

  • Use of this feature requires a Java Run-Time Environment starting from version 1.8 to be available.

Configuring the XML Editor

Activating the YADE Xml2Ini Converter Plugin

The XML Editor comes with a sub-folder plugins in the installation directory.

  • By default all Plugins that are deployed with this folder are available with the XML Editor. Therefore the Xml2Ini Converter is active by default.
  • Should the sub-folder plugins not be available, e.g. should this folder have been renamed, then you cannot use the conversion feature. 
  • If the Xml2Ini Converter is available then you can use the respective operation from the main menu and from the tab context menu.
    • The XML Editor shows a file dialog and suggests an .ini export file with the same basename as the current .xml configuration file.

Configuring the XML Editor for automated Conversion

The XML Editor comes with the feature to auto-save configuration files in the .ini format when saving to the .xml format, i.e. doing the conversion automatically.

  • To activate this feature adjust the check-box "Autosave ini file" to be checked. We recommend to use this feature if you want to create compatible .xml and .ini configuration files for YADE releases 1.10 and 1.11. 
    • This allows to manage configurations for YADE 1.11 in XML format and to have a parallel .ini file being created for use with YADE 1.10. Keeping both .xml and .ini configuration files in sync will allow a smooth migration to YADE 1.11 - as long as you would not manually modify the .ini file.
    • In autosave mode the .ini file will be overwritten whenever the .xml file is saved.
  • In addition you can enable desktop notifications to be created if a .ini file is being saved.

 

Assigning the YADE XSD Schema

When creating a new XML configuration file then the following dialog appears for schema assignment:

For YADE configuration files please assign the XSD Schema that matches your YADE release:

The schema will be accessed by the XML Editor when validating, saving and converting files. The following operations for schema assignment  for existing files are available from the tab context menu:

  • Reload schema: reload and apply the current XSD schema.
  • Reassign schema: open the assignment dialog and assign an XSD schema.

Examples

Getting Started

XML Configuration File: getting_started.xml
<?xml version="1.0" encoding="utf-8"?>
<Configurations xsi:noNamespaceSchemaLocation="http://www.sos-berlin.com/schema/yade/YADE_configuration_v1.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Fragments>
    <ProtocolFragments>
      <FTPFragment name="ftp_server_2_local">
        <BasicConnection>
          <Hostname><![CDATA[test.sos-berlin.com]]></Hostname>
          <Port>21</Port>
        </BasicConnection>
        <BasicAuthentication>
          <Account><![CDATA[demo]]></Account>
          <Password><![CDATA[demo]]></Password>
        </BasicAuthentication>
        <PassiveMode>true</PassiveMode>
      </FTPFragment>
      <SFTPFragment name="sftp_server_2_local_pass">
        <BasicConnection>
          <Hostname><![CDATA[test.sos-berlin.com]]></Hostname>
          <Port>22</Port>
        </BasicConnection>
        <SSHAuthentication>
          <Account><![CDATA[demo]]></Account>
          <AuthenticationMethodPassword>
            <Password><![CDATA[demo]]></Password>
          </AuthenticationMethodPassword>
        </SSHAuthentication>
      </SFTPFragment>
    </ProtocolFragments>
  </Fragments>
  <Profiles>
    <Profile profile_id="ftp_server_2_local">
      <Operation>
        <Copy>
          <CopySource>
            <CopySourceFragmentRef>
              <FTPFragmentRef ref="ftp_server_2_local" />
            </CopySourceFragmentRef>
            <SourceFileOptions>
              <Selection>
                <FileSpecSelection>
                  <FileSpec><![CDATA[.*]]></FileSpec>
                  <Directory><![CDATA[/]]></Directory>
                </FileSpecSelection>
              </Selection>
            </SourceFileOptions>
          </CopySource>
          <CopyTarget>
            <CopyTargetFragmentRef>
              <LocalTarget />
            </CopyTargetFragmentRef>
            <Directory><![CDATA[${USERPROFILE}\jade_demo\a]]></Directory>
            <TargetFileOptions>
              <DisableOverwriteFiles>false</DisableOverwriteFiles>
            </TargetFileOptions>
          </CopyTarget>
          <TransferOptions>
            <Transactional>true</Transactional>
          </TransferOptions>
        </Copy>
      </Operation>
    </Profile>
    <Profile profile_id="sftp_server_2_local_pass">
      <Operation>
        <Copy>
          <CopySource>
            <CopySourceFragmentRef>
              <SFTPFragmentRef ref="sftp_server_2_local_pass" />
            </CopySourceFragmentRef>
            <SourceFileOptions>
              <Selection>
                <FileSpecSelection>
                  <FileSpec><![CDATA[.*]]></FileSpec>
                  <Directory><![CDATA[/]]></Directory>
                </FileSpecSelection>
              </Selection>
            </SourceFileOptions>
          </CopySource>
          <CopyTarget>
            <CopyTargetFragmentRef>
              <LocalTarget />
            </CopyTargetFragmentRef>
            <Directory><![CDATA[${USERPROFILE}\jade_demo\a]]></Directory>
            <TargetFileOptions>
              <DisableOverwriteFiles>true</DisableOverwriteFiles>
            </TargetFileOptions>
          </CopyTarget>
          <TransferOptions>
            <Transactional>true</Transactional>
          </TransferOptions>
        </Copy>
      </Operation>
    </Profile>
  </Profiles>
</Configurations>
Flat File Configuration: getting_started.ini
[protocol_fragment_ftp@ftp_server_2_local]
protocol                            = ftp
host                                = test.sos-berlin.com
port                                = 21
user                                = demo
password                            = demo
passive_mode                        = true

[protocol_fragment_sftp@sftp_server_2_local_pass]
protocol                            = sftp
host                                = test.sos-berlin.com
port                                = 22
user                                = demo
ssh_auth_method                     = password
password                            = demo

[profile@ftp_server_2_local]
operation                           = copy
source_include                      = protocol_fragment_ftp@ftp_server_2_local
file_spec                           = .*
source_dir                          = /
target_protocol                     = local
target_host                         = localhost
target_dir                          = ${USERPROFILE}\jade_demo\a
overwrite_files                     = true
transactional                       = true

[profile@sftp_server_2_local_pass]
operation                           = copy
source_include                      = protocol_fragment_sftp@sftp_server_2_local_pass
file_spec                           = .*
source_dir                          = /
target_protocol                     = local
target_host                         = localhost
target_dir                          = ${USERPROFILE}\jade_demo\a
overwrite_files                     = false
transactional                       = true

Simple File Selection

XML Configuration: simple_file_selection.xml
<?xml version="1.0" encoding="utf-8"?>
<Configurations xsi:noNamespaceSchemaLocation="http://www.sos-berlin.com/schema/yade/YADE_configuration_v1.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Fragments>
    <ProtocolFragments>
      <SFTPFragment name="sftp_test">
        <BasicConnection>
          <Hostname><![CDATA[test.sos-berlin.com]]></Hostname>
          <Port><![CDATA[22]]></Port>
        </BasicConnection>
        <SSHAuthentication>
          <Account><![CDATA[demo]]></Account>
          <AuthenticationMethodPassword>
            <Password><![CDATA[demo]]></Password>
          </AuthenticationMethodPassword>
        </SSHAuthentication>
      </SFTPFragment>
    </ProtocolFragments>
  </Fragments>
  <Profiles>
    <Profile profile_id="sftp_server_2_local_select_recursive">
      <Operation>
        <Copy>
          <CopySource>
            <CopySourceFragmentRef>
              <SFTPFragmentRef ref="sftp_test" />
            </CopySourceFragmentRef>
            <SourceFileOptions>
              <Selection>
                <FileSpecSelection>
                  <FileSpec><![CDATA[^test_.\.txt$]]></FileSpec>
                  <Directory><![CDATA[/rec]]></Directory>
                  <Recursive><![CDATA[true]]></Recursive>
                </FileSpecSelection>
              </Selection>
            </SourceFileOptions>
          </CopySource>
          <CopyTarget>
            <CopyTargetFragmentRef>
              <LocalTarget />
            </CopyTargetFragmentRef>
            <Directory><![CDATA[${USERPROFILE}\jade_demo\a]]></Directory>
          </CopyTarget>
        </Copy>
      </Operation>
    </Profile>
  </Profiles>
</Configurations>
Flat File Configuration: simple_file_selection.ini
[protocol_fragment_sftp@sftp_server_2_local_select_recursive]
protocol                            = sftp
host                                = test.sos-berlin.com
port                                = 22
user                                = demo
ssh_auth_method                     = password
password                            = demo

[protocol_fragment_sftp@sftp_server_2_local_zero_byte]
protocol                            = sftp
host                                = test.sos-berlin.com
port                                = 22
user                                = demo
ssh_auth_method                     = password
password                            = demo

[profile@sftp_server_2_local_select_recursive]
operation                           = copy
source_include                      = protocol_fragment_sftp@sftp_server_2_local_select_recursive
file_spec                           = ^test_.\.txt$
source_dir                          = /rec
recursive                           = true
target_protocol                     = local
target_host                         = localhost
target_dir                          = ${USERPROFILE}\jade_demo\a
overwrite_files                     = false

[profile@sftp_server_2_local_zero_byte]
operation                           = copy
source_include                      = protocol_fragment_sftp@sftp_server_2_local_zero_byte
file_spec                           = ^test_[0-9]\.txt$
source_dir                          = /
zero_byte_transfer                  = relaxed
target_protocol                     = local
target_host                         = localhost
target_dir                          = ${USERPROFILE}\jade_demo\a

More Advanced File Selection

XML Configuration: more_advanced_file_selection.xml
<?xml version="1.0" encoding="utf-8"?>
<Configurations xsi:noNamespaceSchemaLocation="http://www.sos-berlin.com/schema/yade/YADE_configuration_v1.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Fragments>
    <ProtocolFragments>
      <SFTPFragment name="sftp_server_2_local_poll_minfiles">
        <BasicConnection>
          <Hostname><![CDATA[test.sos-berlin.com]]></Hostname>
          <Port>22</Port>
        </BasicConnection>
        <SSHAuthentication>
          <Account><![CDATA[demo]]></Account>
          <AuthenticationMethodPassword>
            <Password><![CDATA[demo]]></Password>
          </AuthenticationMethodPassword>
        </SSHAuthentication>
      </SFTPFragment>
    </ProtocolFragments>
  </Fragments>
  <Profiles>
    <Profile profile_id="sftp_server_2_local_poll_minfiles">
      <Operation>
        <Copy>
          <CopySource>
            <CopySourceFragmentRef>
              <SFTPFragmentRef ref="sftp_server_2_local_poll_minfiles" />
            </CopySourceFragmentRef>
            <SourceFileOptions>
              <Selection>
                <FileSpecSelection>
                  <FileSpec><![CDATA[^test_[0-9]\.txt$]]></FileSpec>
                  <Directory><![CDATA[/]]></Directory>
                </FileSpecSelection>
              </Selection>
              <Polling>
                <PollInterval>20</PollInterval>
                <PollTimeout>1</PollTimeout>
                <MinFiles>5</MinFiles>
                <PollingServer>false</PollingServer>
                <PollForever>false</PollForever>
              </Polling>
            </SourceFileOptions>
          </CopySource>
          <CopyTarget>
            <CopyTargetFragmentRef>
              <LocalTarget />
            </CopyTargetFragmentRef>
            <Directory><![CDATA[${USERPROFILE}\jade_demo\a]]></Directory>
          </CopyTarget>
        </Copy>
      </Operation>
    </Profile>
  </Profiles>
</Configurations>
Flat File Configuration: more_advanced_file_selection.ini
[protocol_fragment_sftp@sftp_server_2_local_poll_minfiles]
protocol                            = sftp
host                                = test.sos-berlin.com
port                                = 22
user                                = demo
ssh_auth_method                     = password
password                            = demo

[profile@sftp_server_2_local_poll_minfiles]
operation                           = copy
source_include                      = protocol_fragment_sftp@sftp_server_2_local_poll_minfiles
file_spec                           = ^test_[0-9]\.txt$
source_dir                          = /
poll_interval                       = 20
poll_timeout                        = 1
poll_minfiles                       = 5
polling_server                      = false
polling_server_poll_forever         = false
target_protocol                     = local
target_host                         = localhost
target_dir                          = ${USERPROFILE}\jade_demo\a

File Transfer

XML Configuration: file_transfer.xml
<?xml version="1.0" encoding="utf-8"?>
<Configurations>
  <Fragments>
    <ProtocolFragments>
      <SFTPFragment name="sftp_server_2_local_cumulate">
        <BasicConnection>
          <Hostname><![CDATA[test.sos-berlin.com]]></Hostname>
          <Port>22</Port>
        </BasicConnection>
        <SSHAuthentication>
          <Account><![CDATA[demo]]></Account>
          <AuthenticationMethodPassword>
            <Password><![CDATA[demo]]></Password>
          </AuthenticationMethodPassword>
        </SSHAuthentication>
      </SFTPFragment>
    </ProtocolFragments>
  </Fragments>
  <Profiles>
    <Profile profile_id="replace_local_datestamp">
      <Operation>
        <Copy>
          <CopySource>
            <CopySourceFragmentRef>
              <LocalSource>
                <Rename>
                  <ReplaceWhat><![CDATA[^(test)(_)[0-9]\.txt]]></ReplaceWhat>
                  <ReplaceWith><![CDATA[file_;[date:yyyy-MM-dd]_]]></ReplaceWith>
                </Rename>
              </LocalSource>
            </CopySourceFragmentRef>
            <SourceFileOptions>
              <Selection>
                <FileSpecSelection>
                  <FileSpec><![CDATA[^test_[0-9]\.txt$]]></FileSpec>
                  <Directory><![CDATA[${USERPROFILE}\jade_demo\a]]></Directory>
                </FileSpecSelection>
              </Selection>
            </SourceFileOptions>
          </CopySource>
          <CopyTarget>
            <CopyTargetFragmentRef>
              <LocalTarget />
            </CopyTargetFragmentRef>
            <Directory><![CDATA[${USERPROFILE}\jade_demo\b]]></Directory>
          </CopyTarget>
        </Copy>
      </Operation>
    </Profile>
    <Profile profile_id="sftp_server_2_local_cumulate">
      <Operation>
        <Copy>
          <CopySource>
            <CopySourceFragmentRef>
              <SFTPFragmentRef ref="sftp_server_2_local_cumulate" />
            </CopySourceFragmentRef>
            <SourceFileOptions>
              <Selection>
                <FileSpecSelection>
                  <FileSpec><![CDATA[^test_.\.txt$]]></FileSpec>
                  <Directory><![CDATA[/]]></Directory>
                </FileSpecSelection>
              </Selection>
            </SourceFileOptions>
          </CopySource>
          <CopyTarget>
            <CopyTargetFragmentRef>
              <LocalTarget />
            </CopyTargetFragmentRef>
            <Directory><![CDATA[${USERPROFILE}\jade_demo\a]]></Directory>
            <TargetFileOptions>
              <CumulateFiles>
                <CumulativeFileSeparator><![CDATA[--- File: %{SourceFileName} ---]]></CumulativeFileSeparator>
                <CumulativeFilename><![CDATA[text-files.txt]]></CumulativeFilename>
              </CumulateFiles>
            </TargetFileOptions>
          </CopyTarget>
        </Copy>
      </Operation>
    </Profile>
  </Profiles>
</Configurations>
Flat File Configuration: file_transfer.ini
[protocol_fragment_sftp@sftp_server_2_local_cumulate]
protocol                            = sftp
host                                = test.sos-berlin.com
port                                = 22
user                                = demo
ssh_auth_method                     = password
password                            = demo

[profile@replace_local_datestamp]
operation                           = copy
source_protocol                     = local
source_host                         = localhost
replacing                           = ^(test)(_)[0-9]\.txt
replacement                         = file_;[date:yyyy-MM-dd]_
file_spec                           = ^test_[0-9]\.txt$
source_dir                          = ${USERPROFILE}\jade_demo\a
target_protocol                     = local
target_host                         = localhost
target_dir                          = ${USERPROFILE}\jade_demo\b

[profile@sftp_server_2_local_cumulate]
operation                           = copy
source_include                      = protocol_fragment_sftp@sftp_server_2_local_cumulate
file_spec                           = ^test_.\.txt$
source_dir                          = /
target_protocol                     = local
target_host                         = localhost
target_dir                          = ${USERPROFILE}\jade_demo\a
cumulate_files                      = true
cumulative_file_separator           = --- File: %{SourceFileName} ---
cumulative_file_name                = text-files.txt

Checking Files for Completenss

XML Configuration: checking_files_for_completeness.xml
<?xml version="1.0" encoding="utf-8"?>
<Configurations xsi:noNamespaceSchemaLocation="http://www.sos-berlin.com/schema/yade/YADE_configuration_v1.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Fragments>
    <ProtocolFragments>
      <SFTPFragment name="sftp_server_2_local_atomic">
        <BasicConnection>
          <Hostname><![CDATA[test.sos-berlin.com]]></Hostname>
          <Port>22</Port>
        </BasicConnection>
        <SSHAuthentication>
          <Account><![CDATA[demo]]></Account>
          <AuthenticationMethodPassword>
            <Password><![CDATA[demo]]></Password>
          </AuthenticationMethodPassword>
        </SSHAuthentication>
      </SFTPFragment>
    </ProtocolFragments>
  </Fragments>
  <Profiles>
    <Profile profile_id="local_2_local_create_md5">
      <Operation>
        <Copy>
          <CopySource>
            <CopySourceFragmentRef>
              <LocalSource />
            </CopySourceFragmentRef>
            <SourceFileOptions>
              <Selection>
                <FileSpecSelection>
                  <FileSpec><![CDATA[^test_[0-9]\.txt$]]></FileSpec>
                  <Directory><![CDATA[${USERPROFILE}\jade_demo\a]]></Directory>
                </FileSpecSelection>
              </Selection>
            </SourceFileOptions>
          </CopySource>
          <CopyTarget>
            <CopyTargetFragmentRef>
              <LocalTarget />
            </CopyTargetFragmentRef>
            <Directory><![CDATA[${USERPROFILE}\jade_demo\b]]></Directory>
            <TargetFileOptions>
              <CheckIntegrityHash>
                <CreateIntegrityHashFile>true</CreateIntegrityHashFile>
              </CheckIntegrityHash>
            </TargetFileOptions>
          </CopyTarget>
        </Copy>
      </Operation>
    </Profile>
    <Profile profile_id="local_2_local_check_md5">
      <Operation>
        <Copy>
          <CopySource>
            <CopySourceFragmentRef>
              <LocalSource />
            </CopySourceFragmentRef>
            <SourceFileOptions>
              <Selection>
                <FileSpecSelection>
                  <FileSpec><![CDATA[^test_[0-9]\.txt$]]></FileSpec>
                  <Directory><![CDATA[${USERPROFILE}\jade_demo\a]]></Directory>
                </FileSpecSelection>
              </Selection>
            </SourceFileOptions>
          </CopySource>
          <CopyTarget>
            <CopyTargetFragmentRef>
              <LocalTarget />
            </CopyTargetFragmentRef>
            <Directory><![CDATA[${USERPROFILE}\jade_demo\b]]></Directory>
            <TargetFileOptions>
              <CheckIntegrityHash />
            </TargetFileOptions>
          </CopyTarget>
        </Copy>
      </Operation>
    </Profile>
    <Profile profile_id="sftp_server_2_local_atomic">
      <Operation>
        <Copy>
          <CopySource>
            <CopySourceFragmentRef>
              <SFTPFragmentRef ref="sftp_server_2_local_atomic" />
            </CopySourceFragmentRef>
            <SourceFileOptions>
              <Selection>
                <FileSpecSelection>
                  <FileSpec><![CDATA[^test_large_1\.txt$]]></FileSpec>
                  <Directory><![CDATA[/large/]]></Directory>
                </FileSpecSelection>
              </Selection>
            </SourceFileOptions>
          </CopySource>
          <CopyTarget>
            <CopyTargetFragmentRef>
              <LocalTarget />
            </CopyTargetFragmentRef>
            <Directory><![CDATA[${USERPROFILE}\jade_demo\a]]></Directory>
            <TargetFileOptions>
              <Atomicity>
                <AtomicPrefix><![CDATA[~]]></AtomicPrefix>
                <AtomicSuffix><![CDATA[~]]></AtomicSuffix>
              </Atomicity>
            </TargetFileOptions>
          </CopyTarget>
        </Copy>
      </Operation>
    </Profile>
    <Profile profile_id="local_2_local_check_steady_state">
      <Operation>
        <Copy>
          <CopySource>
            <CopySourceFragmentRef>
              <LocalSource />
            </CopySourceFragmentRef>
            <SourceFileOptions>
              <Selection>
                <FileSpecSelection>
                  <FileSpec><![CDATA[^test_large_1\.txt$]]></FileSpec>
                  <Directory><![CDATA[${USERPROFILE}\jade_demo\a]]></Directory>
                </FileSpecSelection>
              </Selection>
              <CheckSteadyState>
                <CheckSteadyStateInterval>2</CheckSteadyStateInterval>
                <CheckSteadyStateCount>10</CheckSteadyStateCount>
              </CheckSteadyState>
            </SourceFileOptions>
          </CopySource>
          <CopyTarget>
            <CopyTargetFragmentRef>
              <LocalTarget />
            </CopyTargetFragmentRef>
            <Directory><![CDATA[${USERPROFILE}\jade_demo\b]]></Directory>
          </CopyTarget>
        </Copy>
      </Operation>
    </Profile>
  </Profiles>
</Configurations>
Flat File Configuration: checking_files_for_completeness.ini
[protocol_fragment_sftp@sftp_server_2_local_atomic]
protocol                            = sftp
host                                = test.sos-berlin.com
port                                = 22
user                                = demo
ssh_auth_method                     = password
password                            = demo


[profile@local_2_local_create_md5]
operation                           = copy
source_protocol                     = local
source_host                         = localhost
file_spec                           = ^test_[0-9]\.txt$
source_dir                          = ${USERPROFILE}\jade_demo\a
target_protocol                     = local
target_host                         = localhost
target_dir                          = ${USERPROFILE}\jade_demo\b
check_security_hash                 = true
create_security_hash_file           = true


[profile@local_2_local_check_md5]
operation                           = copy
source_protocol                     = local
source_host                         = localhost
file_spec                           = ^test_[0-9]\.txt$
source_dir                          = ${USERPROFILE}\jade_demo\a
target_protocol                     = local
target_host                         = localhost
target_dir                          = ${USERPROFILE}\jade_demo\b
check_security_hash                 = true


[profile@sftp_server_2_local_atomic]
operation                           = copy
source_include                      = protocol_fragment_sftp@sftp_server_2_local_atomic
file_spec                           = ^test_large_1\.txt$
source_dir                          = /large/
target_protocol                     = local
target_host                         = localhost
target_dir                          = ${USERPROFILE}\jade_demo\a
atomic_prefix                       = ~
atomic_suffix                       = ~


[profile@local_2_local_check_steady_state]
operation                           = copy
source_protocol                     = local
source_host                         = localhost
file_spec                           = ^test_large_1\.txt$
source_dir                          = ${USERPROFILE}\jade_demo\a
check_steady_state_of_files         = true
check_steady_state_interval         = 2
steady_state_count                  = 10
target_protocol                     = local
target_host                         = localhost
target_dir                          = ${USERPROFILE}\jade_demo\b
  • No labels