13.07.2015 Views

Using Caché Studio - InterSystems Documentation

Using Caché Studio - InterSystems Documentation

Using Caché Studio - InterSystems Documentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

• How the class implements the required GetStatus method, which ensures that the <strong>Caché</strong> documentis read-only when appropriate• Details of the actual source control methods in the class• Other notes about this classA Look at the SampleNote:The class in your SAMPLES namespace could be slightly different from the examples shownhere. In particular, some of the line breaks have been adjusted for readability in this document.A.5.1 Introduction<strong>Studio</strong>.SourceControl.Example is a partial example that does not make any calls to a source controlsystem. It simply maintains external XML files that such a system would use. Despite this simplification,however, the sample demonstrates all the following:• Establishing and maintaining a relationship between each <strong>Caché</strong> document and a correspondingexternal file.• Keeping <strong>Caché</strong> up-to-date with the status of each file.• Appropriately controlling the read-write state of each <strong>Caché</strong> document.• Defining methods to check files in and out.Note that the sample does not modify the read-write state of the external files; the source control systemwould be responsible for that. Also, the sample implements only the Check In and Check Out methods.To try this example in the SAMPLES namespace, do the following:1. Use the System Management Portal to enable this source control class(<strong>Studio</strong>.SourceControl.Example), as described earlier in “Activating a Source Control Class.”2. In the <strong>Studio</strong> Workspace window, double-click a <strong>Caché</strong> document. Notice a message like the followingin the Output window:File C:\sources\cls\User\LotteryUser.xml not found, skipping import3. Edit the document (for example by adding a comment).4. Click File —> Save. You will see a message like the following in the Output window:Exported 'User.LotteryActivity.CLS' to file'C:\sources\cls\User\LotteryActivity.xml'At this step, you have implicitly added the <strong>Caché</strong> document to the source control system.5. Try to make another edit. The <strong>Studio</strong> displays a dialog box that asks if you want to check the fileout. Click No. Notice that the <strong>Caché</strong> document remains read-only.<strong>Using</strong> <strong>Caché</strong> <strong>Studio</strong> 141

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!