Exporting a Single Item Frame using ‘getframe’ with c_io

Exporting

A user can export a single item’s text or binary frame and place it in a file using getframe. A batch file is great for this as a user can use copy and paste the same command line numerous times,  replacing the identity for each line. Then when run, all the frames will be quickly exported.

The start of this command line is the same as for all main options, using the path and login details.

The -getframe options are as follows:

Options for getframe in c_io.exe
The options for getframe in c_io.exe

-getframe option sets the frame name to be output for the first item that matches the query or identity (if used).

-file sets the name and location of the file to be output

-query option sets the query to be used

-qloc sets the location of the -query option

-identity over rides any set within the used query

c_io.exe Batch File GetFrame Examples

"%CRADLEHOME%\bin\exe\windows\c_io.exe" -login admin,ADMIN,demo -getframe NOTES -file "C:\Temp\notes.txt" -query "Req - All" -qloc automatic

Using -identity

"%CRADLEHOME%\bin\exe\windows\c_io.exe" -login admin,ADMIN,demo -getframe TEXT -file "C:\Temp\REQ-2_TEXT.txt" -query "Req - All" -qloc automatic  -identity "REQ-2"

"%CRADLEHOME%\bin\exe\windows\c_io.exe" -login admin,ADMIN,demo -getframe PICTURE -file "C:\Temp\REQ-9_PIC.jpg" -query "Req - All" -qloc automatic  -identity "REQ-9"

Helpful other c_io options

There are several helpful options especially when using in a batch file.

-log allows a user to specify a name for a log. This is the log that will have the details of the actions performed during the  import.

-noldap allows users to bypass using LDAP when running a command line or batch file.
-errorstack option is for logging any issues with the import

"%CRADLEHOME%\bin\exe\windows\c_io.exe" -login admin,ADMIN,demo -export "C:\Temp\all3.exp" -type all -noldap -errorstack -log "C:\Temp\all4_log.log"

"%CRADLEHOME%\bin\exe\windows\c_io.exe" -login admin,ADMIN,demo -export "C:\Temp\pdb3.exp" -type pdb -noldap -errorstack -log "C:\Temp\pdb3_log.log" -verbose

Options not used within a batch file

There are a couple of options that are not used in a batch file. The reason is that they are only useful in a command line, in a command prompt as they show pop ups with information on them.

-ver lets the user see what the version number, date and time of the build they are using.
-help option allows a user to see the command line options.

Links to Other Batch File Options

Read Publishing a Formal Document Using a Batch File article for information of formal documentation.

Details of importing can be read in Importing Using c_io in a Batch File

 

Printing Diagrams using printdiag with c_io.exe

Printing many individual diagrams through WorkBench can be slow and time consuming. Using the option -printdiag in c_io.exe, a user can then print many diagrams at once. Once the first command line has been set up, it can be copied, pasted. The file name and the identity can be altered for each diagram that the user requires printing.

The options to do this are:

printdiag options in c_io.exe
The printdiag options in c_io.exe

Required Options

-printdiag allows a user to set the type of output for the diagram. The types currently used for this are:

  • hpgl – Hewlett-Packard Graphics Language
  • ps – PostScript
  • rtf – Rich Text Format
  • svg – Scalable Vector Graphics

Elective Options

-onlydiag will output the diagram without a surrounding frame and the details which the frame contains.

-catcode will print the category value in the diagrams border.

-portrait will cause the diagrams to be output into a portrait orientation rather than the default of landscape. This option is only used in conjunction with -printdiag, it will not work with any other c_io.exe options.

-file sets the name and location of the file to be output.

-query set the query to being used and as before -qloc sets the location

-identity overrides any identity set within the used query

-printdiag Batch File Examples

"%CRADLEHOME%\bin\exe\windows\c_io.exe" -login admin,ADMIN,demo -printdiag svg -file "C:\Temp\DFD_C.svg" -query "Diagram - Ess DFD" -qloc project  -identity "C"

"%CRADLEHOME%\bin\exe\windows\c_io.exe" -login admin,ADMIN,demo -printdiag rtf -file "C:\Temp\eFFBD_133.rtf" -query "Diagram - Ess eFFBD" -qloc project -portrait -identity "1.3.3" -onlydiag

Helpful other c_io options

There are several helpful options especially when using in a batch file.

-log allows a user to specify a name for a log. This is the log that will have the details of the actions performed during the import.

-noldap allows users to bypass using LDAP when running a command line or batch file.
-errorstack option is for logging any issues with the import

"%CRADLEHOME%\bin\exe\windows\c_io.exe" -login admin,ADMIN,demo -export "C:\Temp\all3.exp" -type all -noldap -errorstack -log "C:\Temp\all4_log.log"
"%CRADLEHOME%\bin\exe\windows\c_io.exe" -login admin,ADMIN,demo -export "C:\Temp\pdb3.exp" -type pdb -noldap -errorstack -log "C:\Temp\pdb3_log.log"

Options not used within a batch file

There are a couple of options that are not used in a batch file. The reason is that they are only useful in a command line, in a command prompt as they show pop ups with information on them.

-ver lets the user see what the version number, date and time of the build they are using.
-help option allows a user to see the command line options.

Related Posts

Read Exporting using c_io in a batch file article for information on how to create data transfer files from Cradle.

Exporting using c_io.exe in a Batch File

All Exporting Options for c_io.exe

Exporting either a whole project or just a query can take a long time if the database is huge. The quickest and easiest way to do this is use c_io.exe in a batch file during down time e.g. night

The options available are:

Export Options for c_io.exe
Export Options for c_io.exe

Required Export Options

So the first option is, of course, the export option that needs the user to specify a location and a name for the exporting file:

-export “C:\Temp\export1.exp”

The Type Options

The -type option is required for the export option and allows users to define the type of export they require:

params will export only this projects parameters (Project Schema)
all will export all items and definition files the user has access to
pdb will export all items the user has access to but not definition files
query export items matching a named query.

Options used with query

-query will specify the query to be used. This is required if the type is set to query
-qloc will specify the location of the query. This is required if the -query option is used.

expformat is for exporting all files set in a saved format.

Options used with expformat

-expname is the Export Formats name.
-exploc is used in conjunction with -expname to state the location of the export format
-identity can be used with -expname and will override the Identity set in a query.

Export UI Identity
Export UI Identity
Query UI Identity
Query UI Identity

basesum requires the user to use -basename with the Baseline Name and -sumformat which allows the user to specify how the data is output either as CSV or standard (Note: the user must have the PROJECT_RO privilege for this option)

Options used with basesum

-basename needs to have a Baseline name currently either open or closed.
– sumformat allows the user to state they format -basesum is output as CSV or standard.

The standard output is <BASEHIST> records in the normal format:

<BASEHIST>
 <BH_BNAME> = BASE1
 <BH_DOMID> =
 <BH_NMSPC> = NMSPACE_START
 MH_IGNOREMODEL
 NMSPACE_END
 <BH_INFTP> = INFO_REQUIREMENT
 <BH_INFST> = NULL_INFOSUB
 <BH_STERT> =
 <BH_TTYPE> =
 <BH_INFRF> = REQ-1
 <BH_VERSN> = 01
 <BH_STATU> = B
<BASEHIST> fields
The CSV output will set the fields from left to right and output the items below this line:

Elective Export Options

Other export options are not required but can be used with –type all and -type pdb:
– since can be used to state a date or date and time since which items were created or modified. The format for this is yyyymmdd or yyyymmddThhmmss so 20170119 (19/01/2017). For example 20170119T183030 (19/01/2017 18:30:30)

-until will only export items that have been modified up to a certain date or date and time or a time after the -since was set. The format for this is the same as -since.

-delete_state allows the user to specify if they want the items being exported to be (Same as in the Export UI):

normal – Not marked as delete
recoverable – Items marked as deleted but can be recovered
all – All items not matter what they are marked as will be exported

Delete state in the Exporting UI
The Delete state in the Export UI in WorkBench.

-scope controls how an item is output either on its own or with all the items cross referencs. Using item will make sure only the item on its own is output. Using item_xref will output the item and any items cross referenced to it.

-binarytodir sets a folder for the binary data. So a user would use -binary “C:\Temp\binary” and all binary data would be output to unique files and the path to this file would be output in the export file next to the binary frame:

<FR_FNAME> = PICTURE
 <FR_VERSN> = 0
 <FR_FTEXT> = C:\Temp\binary\binary_frame0.dat

-sanitise will output items but without any binary frames. It will also change all text including item names, comments descriptions, text frames, change history, diagram symbols, discussions and user defined cross reference attributes.

c_io.exe Batch File Exporting Examples

Exporting Project Schema using -type params

"%CRADLEHOME%\bin\exe\windows\c_io.exe" -login admin,ADMIN,demo -export "C:\Temp\params1.exp" -type params

Using -type all

"%CRADLEHOME%\bin\exe\windows\c_io.exe" -login admin,ADMIN,demo -export "C:\Temp\all1.exp" -type all

Using -type all and -since

"%CRADLEHOME%\bin\exe\windows\c_io.exe" -login admin,ADMIN,demo -export "C:\Temp\all2.exp" -type all -since 20150724 -until 20150818

Using -type all with sanitising

"%CRADLEHOME%\bin\exe\windows\c_io.exe" -login admin,ADMIN,demo -export "C:\Temp\all3.exp" -type all -sanitise

Using -type pdb

"%CRADLEHOME%\bin\exe\windows\c_io.exe" -login admin,ADMIN,demo -export "C:\Temp\pdb1.exp" -type pdb
"%CRADLEHOME%\bin\exe\windows\c_io.exe" -login admin,ADMIN,demo -export "C:\Temp\pdb2.exp" -type pdb -scope item

Using -type query

"%CRADLEHOME%\bin\exe\windows\c_io.exe" -login admin,ADMIN,demo -export "C:\Temp\query1.exp" -type query -query "Accepted Items" -qloc project

Using -type expformat

"%CRADLEHOME%\bin\exe\windows\c_io.exe" -login manager,MANAGER,demo -export "C:\Temp\exportformats1.exp" -type expformat -expname all_since_until -exploc project -identity REQ-20

Using -type basename

"%CRADLEHOME%\bin\exe\windows\c_io.exe" -login admin,ADMIN,demo -export "C:\Temp\baseline1.exp" -type basesum -basename alpha -sumformat standard

Helpful other c_io options

There are several helpful options especially when using in a batch file.

-log allows a user to specify a name for a log. This is the log that will have the details of the actions performed during the  import.

-noldap allows users to bypass using LDAP when running a command line or batch file.
-errorstack option is for logging any issues with the import

"%CRADLEHOME%\bin\exe\windows\c_io.exe" -login admin,ADMIN,demo -export "C:\Temp\all3.exp" -type all -noldap -errorstack -log "C:\Temp\all4_log.log"
"%CRADLEHOME%\bin\exe\windows\c_io.exe" -login admin,ADMIN,demo -export "C:\Temp\pdb3.exp" -type pdb -noldap -errorstack -log "C:\Temp\pdb3_log.log"

Options not used within a batch file

A few of the options not used in a batch file but are in a command prompt. These are pop ups with information on them which why they are not in a batch file.

-verbose lets the user know that c_io.exe has finished
-ver lets the user see what the version number, date and time of the build they are using.
-help is used to see all the command line options.

Related Posts

Read Publishing a Formal Document Using a Batch File article for information of formal documentation.

Importing using c_io,  and exporting a single frame is also possible.

 

 

Importing using c_io.exe in a Batch File

Importing

C_io.exe can be useful when importing large files or when a user has a lot of files. When c_io is in a batch file, it can import different files into different projects within one batch file. This file is then run when no one is in the database and so there should not be any issues.

The options available are:

c_io import options
Import options for c_io.exe

Required Import Options

The  first option for importing needs the user to specify a location and a name for the file:
-import “C:\Temp\import1.exp”

All saved Import Formats in WorkBench can be used with -import

-impname is the Import Formats filename. When an Import Format is being used -overwrite, -owner, -ipid, -cpid and -noalerts are set from this file.

-imploc is the location of the Import Format file.

Elective Import Options

-overwrite is used when a user requires any items in the database to be overwritten, merged or not overwritten. If not in the command line the default of off is used.

  • on – all data will be overwritten
  • merge – all items will be merged
  • off – no data will be overwritten and only new items added

-owner sets by whom the items imported are going to be owned by. Depending on the option set depends on the owner of the items:

  • user option is owned by the user in the login option e.g. -login ADMIN the items will be owned by the ADMIN user.
  • File option is the owner as stated in the import file
  • A user can be specified and all items imports will be owned by that user e.g. -owner REQMAN
 Import UI
WorkBench Import UI showing Owner Options

Additional Options

-ipid is the option to let c_io know whether to use the PIDs in the file or in the project it is being imported into.

  • Off means the PIDs will be generated.
  • On means the PIDs in the file will be used.

-cpid allows a user to specify the PID to be used for the items being brought in.

-noalerts option stops alerts from being generated during the import

-ignorelinkrules allows any cross references to ignore projects link rules in the current project but only if the user has the correct privileges. The user must have either ACCESS_BYPASS or PROJECT for this to work.

-noautoid allows the original numbering for items rather than any auto numbering set in the Project Schema.

-nocheckdata option stops data being checked so it is all imported.

-add_itemhist is the same a Auto update modification details and sets the current user, date and time, not what is specified in the file.

-itemhistcomment will include a Change History comment which will include the last modifier, modification date and time

-add_imphist will create a log with the history of the import. It shows the options used, who performed it and the date and time of the import.

-set_modify uses the current date and time instead of the date and time specified in the imported file.

All the above options are from the Import UI:

Import Options
Import Options from the WorkBench UI

c_io.exe Batch File Importing Examples

Using Basic Options

“%CRADLEHOME%\bin\exe\windows\c_io.exe” -login admin,ADMIN,demo -import “C:\Temp\import1.exp” -overwrite merge -owner file -noalerts -ignorerules -noautoid -nocheckdata

Using Import Formats

“%CRADLEHOME%\bin\exe\windows\c_io.exe” -login admin,ADMIN,demo -impname TestImport -imploc project

Using Elective Options

“%CRADLEHOME%\bin\exe\windows\c_io.exe” -login admin,ADMIN,demo -import “C:\Temp\import3.exp” -overwrite on -owner REQMAN -ipid off -noalerts -ignorerules -noautoid -nocheckdata -add_itemhist -itemhistcomment “Imported through c_io” -add_imphist

Helpful other c_io options

There are several helpful options especially when using in a batch file.

-log allows a user to specify a name for a log. This is the log that will have the details of the actions performed during the  import.

-noldap allows users to bypass using LDAP when running a command line or batch file.
-errorstack option is for logging any issues with the import

“%CRADLEHOME%\bin\exe\windows\c_io.exe” -login admin,ADMIN,demo -export “C:\Temp\all3.exp” -type all -noldap -errorstack -log “C:\Temp\all3_log.log
“%CRADLEHOME%\bin\exe\windows\c_io.exe” -login admin,ADMIN,demo -export “C:\Temp\pdb3.exp” -type pdb -noldap -errorstack -log “C:\Temp\pdb3_log.log

Options not used within a batch file

There are a couple of options that are not used in a batch file. The reason is that they are only useful in a command line, in a command prompt as they show pop ups with information on them.

-ver lets the user see what the version number, date and time of the build they are using.
-help option allows a user to see the command line options.

Related Posts

Read the article  Batch File Reporting  for advice on producing reports with c_io.
Exporting using a batch file.
Exporting a single frame from an item allows just one frame of data to be extracted.

 

July 2017 Newsletter

July is Here

Last month saw the start of the Summer and also National Sunglasses day. We still hear the odd story that engineers are using ‘Spreadsheets‘ and ‘Word-processor documents‘ to manage their requirements. We can only sympathise with their misguided ways and revel in the fact that we (and you our dear newsletter readers) have seen the light.
So the only thing you should need your rose tinted spectacles for is to eat your Cream tea while watching Wimbledon!

an eFFBD showing Cream tea making
National Cream Tea day – eFFBD

Non Graphic Interfaces

This month (July 2017 Newsletter) we’re highlighting c_io and how it can be used to complement the functionality we’re more used to in WorkBench and Web Access.

c_io

Using c_io.exe in a batch file means you can do many things whilst you are away from your desk or in the background while you continue to work. You can then add this batch file to be run by a task application during times you are away from your desk or work. This can be handy when needing to do backups of a single or many large databases.

The executable can import and export everything in a project from single items to the whole project. It can use queries or different options to whittle down the required export. So a user can export all items of a specific type or just one to several items based on a query and or other set options.

Export Options for c_io.exe
Export Options for c_io.exe

For the full article set please see Mikki’s guide How to Use c_io.exe in a Batch File

Social Media

Twitter

We continue to welcome new followers each month and would encourage any Cradle users who would like regular ‘Hints & Tips’ to follow us @threesl

Reviews

Thanks to those who responded adding reviews of Cradle to Capterra. If you have not yet and are able to add a few words, please reply using  Yes I’m happy to consider writing a review

Hints of the Month

Here are some links to helpful topics since our last newsletter, they should improve your Cradle experience:

Controlling what can link to what is covered in Getting Started with Link Rules

Getting down to the nitty-gritty in Document Publisher with How to Make Use of User Variables in Document Publisher

Just upgraded the number or type of modules you have in Cradle, installing the new code is simple Installing a New Security Code

An FAQ about alerts is covered here How do I receive alerts via email?

You can read Hints & Tips in the 3SL Blog.

How to Use c_io.exe in a Batch File

Why use c_io.exe?

Using c_io.exe allows a user to do many things within a project without using the interface and is usually faster.

Using c_io.exe in a batch file means you can do many things while you are actually away from your desk or in the background. You can then add this batch file to be run by a task application during times you are away from you desk or work. This can be handy when needing to do backups of a single or many large databases.

The executable can import and export everything in a project from single items to the whole project. It can use queries or different options to whittle down the required export. So a user can export all items of a specific type or just one to several items based on a query and or other set options.

The user can use also use the import to update or create a new Project schema, items, cross references and definitions.

Import and Export can use the Format Types already saved into the database.

It can also export just a single frame from a single item into a file of the right type and print diagrams to specific print types.

How to use c_io.exe

The only real difference between using a command prompt and a batch file is the user will need to have a path for the executable. At the beginning of each command line the user will need “%CRADLEHOME%\bin\exe\windows\c_io.exe”

As in commandline code, a user will require the correct login information and the project being logged into.
-login <username>,<password>,<projectcode>

For example:

-login admin.ADMIN.demo

As long as the -login user has the correct privileges, they can use c_io.

Different Options in c_io.exe

Required options are:

-export

Export Options for c_io.exe
Export Options for c_io.exe

-import

c_io import options
Import options for c_io.exe

-getframe

Options for getframe in c_io.exe
The options for getframe in c_io.exe

-printdiag

printdiag options in c_io.exe
The printdiag options in c_io.exe

Without any of the previous options, c_io.exe will put up the Information page or an error.

Helpful other c_io options

There are several helpful options especially when using in a batch file.

-log allows a user to specify a name for a log. This is the log that will have the details of the actions performed during the  import.

-noldap allows users to bypass using LDAP when running a command line or batch file.
-errorstack option is for logging any issues with the import

 

“%CRADLEHOME%\bin\exe\windows\c_io.exe” -login admin,ADMIN,demo -export “C:\Temp\all3.exp” -type all -noldap -errorstack -log “C:\Temp\all4_log.log”
“%CRADLEHOME%\bin\exe\windows\c_io.exe” -login admin,ADMIN,demo -export “C:\Temp\pdb3.exp” -type pdb -noldap -errorstack -log “C:\Temp\pdb3_log.log”

Options not used within a batch file

A few of the options are not used in a batch file but are in a command prompt. The reason is that they are only used in a command prompt is that they show pop ups with information on them.

-verbose lets the user know that c_io.exe has finished
-ver lets the user see what the version number, date and time of the build they are using.
-help is used to see all the command line options.

Batch Files from Project Phase

Batch files can be added into the Project Phases, this is done by going to “Project Setup”, and in Options selecting “Project Phases”. Inside here if you create a new Process and change the type to command, in Command navigate to your .bat file.

A screenshot showing how to setup a phase node to run a batch file
Command phase node to run batch filesArticle Updated 04/02/2019 – Added infor on running batch file from phase sidebar