implementing plugins - montegoulding/lcVCS GitHub Wiki

lcVCS has a plugin api so that you can extend it to support your own custom controls, libraries etc. Plugins are loaded by lcVCS during export and import of the stackFiles. The API consists of some custom properties used by lcVCS to work out what kind the plugin needs to do and commands that are dispatched to the plugin stack.

Custom properties

uCustomPropertySet

A list of custom property sets that the plugin should be applied to

uCustomPropertyKey

A list of custom property keys that the plugin should be applied to

uResolveUUIDs

A boolean property indicating the plugin needs to resolve UUIDs

uScript

A boolean property indicating the plugin should be called on scripts

uDefault

A boolean property indicating the plugin should be active by default on new projects. Use this for things that cause trouble if they aren't default. A good example is the dgProps plugin that would break datagrids if it weren't used.

uDescription

A brief description to show in the plugin checklist. If empty then the checklist will show the stack name.

Commands

command lcVCSFilterExportedProps pObject, @pProps, @pUserStateProps

Called during export for each object that has the property.

pObject - The long id of the object being exported

pProps - The value of the custom property or custom property set. The prarmeter is called by reference so changes made to it will be reflected in the exported property. For example, delete variable pProps will mean the property won't be exported. See the cREVGeneralAll plugin as an example of this.

pUserStateProps - If you have properties that are specific to the user and will change from one user to the next like a local path then you can move them to the pUserStateProps variable and then delete them from pProps. This will mean the value will be exported in the userstate.json file which can be ignored by the VCS (e.g .gitignore)

While it can be used for other things the core purpose for this command is to translate any object references to the UUID of the object. See the dgProps plugin for an example where the row template is translated to a UUID. Use the UUIDForObject function to get the UUID to replace your object reference with.

command lcVCSRegisterUUIDsToResolve pObject,@pUUIDsToResolve

Called during import for each object that has the property on plugins that have uResolveUUIDs

pObject - The long id of the object being exported

*pUUIDsToResolve - Set this parameter to a list of UUIDs that need resolving. It will be empty when the command is called.

The purpose for this command is let lcVCS know which UUIDs need to be resolved at the end of the export. See the dgProps plugin for an example where the row template is translated to a UUID.

command lcVCSResolveUUIDs pObject

Called at the end of import for each object that has the property on plugins that have uResolveUUIDs

pObject - The long id of the object being exported

The purpose for this command is to translate the UUID back to an object reference. Use the ObjectForUUID function to tranlate them. See the dgProps plugin for an example where the row template is translated to a UUID.

command lcVCSFilterExportedScript pObject,@pScript

Called during export for each object with a script on a plugin has uScript true

pObject - The long id of the object being exported

pScript - The script of the object. Changes to pScript will be reflected in the exported file.

See the LicenseHeader plugin as an example of a script plugin.

command lcVCSFilterImportedScript pObject,@pScript

Called during import for each object with a script on a plugin has uScript true

pObject - The long id of the object being exported

pScript - The script of the object. Changes to pScript will be reflected in the imported stackFile.

See the LicenseHeader plugin as an example of a script plugin. You could use this command to generate documentation etc.