docs.intersystems.com
Home  /  Application Development: Additional Options  /  Using Studio  /  Introduction to Studio


Using Studio
Introduction to Studio
[Back]  [Next] 
InterSystems: The power behind what matters   
Search:  


Studio offers features that help you develop applications rapidly, in a single, integrated environment including:
Studio is a client application that runs on Windows-based operating systems. It can connect to any InterSystems server (compatible with the current version of Studio) regardless of what platform and operating system that server is using.
Note:
A Studio client must be running either the same version or a higher version of the InterSystems product that the InterSystems server is running.
Overview of the Studio Window
The main components of the Studio user interface are shown below:
Studio Components
  1. Editor window: Class Editor for editing class definitions, Routine Editor for editing routines and include files, and CSP Editor for editing CSP definition text. Using CSP files with InterSystems IRIS is not recommended.
  2. Class Browser window: for viewing existing classes.
  3. Workspace window: three tabs let you display the contents of the current project, all open windows, or the content of the current namespace.
  4. Class Inspector window: for viewing and modifying keywords in a class definition.
  5. Watch window: displays variables.
  6. Title Bar: displays ConnectionName/Namespace@UserName - ProjectName.prj – Studio – ActiveDocument. If the active document is maximized, the name shows in square brackets.
In addition to the windows displayed above, Studio contains wizards and templates for assisting with common tasks. These include:
Running Studio from the Command Line
You can run Studio from the system's command line using the command Cstudio.exe (in the install-dir\bin directory). The command and its parameters are case-sensitive.
Parameter Description
? Help info
/Servername=ServerName Connect to the server named ServerName.
/Server=cn_iptcp:127.0.0.1[51773]:: Connect to the server at ip address[port].
/Namespace=User Connect to the User namespace. You must also define a server.
/Project=MyProject Open project MyProject. You must also define a server and a namespace.
cn_iptcp://127.0.0.1:51773/User/test.int Load routine test.int. cn_iptcp is a case sensitive protocol identifier.
/files="tag+1^myroutine.int",User.Class1.cls Open listed documents and set cursor in specified position. You must also define a server and a namespace.
/pid=123 Attach to process. You must also define a server and a namespace.
/fastconnect=127.0.0.1[51773]:USER:_SYSTEM:SYS Connect without connection definition in registry using ip address[port]:USER:username:password
Projects
Studio uses projects to organize application source code.
A project is a set of class definitions, routines, and include files. For example, you might create a Studio project to group all classes for a single application.
You are always in a project, either one that you created or the default project that is created when you first open Studio. The default project is called Default_yourusername (a prefix of Default_ followed by your username).
All files in a single project must be in the same namespace (and on the same InterSystems server). Each class or routine can be associated with any number of projects. Each namespace can contain any number of projects.
The project stores information such as the class hierarchy in a given InterSystems namespace, used when you edit classes. The project also stores debugging information (such as how to start the application you want to debug).
Class Definitions
A class definition defines a class. A class definition consists of class members (such as properties and methods) and other items, called keywords, each with associated values, that specify details of the class behavior.
Class definitions reside in a database where they are stored in the class dictionary. A class definition can be compiled, a process which creates executable code that can create object instances based on the class definition. The source code for the executable code created for a class consists of one or more routines. These generated routines can also be viewed in Studio.
A class definition can be projected for use by other technologies. In the case of SQL, this projection is automatic. In the case of Java (or C++), there is an additional compilation step in which a Java class is generated that corresponds to the class definition. For details, see the chapter Adding Class Projections.”
Within Studio, class definitions can be displayed and edited in a Class Editor window. Class definitions can also be viewed in the Class Inspector window as keywords and their corresponding values in tables.
CSP Files
Using CSP files with InterSystems IRIS is not recommended.
In other InterSystems products, a CSP (Web Server Page) file is an HTML or XML text file containing CSP markup language. The CSP engine processes a CSP file and generates from it an InterSystems class which is then used to respond to HTTP events and provide Web content.
If you prefer a more programmatic approach to Web development, you can also use Studio to create and edit CSP classes in the same way as you would work with any other class definitions.
Studio displays CSP files in a CSP Editor window. This editor provides syntax coloring of HTML and XML as well as many of the scripting languages that may be contained in a CSP file.
The CSP Editor provides commands for performing common CSP and HTML editing tasks such as inserting CSP markup tags. Studio also lets you view the results of a CSP file by selecting View > Web Page.
Routine Editor
Using the Routine Editor, you can directly create and edit the source for specific routines in a syntax-coloring editor. You also use the Routine Editor to edit include files.
Multiple User Support
Studio is an object-based, client/server application. The source files—class definitions, routines, and include files—that you can create and edit with Studio are stored in an InterSystems server and are represented as objects.
When you save a source file from Studio, it is saved in the InterSystems server you are connected to. If a source file is modified on the server while you are viewing it in Studio, you are notified and asked if you want to load the newer version.
Studio automatically detects when multiple users view the same source components simultaneously and manages access concurrency. If you attempt to open a file that is being edited by another user, you are notified and asked if you want to open the file in read-only mode.
Importing and Exporting Documents Locally
Normally any documents you work with in Studio (such as class definitions or routines) are stored in an InterSystems database (which may be on a remote machine). You can import from and export to local files using Tools > Export and Tools > Import.
Class definitions and routines are stored in local files as XML documents.
Debugging
Studio includes a source-level, GUI debugger. The debugger attaches (or starts up and attaches to) a target process running on the same InterSystems server that Studio is connected to. The debugger controls this target process remotely and allows you to watch variables, step through code, and set breakpoints.
You typically must have a project open in order to use the debugger; the project contains the information needed to start the debug target (name of a routine, method, or client application). In addition, the project stores a list of breakpoints that were set in a prior debugging session.
You can attach and break into a running process without having a project open. In this case Studio does not remember breakpoint settings from previous sessions. See more about debugging in the chapter Using the Studio Debugger.”
Debugging Object-Based Applications
At this time, Studio only allows source-level debugging of INT (ObjectScript routine). To step through, or set breakpoints within classes, open the corresponding INT and use the debugging commands in it.
To make sure that the generated source code for a class is available:
  1. Select Tools > Options.
  2. Navigate to Compiler > Flags & Optimization in the left-hand pane.
  3. Select the Keep generated source code check box.
Security
InterSystems security features control both the use of Studio and the ability of Studio to connect to any InterSystems server. When you start Studio, it presents a login screen; to use Studio, you must log in as a user who holds the following privileges:
Also, you can connect to a namespace only if you have Read or Write permission for its default database.
The way in which a user is granted these various privileges depends on the instance’s security level, as described in the following list.
To change Studio authentication settings:
  1. Use the InterSystems IRIS launcher to open the Management Portal.
  2. Click Go in the View or edit service definitions section.
  3. Select or clear the check boxes under Allowed Authentication Methods.
Note:
Studio access may also be affected by any changes to default settings that have occurred since installation.
Source Control Hooks
Studio includes a mechanism for implementing custom hooks—code that is executed on the InterSystems server whenever a document is loaded or saved. Typically these hooks are used to implement a connection to a source or revision control system.
To define source control hooks, create a subclass of the %Studio.SourceControl.Base class and implement the callback methods that you want. You can specify which Source Control class Studio should use from the Source Control Settings page of the Management Portal. (Navigate to System Administration > Configuration > Additional Settings > Source Control.)
Refer to the %Studio.SourceControl.Base class and the Using Studio Source Control Hooks appendix for more details.