how to list all the packages I have checked out?

纵饮孤独 提交于 2019-12-30 11:05:55

问题


I am working in a multi-user environment with models shared using CVS.

The model is large with lots of packages. Sometimes, I have a package checked out without realising it, preventing others from working with the package.

Is there some way I can list all the packages that I have checked out so that I can check in the ones I don't need?


回答1:


Enterprise Architect has a built-in query which exactly meets your needs:

  1. Open the "Find in Project" window by Ctrl+F. A search window will be displayed.

  2. On the top you will see a "search:" dropdown list which by default is set to "Simple".

  3. Choose the last option from drop down list: "My Checked-out Packages".

  4. Press the "Run" button or F5 to get the list.




回答2:


As @Uffe pointed out, I've created a JScript to solve the problem:

!INC Local Scripts.EAConstants-JScript

/*
 * Script Name: ListingCheckOutPackages
 * Author: Stepanus David Kurniawan
 * Purpose: List all packages which are checked out by this user or other user recursively
 * Date: 05-05-2014
 */

// CheckOutStatus
var csUncontrolled = 0;
var csCheckedIn = 1;
var csCheckedOutToThisUser = 2;
var csReadOnlyVersion = 3;
var csCheckedOutToAnotherUser = 4;
var csOfflineCheckedIn = 5;
var csCheckedOutOfflineByUser = 6;
var csCheckedOutOfflineByOther = 7;
var csDeleted = 8;

/*
 * Project Browser Script main function
 */
function OnProjectBrowserScript()
{
    Repository.EnsureOutputVisible( "Script" );
    Repository.ClearOutput( "Script" );

    // Get the type of element selected in the Project Browser
    var treeSelectedType = Repository.GetTreeSelectedItemType();

    switch ( treeSelectedType )
    {
        case otPackage :
        {
            // Code for when a package is selected
            var thePackage as EA.Package;
            thePackage = Repository.GetTreeSelectedObject();

            Session.Output("----------------------------------------");
            Session.Output("... listing check out packages under " + thePackage.Name + "...");

            GetSubpackage(thePackage);

            Session.Output("----------------------------------------");

            break;
        }

        default:
        {
            // Error message
            Session.Prompt( "This script does not support items of this type.", promptOK );
        }
    }
}

var depth = 0;

function GetSubpackage( thePackage )
{
    var contextPackage as EA.Package;
    contextPackage = thePackage;

    depth++;

    // Iterate through all child packages
    for (var i = 0 ; i < contextPackage.Packages.Count; i++)
    {
        var currentPackage as EA.Package;
        currentPackage = contextPackage.Packages.GetAt(i);

        //Session.Output(new Array(depth * 4 + 1).join(' ') + currentPackage.Name + currentPackage.VersionControlGetStatus());

        switch (currentPackage.VersionControlGetStatus())
        {
            case csCheckedOutToThisUser:
                Session.Output("[Checked out to this user ] " + currentPackage.XMLPath);
                break;
            case csCheckedOutToAnotherUser:
                Session.Output("[Checked out to other user] " + currentPackage.XMLPath);
                break;
        }


        // Recursively process child packages
        GetSubpackage( currentPackage );
    }

    depth--;
}

OnProjectBrowserScript();



回答3:


To my knowledge there is (in EA 10) no GUI dialog that shows you this information. What you can do is write an in-EA script of the Project Browser type to perform this check. Such a script would traverse a package hierarchy and, for each, call Package::VersionControlGetStatus().

Check the help file under Automation and Scripting -- Enterprise Architect Object Model -- Reference. The Package class is in the Repository package, and there are code samples which show you how to traverse the hierarchy.




回答4:


You can also list your locks under

Project->Security->Manage My Locks...

if you are using lock based access control.




回答5:


For EA 12 as states the best answer is applicable next additional steps:

  1. in the first combo set "Project status" default is "Common Searches"
  2. in the second combo will be selected "My Checked Out Packages" by default


来源:https://stackoverflow.com/questions/22784581/how-to-list-all-the-packages-i-have-checked-out

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!