Hello
Is it possible to create a new portfolio using a script? In particular, within Photo Supreme, a new portfolio is easily created in the 'Portfolios' tab by clicking on the '+ New Portfolio' button. How can this action be duplicated in a script?
I have been able to create a new portfolio by using the GUIDs (and procedure CheckPortfolio) as given in the script 'Migrate EM-iView CatalogSets to Portfolio.psc' but I wish to be able to create a new named portfolio with it's own unique GUID(s).
Any help appreciated.
Create new portfolio using script?
Re: Create new portfolio using script?
Here's a snipped that creates a portfolio in the catalog;
A few things to be aware of when you're working with Portfolios using the Object Model:
1. Over the years, a Portfolio have changed name from Model to Album to Portfolio. You'll find traces of all three in the codebase
2. In the first implementation, a Portfolio used to have three levels: portfolio, gallery, collection (and sub collections). Over the years, the Gallery level got eliminated. But in the Object Model that level still exists. Every Portfolio now always has exactly one Gallery. The gallery level is ignored in the User Interface. But be aware that the top level Collections have this (implicit) gallery as the parent, and not the Portfolio.
Code: Select all
var
APortfolio: TImageModel;
begin
APortfolio := TImageModel.Create(nil);
try
APortfolio.ModelName := 'A scripted portfolio';
PublicCatalog.StoreModelToDatabase(APortfolio);
Say('Portfolio ' + APortfolio.ModelName + ' was created');
finally
APortfolio.Free;
end;
end;
1. Over the years, a Portfolio have changed name from Model to Album to Portfolio. You'll find traces of all three in the codebase
2. In the first implementation, a Portfolio used to have three levels: portfolio, gallery, collection (and sub collections). Over the years, the Gallery level got eliminated. But in the Object Model that level still exists. Every Portfolio now always has exactly one Gallery. The gallery level is ignored in the User Interface. But be aware that the top level Collections have this (implicit) gallery as the parent, and not the Portfolio.
This is a user-to-user forum. If you have suggestions, requests or need support then please send a message
Re: Create new portfolio using script?
That's great Hert. Just tried your snippet, which does exactly what I wanted. Excellent.
Many thanks for the details regarding the Object Model too. Hadn't really understood the Portfolio-Gallery connection before. And didn't know about the legacy naming either - very useful info - can make more sense of the codebase now.
Many thanks for your help.
Regards
Mike
Many thanks for the details regarding the Object Model too. Hadn't really understood the Portfolio-Gallery connection before. And didn't know about the legacy naming either - very useful info - can make more sense of the codebase now.
Many thanks for your help.
Regards
Mike