Attachment Editor/en

Aus expecco Wiki (Version 2.x)
(Weitergeleitet von URLAttachment Editor/en)
Zur Navigation springen Zur Suche springen

Introduction[Bearbeiten]

The attachment editor is used to view and edit an attachment element. It is shown in the right editor area, when an attachment element is selected in the navigation tree.

Attachment Editor (sorry: an old version's screenshot)

A file attachment is actually a file that is stored within the test suite (the ".ets"-file, which is technically a zip-file). Whenever a suite is loaded, all embedded attachments are unpacked and stored in the suite's temporary folder on your disk. A URL attachment's underlying file will be fetched during execution.

The filename or its contents is made available to other actions by dragging the attachment into a diagram. This creates an attachment-step, which is configurable to provide either the filename or its contents in a number of commonly used formats (line-wise, as a collection of lines, binary, all in one strings, etc.)

To the right, you see a CSV file which is shown in the editor in textual mode.

Menu[Bearbeiten]

The menu offers common functions to create new attachment files and especially open an external editor (as defined in the preferences settings dialog) on the document. The most useful function is "Open External Editor" on CSV files, after you have defined an appropriate CSV-capable editor (e.g. oocalc from the OpenOffice suite or Excel) in your preferences.

As an alternative, choose the "Open Attachment's Folder in Explorer/Finder" menu item, and double click or launch an editor application there. This opens a Windows Explorer on Windows machines, a Finder on macOS and the built-in File Browser on other machines.

Buttons[Bearbeiten]

  • Icon Edit Attach Ext.png Edit the attached file using an external tool. The tool is chosen as defined by its filename extension. For text files, under Windows, a notepad editor is typically opened.
    The external editor can be specified in the "Extras" → "Settings" → "External Tools" dialog.
    If nothing is specified there, on Windows and OSX, the installed application for the file's extension is opened.


  • Icon Edit Attach Int.png Edit the attached file using the built-in expecco text editor. This provides most required editing facilities and does not need any setup in either expecco nor installation of additional tools in your operating system.


  • Icon Edit Attach Image Int.png Edit the attached file using the built-in expecco bitmap editor. This provides useful functions to deal with small bitmap images, such as icons or to post process a screen shot (resize, extract parts etc.). It is not a replacement for a full featured image manipulation program, such as gimp or a commercial image processing application (but good enough for most day-to-day tasks on images, and better than some editors provided by some operating systems...).


  • Icon Open Attach Ext.png Open the attached file using an external viewer. The tool is chosen as defined by its filename extension.
    On Windows and OSX, the installed application for the file's extension is opened.


  • Icon Open Attach Text.png Display the content of the attachment as editable text


  • Icon Open Attach Hex.png Display the content of the attachment as a read only hex dump


  • Icon Open Attach XML.png Display the content of the attachment in an XML inspector


  • Icon Open Attach CSV.png Display the content of the attachment as a CSV data table

 

Text Editor Functions[Bearbeiten]

The text editor's functions are a subset of the editor used for code editing and described in the "Code Editor Documentation".

The hex dump viewer is read only.

XML Inspector[Bearbeiten]

XML editor showing the DOM of an XML file

The XML inspector is a "readonly inspector", which means that it can be used to look at an XML document, but not to modify it or construct one.

It includes an XPath input field to select one or multiple subelements. If an element is selected in the DOM tree, it shows a suggested XPath for the selected element. In addition, a number of alternative XPathes is shown in a combo list below that field.

The attachment editor's own "Extras" → "Generate" menu provides 2 new items, which will generate XPath-extraction action blocks for the current XPath.

This makes it very easy to generate XML extraction actions, for example to fetch configuration values from an xml config file (use an "[XML] ParseDocument" action to get the DOM, then use the XPath extractor action to fetch one or multiple fields).

Zip Archive Inspector[Bearbeiten]

Zip archive editor showing an FMU

The Zip Archive inspector is another "readonly inspector" (i.e. it can be used to look at a Zip or FMU document, but not to modify or construct one).

It presents the ZIP contents and offers pop up menu functions (right click) to extract or inspect individual files. It is the same viewer as used in the FileBrowser, when a zip archive is selected there.

To create zip archives, use either the FileBrowser's tool function or a standard zip tool (usually already provided by the underlying operating system). Actually, the underlying Smalltalk system also contains functions to create a zip archive, but to date, no action block is provided in the standard library (however, it's trivial to add a shell/batch action to call the OS command).

CSV Inspector[Bearbeiten]

The CSV inspector is (currently) readonly; it shows the CSV table organized in rows and columns.

Image Inspector[Bearbeiten]

Image editor showing a screenshot

The Image inspector shows bitmap image attachments in PNG, TIFF, BMP, JPG and a number of additional, less common formats. Two toolbar buttons are provided to create screenshots and attach them. The bitmap file can be edited, eg. to convert (size, orientation, colormap) or to extract sub images.

Additional Utility Functions in the Menu[Bearbeiten]

Open in Message Browser[Bearbeiten]

The message browser is an optional plugin, which is used to construct and deconstruct XML, EDIFACT (and in future versions other, such as SWIFT) messages. If the plugin is loaded and licensed, attachments containing XML or EDIFACT messages can be edited in a much improved way.

Generate XPath Accessors[Bearbeiten]

Generates access action blocks to extract elements from the XML document by xPath

Generate FMU Library[Bearbeiten]

Extracts an FMU's modelDescription and generates an import library containing actions to load, instantiate and simulate the FMU. The generated library should be saved separately and can then be imported into another simulation or test project.

See Also[Bearbeiten]

Attachment Element in the navigation tree
Attachment Step in a diagram



Copyright © 2014-2024 eXept Software AG