Chapter 4. Operations With File

Create File
Save/ Save As... File
Save All Files
Delete File
Rename File
Open file with non-default editor
Go to Folder
Download file from server
Open Local File
Upload File
Using Templates
Save File as Template
Create File from Template
Remove non-default file templates
Edit File
Operations with tabs: open, select, close, browse tabs
Undo/Redo Editing
Edit file in Code Editor
Format file
Show/hide line numbers
Go to line
Watch cursor position in the Status Bar
Delete line
Find/Replace
Code Autocomplete
Code Outline
Edit File in WYSIWYG Editor
Preview File Properties

To create Filre, follow these steps:

Picture 6. Create new REST Service

Just after you have changed the opened file content, its tab title will be marked by "" and the "Save" button will be available. So, you will be able to save changed file content by clicking "Save" button or using the hotkey "Ctrl+S" or selecting "File->Save" from top menu. To save file into another folder or with another name, select a target folder in the Workspace Panel and then click on "Save As..." button on Toolbar or select "File->Save As..." from top menu.

If there are one or more earlier created, opened and changed files in the Content Panel, you can save all of them simply by clicking "File->Save All" from top menu . Take to consideration that the "Save All" command will not take affect on new files.

To delete file(s), select target files in the Workspace Panel, click on "Delete Item(s)..." button of Toolbar or select "File->Delete..." from top menu and then confirm deletion in the "Delete" dialog. Files opened in Content Panel will be closed after removing. You can view full path to the opened file in tip of file tab in the Content Panel.

To rename some file, do as follows:

After renaming opened and unsaved file in the Content Panel you will be able to save this file later.

HTML and Goolge gadget files can be opened in Code Editor or in WYSIWYG Editor, but Code Editor is used by default. You can open such files in WYSIWYG Editor and even more - set this editor as default - with the help of "Open File With" dialog. E.g. to open HTML file in WYSIWYG Editor, please, follow next steps:

If target file has been opened in Content Panel already, then reopen confirmation dialog will be shown:

Picture 7. Open HTML file in WYSIWYG editor

Picture 8. Opened HTML file in WYSIWYG editor

To change default editor you have to check "Use as default editor" checkbox in the "Open File With" dialog. After pressing "Open" button a new setting will be stored in the User Settings File at the server. So, in the next sessions you will have set default editor. Default editor is marked by "Default" in the "Open File With" dialog.

You can quickly find opened file in Workspace Panel using "Go to Folder" command:

Gadget will open folder with this file selected. In the same manner you can localize found file from Search Tab.

If you want to get some file from JCR Repository, you can use special command: "Download...":

After that the file will be sent to the client. So, the browser will propose you to save the file on local computer.

With eXo IDE it is possible to edit some local file with registered type within the Code Editor or WYSIWYG Editor. In time of opening you will be able to directly define correct file type. To edit some local file content with eXo IDE:

Then you can continue working with this content as with new file:

Picture 9. Example of opening local groovy script

There are such MIME types registered in eXo IDE:


Table 1. "Registered MIME Types"

Note

To load google gadget XML file you should set MIME Type = "application/x-google-gadget" in "Open file" dialog as it is figured out at the next picture:

Picture 10. Open local google gadget XML file

To load file directly into the JCR on server you can use "File->Upload..." top menu command. There is example of uploading file "gadget.xml" into the "Gadget" folder:

Then "gadget.xml" will be uploaded on the sever and appear in the "Gadget" folder of Workspace Panel.

When file is created or opened, its content will be displayed in the separate tab of Content Panel (see pic.1 for details) in default Code Editor. This is eXo GWT implementation of Codemirror application from http://marijn.haverbeke.nl/codemirror/ . - a JavaScript library that is used to create a relatively pleasant editor interface for Groovy, JavaScript, XML, Google Gadget, CSS, text and HTML MIME types of content. Such code will be colored, and the editor will help you with indentation.

To switch to necessary file, please, click on tab title with appropriate name. To close file just click on "x" button on the tab title. Also you can use tab browsing buttons "◄", "►", "▼" at the top right corner of Content Panel as you can see this at the picture "eXo IDE Interface" above.

There are several useful commands represented with special buttons at the center of Toolbar and in "Edit" top menu :Undo/Redo Typing, Format, Show/Hide Line Numbers:

Picture 13. Undo/Redo , Format and Show/Hide Line Numbers commands on {}Toolbar{} and in top menu

Text editing operations are added into history as distinct batch according to the editing pauses. After each pause of editing the new operations batch is created. So, you can redo or undo current file content changes using Toolbar buttons "Undo Typing" or "Redo Typing" (see pict. above). Also you could use "Ctrl+Z" or "Ctrl+Y" hotkeys respectively. In Code Editor the Undo/Redo commands are disabled if there are no changes in undo or redo history.

Each file, opened in editor has it's own history.

This feature allows you to autocomplete word including keywords, statements, declared variables and functions in context of JavaScript, CSS, HTML, XML, Google Gadget and Groovy Template files simply by clicking on "Ctrl+Space" hotkeys. After this gadget displays autocomplete form at the start of word:

Picture 16. Autocomplete form

In Google Gadget, HTML and Groovy Template files autocomplete list content depends on cursor position within the file: between <script> tags there will be autocomplete list for JavaScript content, between <style> tags - for CSS content. In the other places there will be autocomplete list for HTML content.

To use autocomplete function you have to:

Also you may mouse double click on needed token in the list to paste this token into document. To close autocomplete form you may also click outside the form.

Picture 17. Autocomplete form with description

Instead of Code Editor you can open and edit HTML files and Google Gadgets within the WYSIWYG Editor based on CKEditor. Even more, it is possible to set WYSIWYG Editor for those files as default. WYSIWYG Editor is eXo GWT implementation of CKEditor application from http://ckeditor.com/ the widely used WYSIWYG-editor of HTML-content. Also it is used to edit Google Gadget files.

WYSIWYG Editor doesn't support line numbering, auto indentation and format, code coloring, autocomplete, code outline. Instead of these, you will have powerful editor, which means that the text edited in it looks as similar as possible to the results, that users have when publishing it. It brings to the web common editing features found on desktop editing applications like Microsoft Word and OpenOffice. How to open file in WYSIWYG Editor is explained in the point "Open file with non-default editor" above.

This User Guide is a good start point to get advanced information about this editor.

Connected with JCR repository node, file properties are displayed in the special Properties Tab in bottom part of Content Panel. To view file properties:

Picture 21. View file's properties