
Usage: data_share [-u=<user_id> -p=<password> -g=<group>]
             -f={ send | publish | unpublish | delete_pubrec | register |
                  unregister | delete_exprec | list_ods | check_ods |
                  list_pub_info | find_duplicates | list_remote_co |
                  list_replica_co | cancel_remote_co | cancel_replica_co |
                  remote_import }
             [-site=<remote site name1> -site=<remote site name2> ...]
             [-owning_user=<remote user> -owning_group=<remote group>]
             {-item_id=<item id | template> | -key=<item key> | -folder=<folder name> |
               -name=<wso name> || -filename=<file name> | -itemKeysFile=<item key file> | 
               -itemRevisionKeysFile=<item revs key file }
             { -class=<wso class name> || -classoffile=<class name>]
             [ -include=<relation type1> -include=<relation type2> ...]
             [ -exclude=<relation type1> -exclude=<relation type2> ...]
             [{-<revision selector> | -rev=<rev id>}] [-include_bom]
             [-transfer] [-attach] [-exclude_files] [-latest_ds_version]
             [-exclude_folder_contents] [-include_bc] [-include_supersedures] 
             [-include_pfmembers] [-include_pftemplates] [-pf_bom_treatment=<option>]
             [-continue_on_error] [-batch_size=<number of objects per batch>]
             [-report=<report file> [-user<user id> -group=<group_name>]
             [-error_file=<error file>] [-exclude_variant_options]
             [-batch_variant_options] [-h]
             [-batch_objects(bo)=<Class for deferredobjects comma seperated list>]
             [-batch_file(bof)=<file name for deferredobjects >]
             [-include_dist_comp] [-log] 
             [-checkpoint] [-transaction_id=<transaction id>] 
             [-status] [-cleanup_transaction(ct)] [-restart] [-commit_ixr] [-list_transactions] [-h]
             [-compress_ind_files(cif)=<Compress mode> {S | I | N}]

Where: (NOTE: Entries in parentheses are acceptable abbreviations)
   -u=<user_id>                i-man user ID. If the i-man user ID given
                               is for a privileged user, BYPASS privilege will
                               be set; otherwise, BYPASS will not be set so
                               only those objects accessible to the user will
                               be processed.
   -p=<password>               i-man password associated with the -u=<user_id> 
   -g=<group>                  i-man group associated with the -u=<user_id> 
   -f=<function>               Function to perform where <function> is one
                               the following:
      send                     Sends object(s) to the given remote site(s).
      publish(pub)             Publishes object(s) to the given ODS site(s).
      unpublish(unp)           Unpublishes object(s) from the given ODS site(s).
      delete_pubrec(dpr)       Deletes Publication Record for the the given
                               object from the local database. This MUST
                               be run at the ODS site containing the
                               Publication Record to be deleted.
                               Must be privileged user to use this function.
                               Requires -item_id switch with specific item id;
                               no wild cards and no other switches are
                               supported with this function.
                               NOTE: To be used only if the master object
                               has been deleted but Publication Record
                               still exists at the ODS.
      delete_exprec(dxr)       Deletes export record(s) for the given site(s)
                               for objects listed in the text file identified
                               by the -filename and -classoffile switches.
                               Does NOT traverse item structure. Must be
                               privileged user to use this function.
                               NOTE: To be used only as a last resort after
                               attempting to delete export records via the
                               tc_sync verify function.
      list_ods(lo)             Lists the authorized ODS sites which consists
                               of the default ODS site and the sites
                               included in the site preference named
                               ODS_publication_sites
      check_ods(co)            Lists the availability of authorized ODS sites.
      list_pub_info(lpi)       Lists publication information about objects
                               Must be run at the owning site.

      register(reg)            Registers Item Ids to Central Item Id Registry
      unregister(unreg)        Unregisters Item Ids to Central Item Id Registry
                               The register and unregister function must be
                               supplied with the -item_id or the -filename
                               option.

      find_duplicates(fd)      Compares all the item ids at a remote site
                               specified with the -site switch. The item ids
                               searched for may be filtered with the -item_id,
                               -created_after and -created_before switches.
                               The output may be directed to a file with the
                               -report switch. The output is formatted to csv
                               style, i.e. comma separated values

      list_remote_co(lremco)   Lists all objects that are checked out by a
                               remote user based on the given user, group and
                               site. If no user, group or site is given,
                               then all remote check outs will be listed.
                               List is output to stdout and includes
                               information about the reserving user.
      list_replica_co(lrepco)  Lists all replica objects that are checked out
                               at the local site based on the given user, group
                               and remote site. If no user, group or site is
                               is given, then all replica check outs will be
                               listed. List is output to stdout and includes
                               information about the reserving user.
      cancel_remote_co(cremco) Cancels remote check outs on locally owned
                               objects based on the given user, group and
                               site. If no user, group or site is given,
                               then all remote check outs will be canceled.
                               NOTE: Should be run at the owning site only.
      cancel_replica_co(crepco) Cancels check outs on replica objects based
                               on the given user, group and owning site
                               site. If no user, group or site is given,
                               then all replica check outs will be canceled.
                               NOTE: Should be run at replicating site only.
      remote_import(ri)          Imports object(s) from the given remote site(s).
   -item_id(item)=<template>   Item ID or template of item(s) to process.
                               Mutually exclusive with -folder, -filename, -key, -itemKeysFile,
                               -itemRevisionKeysFile and -name switches. Required for delete_pubrec
                               function.
   -key=<item key>             Item Key for the item. Mutually exclusive with
                               -folder, -filename, -item_id, -name,
                               -itemKeysFile, and -itemRevisionKeysFile.
   -folder(fl)=<folder name>   Name of i-man folder which contains list
                               of objects to process. Mutually exclusive
                               with -name, -filename and -item_id switches
   -name=<wso name>            Name of single Workspace Object to process.
                               If not an item, use -class switch for the
                               object's class. Mutually exclusive with
                               -folder, -filename and -item_id switches
   -filename(fn)=<file name>   Name of input file  with list of IDs or names
                               of objects to process. File entries are
                               treated as IDs for Items and ItemRevisions
                               and as names for other classes.
                               of objects to process. Mutually exclusive
                               with -name, -folder, -item_id, -key, -itemKeysFile,
                               -itemRevisionKeysFile switches. If
                               input file contains names, the -classoffile
                               switch is required.
   -itemKeysFile=<file name>   Name of input file  with list of Item key strings
                               of Items to process.  Mutually exclusive
                               with -name, -folder, -item_id, -key, -filename,
                               -itemRevisionKeysFile switches.
   -itemRevisionKeysFile=<file name>   Name of input file  with list of ItemRevision key strings
                               of ItemRevisions to process.  Mutually exclusive
                               with -name, -folder, -item_id, -key, -filename,
                               -itemKeysFile switches.
   -rev=<rev id>               Id of specific item revision to be sent to
                               remote site. Valid only with -item_id switch
                               and with the send function. Mutually 
                               exclusive with revision selectors.
   -class(cl)=<class>          The i-man class of the object whose name is
                               given in the -name switch. This option is valid
                               only with the -name option; default is Item.
   -classoffile(cof)=<class>   The i-man class of the objects whose ID or name
                               are listed in the file. This option to be used
                               only with the -filename option; default is Item.
                               Required if input file has names instead of IDs.
   -site=<remote site name>      Name of remote site(s) to send/publish to or.
                                 remote import from. Can be given multiple times
                                 in command line except for import operation.
   -owning_user(ou)=<user id>  User id of user at remote site(s) to send
                               the objects to. The given user will own the
                               objects being sent. See Help Note 1.
   -owning_group(og)=<group>   Name of group at remote site(s) to send
                               objects to. The given group will own
                               the objects being sent. See Help Note 1.
   -include=<relation type>    Includes relation type. This can be given
                               multiple times in command line. Use database
                               name (not display name) of the relation type.
   -exclude=<relation type>    Excludes relation type. This can be given
                               multiple times in command line. Use database
                               name (not display name) of the relation type.
   -exclude_files(exf)         Excludes dataset files.
   -latest_ds_version(ldv)     Sends only the latest version of Datasets.
   -include_bom(bom)           Includes assembly components when sending or
                               publishing/unpublishing. Note that a revision
                               selector is needed when publishing or
                               unpublishing an assembly; if no revision
                               selector is given, latest_revision will be
                               used as the default. When sending, the default
                               selector is all_revisions.
   -transfer(tf)               Transfers site ownership when sending objects.
   -attach(att)                When sending an attachment with transfer of
                               site ownership, this will attach the object
                               to the appropriate parent item or revision
                               at the receiving site. Use this for situations
                               where you attach a Dataset to a replica such
                               as a JT file and you want to send the JT
                               file to the owning site with transfer of
                               site ownership and attached to the appropriate
                               parent item or revision.
   -<revision selector>        Identifies the item revision(s) to send. Also
                               used as revision rule for identifying components
                               when processing assemblies. When used with
                               -include_bom while publishing/unpublishing,
                               it is used to determine which revision's BVR
                               to follow in traversing the assembly tree.
                               The valid revision selectors are:
                               -all_revisions      Send all revisions;
                                                   not valid when publishing
                               -latest_revision    Process only the latest
                                                   revision regardless of 
                                                   release status. This is
                                                   the default if no revision
                                                   selector is given when
                                                   publishing/unpublishing
                               -selected_revision  Process only the selected
                                                     revision 
                               -latest_working     Process only the latest
                                                   working revision >
                               -latest_released    Process only the latest
                                                   released revision with any 
                                                   release status >
                               -latest_working_or_any
                                                   Process only the latest
                                                   working revision. If there 
                                                   is none, then process
                                                   the latest released. >
                               -release_status=<release status type>
                                                   Process only the latest
                                                   released revision with the 
                                                   given release status >
                               -all_released_revs  Send all revisions
                                                   with a release status;
                                                   not valid when publishing.
   -batch_size(bs)=<number>    Number of objects per batch; a new process
                               will be created per batch. Default batch
                               size is 1000. Must be a positive integer.
                               This is most useful when processing thousands
                               of objects as it helps in avoiding memory
                               and disk space shortage problems.
   -exclude_folder_contents(efc) Excludes the contents of folders that are
                               being exported.
   -include_bc(ibc)            Identifies the BomChange objects associated with
                               the affected assemblies to send. This option
                               should be used in conjunction with the
                               -include_bom option.
   -include_supersedures(iss)  Identifies the Supersedure objects associated
                               with the BomChanges to send. This option should
                               be used in conjunction with -include_bc option.
   -include_pfmembers(ipfm)    Identifies the NX part family members
                               associated with the part family template to send
   -include_pftemplates(ipft)  Identifies the NX part family template
                               corresponding to the part family members to send
   -pf_bom_treatment(pfbom)    Indentifies the NX part family targets to send
                               along with the assembly. The valid values are:
                               members, templates, both, none. This option
                               should be used in conjunction with the
                               -include_bom option.
   -continue_on_error(con)     Continue if there is an error on an optional
                               object such as a reference or manifestation;
                               not valid when transferring site ownership
   -report(rep)=<file name>    Output report to given file name.
   -created_after=<date>       Restrict find_duplicates search to items created
                               at the target site after specified date.
   -created_before=<date>      Restrict find_duplicates search to items created
                               at the target site before specified date.
                               System default date format is dd-mon-yyyy,
                               e.g. 04-Jul-2003
   -user=<user id>             User id to be used in remote and replica
                               checkout-related operations.
   -group=<group name>         Group name to be used in remote and replica
                               checkout-related operations.
   -error_file(err)=<file name> Output error report to given file name in case of
                               sending assemblies.
   -exclude_variant_options(evo) Excludes all variant options during a send operation
   -batch_variant_options(bvo) Sends all variant options separately in batch mode
                                 mode.
   -include_dist_comp(idc)       Includes distributed components during import.
                                 This option should be used in conjunction with 
                                 -remote_import option
                                 This option is valid only in conjunction
                                 with -remote_import option
   -log                          Log detailed information in log file.
   -checkpoint(cp)               Enable Check Pointing .
   -transaction_id(trid)=<transaction id> 
   -cleanup_transaction(ct)      Delete the directory structure for the given 
                                 transaction at local site and remote sites 
                                 Also delete the checkpoint dataset(if still around)
   -list_transactions(lt)        List all transactions 
   -commit_ixr(cmi)              Commit (Create/Update) IXRs
   -restart(rs)                  Restart the transaction
   -status(stat)                 Display the status of transaction
   -compress_ind_files(cif)      Compress mode to be used in checkpointing 
                                   Valid values are ('S'|'I'|'N') 
                                   S(Single file)- Produces single zip file 
                                   I(Individual file)- Produces multiple zip files 
   -batch_objects(bo)=<class(s)> Sends all objects of the given class(s) 
                                 separately in batch mode. Separate each class
                                 name with a comma. List should have no spaces.
   -batch_file(bof)=<file name>  Sends all objects of the class(s) in the given
                                 file separately in batch mode. List each class
                                 name separately on a line in the file.
IMPORTANT NOTES 
 
List of Supported Class for deferredobjects : VariantExpression , 
                                              NamedVariantExpression , 
                                              PSOccurrence , 
                                              ImanRelation , 
                                              Form , 
                                              Dataset , 
                                              Folder , 
                                              MEAppearancePathNode , 
                                              VariantExpressionBlock . 
   -h                          Display help information.

Special usage: data_share -f=rpcping -host=<remote host>
             [-prognum=<rpc program number>] [-versnum=<rpc version number] [-timeout=<client timeout>]
             [-portnum=<port number>]

Where: "data_share -f=rpcping ..." calls the RPC server NULLPROC, no client or server side login

   -host=<remote host>             Remote host where RPC server is running.
   -prognum=<rpc program number>   RPC program number
                                   The default is 536875586, the default RPC program number for the IDSM.
   -versnum=<rpc version number>   RPC version number (defaults to 1).
   -timeout=<client timeout>       RPC client timeout for the ping (defaults to 30 seconds).
   -portnum=<port number>          Port number RPC server is listening on.
                                   The default is to query the portmapper on the remote host.


This utility is primarily intended to help during the initial setup of a
Multi-Site network. However, it can also be used on a day-to-basis to
facilitate the sharing of data between sites.

It is especially helpful in setting up and maintaining a Hub Configuration.


Examples: (Note that required login information are intentionally omitted)

1. To send a list of items specified in a text file and output a report;
   continue processing if a non-fatal error is found:

   data_share -f=send -filename=my_list.txt -site=Site1 -report=rep.txt -coe

2. To transfer ownership of a given item:

   data_share -f=send -transfer -item_id=item123 -site=Site1

3. To publish an assembly item and all its components using the latest revision
   rule to determine components:

   data_share -f=publish -item_id=Engine100 -site=Ods1 -include_bom

4. To publish an assembly item and all its components using the latest released
   revision rule to determine components:

   data_share -f=publish -item_id=Item1 -site=Ods1 -include_bom -latest_released

5. To unpublish an assembly item and all its components from multiple ODS sites
   and using the default revision rule 'latest revision':

   data_share -f=unpublish -item_id=Item1 -site=Ods1 -site=Ods2 -include_bom

6. To delete a Publication Record in the local database. NOTE: Use this only
   if master object has been deleted but the Publication Record still exists.

   data_share -f=delete_pubrec -item_id=ObsoleteItem1

7. To list the authorized ODS sites:

   data_share -f=list_ods

8. To check availability of the authorized ODS sites:

   data_share -f=check_ods

9. To get publication information about a list of objects in a folder:

   data_share -f=list_pub_info -folder=myFolder

10. To send an item to a specific remote user and group:

   data_share -f=send -item_id=xyz -site=Site1 -owning_user=joe -owning_group=eng

11. When publishing thousands of items and you get errors after publishing
   several hundreds or even thousands of items, reduce the batch size:

   data_share -f=publish -item_id=A* -site=Site1 -batch_size=200


12. To publish an Engineering Change object and all its associated change objects:

   data_share -f=publish -item_id=CR0001 -site=Ods1 -include_bom -include_bc -include_supersedures

13. To send an Engineering Change object and all its associated change objects:

   data_share -f=send -item_id=CR0001 -site=Ods1 -include_bom -include_bc -include_supersedures

14. To register a Item Id to the Central Item Id Registry:

   data_share -f=register -item_id=myItem

15. To find duplicate item ids at another site:

   data_share -f=find_duplicates -item_id=00* -site=Site1

16. To list all objects that are checked out by remote users:

   data_share -f=list_remote_co

17. To list all objects that are checked out by user justin at Site2:

   data_share -f=list_remote_co -user=justin -site=Site2

18. To cancel all checked outs by user joseph at Site2:

   data_share -f=cancel_remote_co -user=joseph -site=Site2

19. To list all replica objects that are checked out by local group engg

   from remote site Site1:

   data_share -f=list_replica_co -site=Site1

20. To cancel all replica objects that are checked out by user davis from Site1:

   data_share -f=cancel_replica_co -user=davis -site=Site1

21. To cancel remote checkout on a given item:

   data_share -f=cancel_remote_co -item_id=item123

22. To cancel remote checkouts on the datasets listed in the file dataset.lst:

   data_share -f=cancel_remote_co -filename=dataset.lst -class=Dataset

23. To cancel replica checkouts on the datasets in uniquely named folder:

   data_share -f=cancel_replica_co -folder=unique_folder_xyz

24. To exclude all variant options during a send operation:

   data_share -f=send -item_id=CR0002 -site=remote1 -exclude_variant_options

25. To batch send all variant options during a send operation:

   data_share -f=send -item_id=CR0002 -site=remote1 -batch_variant_options -batch_size=10000

26. To batch send one or more classes of objects during a send operation:

   data_share -f=send -item_id=CR0002 -site=remote1 -batch_objects=class1,class2 -batch_size=10000

27. To batch send one or more classes of objects given in a text file during a send operation:

   data_share -f=send -item_id=CR0002 -site=remote1 -batch_file=my_list.txt -batch_size=10000

28. To remote import a given item and retrive distributed component from remote site:

    data_share -f=remote_import -include_dist_comp -item_id=item123 -site=Site1

29. To remote import the item stored on a file as Tagstrings 

    data_share -f=ri -classoffile=Tagstring -filename=uid_report.txt 

30. To enable the check point for transaction 

    data_share -f=send -item_id=CP001 -site=Site1 -cp 


Notes:
   1. When sending objects to a specific user and/or group at a remote  
      site via the -owning_user and -owning_group switches, the following
      rules apply: 
      a. If both the given user and group exist at the importing site, then
         the imported objects will be owned by the user and group regardless
         of whether the user is a member of the given group or not.
      b. If only the user is given or if the group is given but does not
         exist at the importing site, then the given user's default group at
         the importing site will be the owning group of the imported objects.
      c. If only the group is given or if the user is given but does not
         exist at the importing site, then the user context of the remote
         IDSM process will be the owning user of the imported objects.
      d. Items revisions which have variant options and are sent using the
         the -exclude_variant_options flag will not be able to opened
         in PSE at the remote site

   2. If variant options are excluded using the -exclude_variant_options  
      option, it is implied that they can not be sent separately in batch mode.
      Therefore, -exclude_variant_options can not be used with either
      -batch_variant_options -batch_objects=variantexpression or with
      -batch_file when the givenfile includes the classname 'variantexpression'

   3. Any number of objects can be sent separately in batch mode. Class names
      of objects can be given in a comma delimited list with the -batch_objects
      option or listed in a file whose name is given in the -batch_file= option

   4. The cancel_remote_co function has the following side effect:
      a. ItemRevsions that are cancelled will appear in the home folder of the user
         at the replica site. They may be safely cut from that folder if needed.


