Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
Hi,
i'm looking for some useful custom commands.
At the moment we have custom commands for:
Copy SI Link to clipboard
Copy IM Link to clipboard
View Sandbox in Windows Explorer
i would be pleased if i get some new ideas (or a we can create a list) of useful custom commands (maybe with code)
I do not have any particular pre-formed custom commands but if you make a custom buttom to run "cmd.exe" on Windows, you will open a command prompt which shows you the environment variables the client uses. You can use these variables in custom buttons in Integrity.
IM/Workflows and Documents variables:
SI/Configuration Management Variables:
or running a bat file with
SET MKSSI & pause
Note the available variables depends on the current View.
Almost everything in all views (project,sandbox,archive,documentview, issue, issues, projecthistory, projectlist, editissue, relationships).
Not only links but also IDs to paste in relationships fields.
...
I have written an (ugly) command script (other languages are not available at this time). It has 3 functions (selected by one of the parameters: clipboard im explorer😞 save selected path / IM-IDs to clipboard and start explorer in dedicated sub-project.
You can use this script "as is", I won't take any responsibilities for it.
Maybe someone will extend this and share it here so that other users can take profit.
I would say the "uglyness" is encouraged by the ugly windows batch language as well as by the way the contextual information
is presented to the user tool/script
Just alone for an explore here user script I stumbled over a bunch of implicit use cases.
Here my ugly version (tested on Build 10.4.0.4301 API Version 4.12.4301):
Feedback and improvement suggestions welcomed
Jürgen
SI_user_action_explore_here.bat |
---|
echo off SETLOCAL ENABLEDELAYEDEXPANSION prompt $P$G echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ REM DEBUG: print out all relevant environment variables set MKSSI_ echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @echo WORKING_DIR:%cd% color cf if NOT "%MKSSI_WINDOW%" == "sandbox" ( echo ERROR: Window must be a sandbox pause exit ) if NOT "%MKSSI_SUBPROJECT2%X" == "X" ( echo ERROR: Multiple selection not supported pause exit ) if NOT "%MKSSI_MEMBER2%X" == "X" ( REM this can also happen if a subfolder (not subproject) is selected in the GUI REM then all members (recursive) within the subfolder are presented as selected echo ERROR: Multiple selection not supported pause exit ) color 9F REM set the default directory change targets to current directory set CD1=. set CD2=. REM the main trick to land on the desired directory without parsing REM is to pretend the project file or membername being directories REM eg cd /D "D:\sandboxes\project1\project.pj\.." will land in directory D:\sandboxes\project1 if NOT "%MKSSI_SUBPROJECT1%X" == "X" ( echo SUBPROJECT selected set CD1=%MKSSI_SUBPROJECT1%\.. ) else if NOT "%MKSSI_NMEMBER%" == "0" ( echo MEMBER selected set CD1=%MKSSI_MEMBER1_SANDBOX%\.. set CD2=%MKSSI_MEMBER1%\.. ) else ( echo PROJECT selected set CD1=%MKSSI_FILE%\.. ) echo CD1: %CD1% echo CD2: %CD2% cd /D "%CD1%" if NOT "%CD2%" == "." ( dir "%MKSSI_MEMBER1%" echo err: !errorlevel! if !errorlevel! == 0 ( REM the working file exists REM the following should also work if membername has format folderX\membername explorer /select, "%MKSSI_MEMBER1%" ) else ( REM working file missing REM the following cd may fail if for membername format folderX\membername REM also directory folderX is missing in the sandbox REM then we will land/stay in the directory %MKSSI_MEMBER1_SANDBOX% cd /D "%CD2%" REM you may want to check !errorlevel! to have folderX missing an illegal use case explorer /e, . )
) else ( cd /D "%CD2%" explorer /e, . ) REM pause REM cmd endlocal |
Hey all,
i'll give you a small update about our "little customs":
we decide to build our own "custom library" which is checked-in in our repository, so everybody with Integrity can use it.
Every of our clients has a loader.jar in his bin folder.
and so it works:
- example for a custom command:
Program: ..\jre\bin\javaw.exe
Parameters: -jar mkstools-loader.jar mks.tools.ViewProjectVariant
- java starts the loader
- the loader check-out the actual custom-library and start the library with the class to load (used a class-loader)
Why we do that?
- We can easily put new custom commands to the "custom library"
- we don't need to push the new function to any client
- the user only have to create his custom button with the new "class"
(here it would be perfect, if we can administrate the custom buttons of a user like the user notifications. To save the custom button information on server would also be perfect for users who works on more than one pc)
What I want to tell you is the way it works with the loader and give you some ideas:
ViewProjectVariant -> the same as "Project-OpenProject-Variant", but you can do that by right-click on a project. (Why this is not a client standard function???)
Open Windows Explorer -> Opens a Windows Explorer on the File oder FOlder you have selected (Sandbox)
Copy HTTP Link to Clipboard -> get an Link of a Member, Subproject, Item, etc.
GetInfo -> Show all Infos for Member, Projects, Sandboxes, Archives, etc. in one Window an let you copy that information.
Export with Labels -> Normally its not possible to export "Labels" to excel, because its not a field. This opens an wizard where you select a query and the field (also labels) you want to export to excel.
There are so many other ideas, we can easily implement into our library.
Hello,
Can you please tell me how to add Custom Menu Item within the Pop-Up Menu List for Project View Window?
Thank you.
Regards
First you have to create a user action in your viewset
Viewset->Customize->Actions->Custom
Then you can refer to that action through Customize This Menu (from the Pop-Up Menu List for Project View Window)
Customize This Menu -> + -> Custom
HTH Juergen
Wouldnt it be easier to maintain a single Custom-Tool
like --jar PtcCustomAction-CommandBuilder.jar
and support the user to select/build possible actions from within the gui of the custom tool?
For example calling the custon tool from a member hsitory window
would provide a set of environment variables:
MKSSI_WORKINGFILE=d:\PtcTest\dummy.txt
MKSSI_SANDBOX=d:\PtcTest\project.pj
MKSSI_PROJECT_CONFIG_PATH=#d:/server/PtcTest
MKSSI_FILE=dummy.txt
MKSSI_WINDOW=archive
MKSSI_HOST=ptchost
MKSSI_PORT=7001
MKSSI_USER=UserX
MKSSI_REVISION=1.14
MKSSI_REVISION1=1.14
The CommandBuilder could then support in creating suitable actions for MKSSI_WINDOW=archive
The built in command View Revision Information for example could then be implemented like this:
>si revisioninfo --project=%MKSSI_PROJECT_CONFIG_PATH% -r %MKSSI_REVISION% %MKSSI_FILE%
The problem with the environment variables (which, by the way, we use in our scripts, too) is that they have changed in the last Integrity versions AND that they differ from view to view. Sometimes, they are not available, sometimes they have a different content.