Skip to main content
1-Visitor
April 17, 2014
Question

useful custom commands

  • April 17, 2014
  • 3 replies
  • 9606 views

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)

    3 replies

    21-Topaz I
    April 17, 2014

    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:

    IM+Variables.png

    SI/Configuration Management Variables:

    SI+Variables.png

    1-Visitor
    April 17, 2014

    or running a bat file with

    SET MKSSI & pause

    Note the available variables depends on the current View.

    1-Visitor
    April 17, 2014
    • Copy to clipboard is a very good one.

    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.

    • Check-out with no lock to resync the head revisions
    • Get / Download a file/ subproject
    • Locate file in Explorer from Sandbox view
    • Resync excluding file locked by me (resync --filter=!locked:%USERNAME%)
    • Get document baseline label and copy to clipboard
    • ViewDoc As of with baseline selection from document view.

    ...

    10-Marble
    February 18, 2016

    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.

    12-Amethyst
    February 13, 2017

    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

    tketz1-VisitorAuthor
    1-Visitor
    February 29, 2016

    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.

    1-Visitor
    March 9, 2016

    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

    12-Amethyst
    January 24, 2017

    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