Tutorial: Partner Workbench Basics *********************************** Overview =========================== This lesson teaches you how to start and use the Partner Workbench software. The Workbench is the file manager and development environment for the Partner Platform. It is a powerful tool, and is not designed for normal end users. This tutorial is part of the :doc:`index`. Be sure you read :doc:`/preface/caution` before proceeding. audience ------------------ * system administrators and IT staff * power users * developers objectives ------------------ * learn how to start the workbench * use the filesystem tree to view the installation structure * use the context-sensitive file and directory editors * use the log view and console prerequisites ------------------ You need a current installation of the development version of Partner. [[Tutorial: Partner Installation and Update]] covers that nicely. Workbench =========================== The Workbench is the development environment for the Partner Platform. It has a number of powerful facilities, but we'll start by learning how to use the file browser, editor, and console, and leave it to [[Course: Partner Workbench]] to teach you the rest. WARNING ---------------------------------- The Workbench is extremely powerful and allows you to edit, delete, or modify any file or directory in the Partner installation filesystem. Read :doc:`/preface/caution`. Yes, we said that above and in the course description. It bears repeating. Starting the Workbench ---------------------------------- The Workbench is intentionally left out of the Partner section of the Windows Start menu, and there will be no icon on your desktop. To prove you at least have some idea what you're doing, you have to dig in the filesystem to find it or create your own shortcut. Run os/windows/programs/Workbench.bat under Windows to start it. The Workbench Window ---------------------------------- The Workbench has several major parts. At the very top (or top of the screen in some operating systems) is the menu bar. This has the usual familiar File, Edit, etc. menus. The Workbench menu has some workbench-specific tools and lets you run other important programs like the Map Viewer and the App Launcher. [[Image:PartnerWorkbenchMenuBar.png|none|frame|The menu bar.]] Under the menu bar is the navigation bar. This is very similar to the navigation bars found on most web browsers. It has forward and back controls, a place to type in the current directory or file, and a go button. It also has an up button; since we are in a filesystem hierarchy rather than a networked website this makes sense and it takes you to the parent directory of the current selection. [[Image:PartnerWorkbenchNavigationBar.png|none|frame|The navigation bar.]] At the left is the filesystem tree. This works just like similar trees in tools like Windows Explorer or the Mac Finder. Click the arrow or plus sign to the left of a directory to expand that directory's contents, and select either a file or a directory to view it in the editor window on the right. [[Image:PartnerWorkbenchFileTree.png|none|frame|The filesystem tree.]] At the top of the right side is the editor panel. This may have one or more context-sensitive tabs. Each tab represents a different way of viewing or modifying the selected node. For example, a text file will have the generic "File" tab (with delete, copy, and binary viewing controls) as well as the "Text" tab (with a text editor). [[Image:PartnerWorkbenchEditorPanel.png|none|frame|The editor panel.]] At the bottom of the right side is the log panel. This is the current system log, and you will see new statements as you do things in the Workbench. [[Image:PartnerWorkbenchLogPanel.png|none|frame|The log panel.]] Underneath the log display is a text box. You can type in commands into this box and hit return to execute them; it is thus similar to command-line consoles. Currently you can use Unix-style directory and file commands and also run applications based on their name. [[Image:PartnerWorkbenchLogPanel.png|none|frame|The command line text box.]] There are some slider bars to change the divisions between the various parts. If you don't see a part, it might be hidden because a slider bar is too far one way or has that part minimized. Fiddle with the controls. Exploring the Filesystem =========================== Use the filesystem tree control to move around the installation. Click on individual files and directories to see which editor tabs appear - for example, look at the following: * update/info/UpdateSource.txt [[Image:SampleTabLayouts.png|right|frame|Some example tab layouts.]] * system/jars/Partner.jar * modules/ * modules/customer/PartnerSplashes/resources/splashes/* As you can see, the editor panel has some knowledge of both the kind of file or directory you have selected, and its role in the system based on its path. All files will have the generic "File" tab, and all directories will have the generic "Directory" tab. Familiarize yourself with the controls on each. Try typing in paths in the navigation bar at the top, and play with the forward, back, and up buttons. Modifying the Filesystem =========================== Using the directory editor, add a new directory to data/ named Example. Then, add a file named Example.txt in data/Example/ (data/Example/Example.txt). Put a bit of text in it, go somewhere else and come back. Then select data/Example/ and import a file from somewhere - for example, an image. Finally, to remind yourself just how dangerous the Workbench can be, select data/Example and remove it. Poof. Undo! =========================== Fortunately for the fumble-fingered, there is an undo/redo mechanism for file operations. Under the Edit menu, select Undo, and data/Example should reappear. [[Image:Undo.png|none|frame|Undo.]] A script! =========================== Writing and running scripts is extremely easy in the Workbench. Do this: * create a file named test/Hello World.groovy * using the Text tab, put this in it: test/Hello World.groovy ---------------------------------- :: log.info("Hello, world!"); Click the Run button on the Text tab, and view the results in the log. Using the console =========================== Try the following commands at the console underneath the log view. Hit return after each. :: cd / cd data ls cd Example ls *.txt rm *.txt Typing "help" will get you a list of available commands. Hotkeys =========================== You can define hotkeys tied to scripts in the Workbench. Currently, these are defined: * control-g sets the keyboard focus to the command line * control-n sets the keyboard to the path field on the navigation bar * control-f sets the keyboard focus to the find field if a text editor is visible and begins incremental search Moving On =========================== Now it's time for :doc:`modules`.