|
| Copyright © Cloud Software Group, Inc. All Rights Reserved |
Some RCS operations such as add, delete, and commit typically require a user comment. In such cases, the argument -comment is provided, followed by a quoted string indicating the text provided by the user. The general description of the host script is:On execution, the script's current working directory is set to the TIBCO Designer project's root folder. Any file arguments required by an operation are passed using the standard input stream (stdin) of the script. All file paths are fully qualified. If the RCS system requires paths to be relative, the script implementation can remove the current working directory from the path provided.If the requested operation returns a value, the value is passed using standard output (stdout) as text. If a command requests the return value to be true or false, the script will echo or print the textual value of the word true or false to stdout.The exit value for the script should be zero (0) for normal or successful completion. If there's an error, the script can return a non-zero exit code, and write a message to standard error (stderr). In response to non-zero exit codes, TIBCO Designer displays the output found in stderr in a dialog.As can be inferred, an add operation involving these files also implies an add operation for the parent directory. A delete operation implies a delete of the file followed by a delete of the parent directory.There are two general categories of commands sent by the scriptable RCS adapter: configuration commands and RCS Commands. The next section explains configuration commands. See page 77 for an explanation of RCS commands.
Table 7 Configuration Commands Scripts should return true if the RCS system requires directories to be in editable or checked-out mode before items can be added or deleted from the directories. This callback command implements restrictions on the editing and reverting of TIBCO Designer resources that are nested in folders. When the command is configured to true, TIBCO Designer requires that all folders leading to the desired resource be unlocked for editing. Similarly, when reverting, all folders containing the resource will be reverted and locked together. This command returns true if your script can commit changes. If false is returned, the commit feature in TIBCO Designer is disabled and you must use your RCS system to commit your work. RCS systems that support locking keep files locked or non-editable unless they are checked-out for editing purposes. Scriptable RCS adapters are required to return true or to match this behavior.If the script returns true to this query and the file is locked, a user cannot edit the file unless the TIBCO Designer Acquire-Checkout command is applied to the resource in question. In response, TIBCO Designer sends the edit command to the script to perform the unlocking. Similarly, if the script returns true, revert operations will only be available when the resource is unlocked.This command is also required to return true even for RCS systems that don't enforce locking. The example SVN implementation (see page 80 ) returns true. This allows the system to revert, but TIBCO Designer will consider all files to be checked out. If the script returns true, and a user selects a container, the interpretation will edit or revert all contents. The scriptable RCS adapter forwards such requests as editRecursively or revertRecursively.If the script returns false, TIBCO Designer calls the scriptable RCS adapter (and your script) once per file and performs the recursion for you. In most cases the recursive operation performed by the script is much faster than recursion implemented by TIBCO Designer. This command is designed to be sent early on scriptable RCS adapter activation to determine if TIBCO Designer should enable its Synchronzie Project command. However, it is currently not supported by the scriptable RCS adapter. All the scripts return false to this request. The action to synchronize the project is disabled. If the script returns true TIBCO Designer will prompt for user comments when performing an add operation.
Table 8 Supported RCS Commands This command adds a file to an RCS adapter. The command can be accompanied by the -comment flag followed by a quoted text message if the script returns true to wantsCommentsOnAdd. This command submits all changes in the project to the RCS adapter. The command is accompanied by the -comment flag and a string typed by the user. If the commit fails due to out-of-date files or merge errors, the native RCS tools will be used to revert or integrate the changes.It is recommended that the commit implementation perform a release of configurations that were unlocked, but were not edited prior to the commit running. This removes files that show as having been edited in the RCS system when, in fact, they never changed. Note that while the preview shows what the commit will affect, the user cannot change the files that will be sent in the subsequent commit operation. If there are no files to commit, your script should return an error code, and write a message to stderr. An error dialog will be shown to the user with the message you provide. The command is followed by the flag -comment and a user-entered comment. Depending on the RCS system, this comment may not be registered with the system because the edit may require a commit. In such cases it is safe to ignore the comment because it will be supplied during commit. This command is only sent when the script responds to supportsLocking with true and a file is locked in the file system. This means that RCS systems that do not lock files won't ever receive edit commands, because the files will never be read-only to the scriptable RCS adapter. When sent, the scriptable RCS adapter should issue an edit or checkout command for the file to put it into the appropriate edit mode and make it writable by the user. The status command returns true or false on stdout. The scriptable RCS adapter caches this information for the session unless the file is deleted from the project. After the file has been deleted, the request can be made again after the file is added back to the project. This command is sent in response to the user unlocking the file. In TIBCO Designer this means to abandon changes on the file and release it so other users can edit the file. The file will revert back to its initial contents.
• SVN. Points to the location of the Subversion revision control system directory.
• SVN_LOG_FILE. Points to the location of the log file for the RCS system.This section explains how to work with the scriptable RCS adapter on UNIX operating systems using the example SVN script implementation (See page 80). SVN is an open-source version control system that is not directly supported by TIBCO Designer.
•
2. Select New empty project.
4. In the Multi-User System drop-down list, select Scriptable RCS Adapter.
If you are working on Windows operating systems and do not use .bat or .exe as your script, you must provide the path to the tool used to implement your script or program in the Interpreter field. For example, C:\ruby\bin\ruby.exe.
7. Start using the SVN repository that you created by doing a checkout of the RCS Scriptable Adapter project. For example, execute the following command using a shell:
8. Figure 28 SVN Add Resource to RCS
9. Select Multi-User > Check in Changes to check the project in SVN.Figure 29 SVN Check In Dialog
2. Modify the project, save it, then click Multi-User > Check In Changes.
If a new resource has been added to the project, it must first be added to the RCS using Add Resource to RCS before checking in the changes.
|
| Copyright © Cloud Software Group, Inc. All Rights Reserved |