Video Screencast Help
Search Video Help Close Back
to help
Not able to make it to Vision this year? Get a sampling in the Best of Vision on Demand group.

List all Collections / List all Packages

Updated: 10 May 2007 | 3 comments
itsmillertime4u's picture
8 Agree
0 Disagree
+8 8 Votes
Login to vote

I'm trying to find a way to have a script returns back all of the collections and/or packages on a NS server. I figured I could do it via the ASDK, but I can't seem to find a method that returns this. I see documentation and examples of how to modify/create a specific collection/package, but I can't seem to find a way for it to return all of them as a 'collection' so that I can run a for each loop on them, echoing/modifying the properties of each one found.

I also haven't really figured out how to find a GUID of a package. I thought I could use the "ItemManagement" "GetItemsByNameAndType" giving it a package Name, and then giving it "PackageItemEx" as the type, but no cigar. I want to modify a package using "ModifyPackageExDetail" but I need the package GUID, which I can't find.

I also can't seem to figure out how to use the "ItemDetails" class. I know how to list the memebers of a collection, but the list ends up being a list of guids, and I would like to find a way to use the "ItemDetails" to have it returns the names instead of the guid. Any help would be very appreciated.

Comments

JeffDG's picture
03
Jun
2009
1 Vote -1
Login to vote

Listing

If it's a list you want, just go in through the SQL.

select * from vCollection

select * from vSWDPackage

Screenbert's picture
16
Jun
2009
1 Vote +1
Login to vote

GetItemsByType will do just the trick!

[C#]
// See ItemManagementLib Overview for an example of setting up m_proxy.
string collectionTypeName = "Collection";
ItemDetails[] items = m_proxy.GetItemsByType(collectionTypeName);
string allItemNames = "";
foreach( ItemDetails NSItemDetails in items )
{
allItemNames += ", " + NSItemDetails.Name;
}

Screenbert