Skip to main content

%Studio.SourceControl.UI

Class %Studio.SourceControl.UI Extends %CSP.StudioTemplateSuper [ System = 4 ]

Dialog for checking in files to Perforce

Parameters

SrcVer

Parameter SrcVer = "$Id: //iris/2024.3.0/databases/sys/cls/Studio/SourceControl/UI.xml#1 $";

This Parameter should be updated when synced from Perforce

Version

Parameter Version = 106;

Revision number of this class when compiled as part of the //custom_ccrs/_common/config/... branch. This version will not be updated (by design) when the class is integrated to other branches. This allows the user to tell what version of the Studio client tools are in use.

SECURITYRESOURCE;

Parameter SECURITYRESOURCE;

Do not accept the default SECURITYRESOURCE from the superclass as this page handles it's own security to allow TrakCare use-cases

NOTE - this parameter is not enforced until 2012.2

Methods

OnPage

ClassMethod OnPage() As %Status [ ServerOnly = 1 ]

Event handler for PAGE event: this is invoked in order to generate the content of a csp page.

UpdateSession

ClassMethod UpdateSession()
ClassMethod MenuDisplay()

LoginDisplay

ClassMethod LoginDisplay(Output pContinue As %Boolean = 1)

If login needed (connected multi-developer instance), displays/processes the login form. Other UIs can call this and examine pLoggedIn to determine if processing should continue.

ClearP4Ticket

ClassMethod ClearP4Ticket()

Handles case of an invalid perforce ticket. Clears the cache and refreshes the page.

ShelveFile

ClassMethod ShelveFile(file As %String)

Shelve a given file in the current selected changelist

UnshelveFile

ClassMethod UnshelveFile(file As %String)

Unshelve a given shelved file from the current selected changelist, into the same changelist

SwitchChangelist

ClassMethod SwitchChangelist(newChangelist)

Store the new changelist number in %session.Data if switching changelists on check-in page

CheckinDisplay

ClassMethod CheckinDisplay(DisplayForm As %Boolean)

Page for checking in files from perforce changelists in the current workspace. Only valid for connected clients.

DownloadDisplay

ClassMethod DownloadDisplay(DisplayForm As %Boolean)

LoadDisplay

ClassMethod LoadDisplay(DisplayForm As %Boolean)

IsNoUploadException

ClassMethod IsNoUploadException(name As %String) As %Boolean

Given an internal name of an item, determine if it is an exception for the NoUpload flag

BundleDisplay

ClassMethod BundleDisplay(DisplayForm As %Boolean)

UploadDisplay

ClassMethod UploadDisplay(DisplayForm As %Boolean)

ItemsetlogDisplay

ClassMethod ItemsetlogDisplay(DisplayForm As %Boolean)

ItemsetautodownloadDisplay

ClassMethod ItemsetautodownloadDisplay()

ItemsethistoryDisplay

ClassMethod ItemsethistoryDisplay()

SummaryDisplay

ClassMethod SummaryDisplay()

RefreshDisplay

ClassMethod RefreshDisplay(DisplayForm As %Boolean)

SystemdefaultsDisplay

ClassMethod SystemdefaultsDisplay(DisplayForm As %Boolean)

Runs the Ens.Config.DefaultSettings.%Export method

DiffDisplay

ClassMethod DiffDisplay()

Displays a diff between the file passes in the file url parameter and file_".bak" if it exists

ValidateCCRUpload

ClassMethod ValidateCCRUpload(pRID = "")

Called from UI Bundle page to validate whether an ItemSet can be uploaded for a given CCR Updates elements on the page according to the status

RetrieveCCRDetails

ClassMethod RetrieveCCRDetails(pRID = "", pToken = "")

Retrieve details of the requested CCR and update the UI with the details

DiffEnabled

ClassMethod DiffEnabled() As %Boolean [ CodeMode = expression ]

Returns boolean value indicated whether or not the diff UI can be displayed

Set ^SYS("SourceControl","UIConfig","DisableDiff")=1 to disable diff for a specific namespace

Set ^%SYS("SourceControl","UIConfig","DisableDiff")=1 to disable diff for the entire instance

ConvertStreamToHTML

ClassMethod ConvertStreamToHTML(pStream) As %Stream.GlobalCharacter
ClassMethod SelfLink() [ CodeMode = expression ]

Link to this page

ValidateDiffDisplay

ClassMethod ValidateDiffDisplay() [ Internal ]

This method displays validation logic for the included diff_match_patch diff JS To use, you must put the following into /CSP/sys: //custom_ccrs/_common/config/internal/testing/manual_tests/UI.diff_match_patch_test.html //custom_ccrs/_common/config/internal/testing/manual_tests/diff_match_patch_test.js NOTE: The above files are not to be distributed in product; they are only for manually validating the diff functionality Access this test via http://localhost:/csp/sys/%25Studio.SourceControl.UI.cls?action=validatediff

GetParameter

ClassMethod GetParameter(Parameter) As %String [ CodeMode = objectgenerator ]

Pages inheriting from %CSP.Page don't have a %GetParameter() method until 2010.2. This method allows access to the parameter values in the class from outside of the class

AllowedApps

ClassMethod AllowedApps() As %String [ CodeMode = expression ]

CSP Applications allowed to access this UI.

To add web applications to the return list, set ^%SYS("SourceControl","AllowedApps")=$lb(app1,app2,...). NOTE: app1, app2, etc must have a trailing '/', e.g. ^%SYS("SourceControl","AllowedApps")=$lb("/csp/users/")

PerforceLogin

ClassMethod PerforceLogin(Password) As %Status

Accepts the password for the current Perforce user (defined by $USERNAME) and validates password by attempting to log into Perforce and obtain a IP-bound ticket
If login is successful, ticket is stored in the session to be reused on later calls to Perforce
If Password is not defined, then the locally cached ticket will be cleared

PerforceLoggedIn

ClassMethod PerforceLoggedIn() As %Boolean

Returns true if the user has a valid Perforce ticket in the CSP session, otherwise returns false.
Also obtains and validate an existing ticket.
This also inializes the process ticket variable, so this must be called whenever a server-side method requiring Perforce access is invoked

OnPreHTTP

ClassMethod OnPreHTTP() As %Boolean [ ServerOnly = 1 ]

Ensure that this page is only accessible through approved CSP Applications

OnToolsCompile

ClassMethod OnToolsCompile() [ CodeMode = objectgenerator, Internal ]

Handles all compile-time logic for this class

InstanceVersion

ClassMethod InstanceVersion() As %Numeric [ CodeMode = expression ]

Returns value the Major.Minor version for this instance, so it can be used in comparison code which makes sure certain features are used in appropriate versions

WriteDiffJS

ClassMethod WriteDiffJS() [ Internal ]

////////////////////////////////////////////////////////////////////////////////////////////////////////// diff-match-patch ------------------------------------------- Obtained from: https://github.com/google/diff-match-patch at commit a6367d7866833ac037fbdefcdbcbee4def86e326 Used under Apache License 2.0 (https://github.com/google/diff-match-patch/blob/0ae308daa77aeddb089cd6b7b0a443fca026266e/LICENSE) ------------------------------------------- The Javascript code below is from https://github.com/google/diff-match-patch/blob/a6367d7866833ac037fbdefcdbcbee4def86e326/javascript/diff\_match\_patch.js //////////////////////////////////////////////////////////////////////////////////////////////////////////