Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Folder template Fields
NAYLAND
Hi
We are creating search folders from a template. We can create the search folders OK and can add search parameters i.e.
if (folderToAdd.ObjectType.ObjectType == imObjectType.imTypeDocumentSearchFolder)
{
IManProfileSearchParameters profparms = null;
ManStringsClass mstrings = null;
mstrings = new ManStringsClass();
profparms = DMSManager.Instance.Dms.CreateProfileSearchParameters();
profparms.Add(imProfileAttributeID.imProfileCustom1, clientNumber);
profparms.Add(imProfileAttributeID.imProfileType, "MIME");
List _interwovenDatabases;
_interwovenDatabases = Pkf.Interwoven.SDKWrapper.Helpers.Utils.CommaSeperatedDatabaseListToStringArray(ConfigSettings.GetConfigValue("InterwovenDatabases"));
foreach (string database in _interwovenDatabases)
{
mstrings.Add(database);
}
IManDocumentSearchFolder sf = newWorkspaceDocumentSearchFolders.AddNewDocumentSearchFolderInheriting(ReplaceAlias, folderToAdd.Description, mstrings, profparms);
sf.Update();
}
The thing is the "MIME" search parameter is, as you can see, hard coded. This is actually held in the Application field for the template (the folderToAdd is the current folder we have from the template folder) and I would like to take this field from the template in case they change thier mind about it being "MIME". But I don't know how the Application field is exposed - I cant find it in any properties etc. So how do i access the properties of the template folder?
Cheers.
Find more posts tagged with
Comments
Migrateduser
If you are storing in the additional property you can get as
folderToAdd.AdditionalProperties.ItemByName("iMan___6" ).Value; //if you are using class
if you have your custom property you can get as
folderToAdd.AdditionalProperties.ItemByName('yourpropertyname').Value;
Thanks
Sheetal
sheetal@prosperoware.com
http://www.prosperoware.com
NAYLAND
Thank you for your reply - unfortunately when I check the additional properties for the folderToAdd the AdditionalProperties count is zero. I have also checked CustomProperties and there is nothing on those either.
NAYLAND
OK Found the problem. Me.
I was casting the folder as a documentfolder but this is actually a search folder. Once I cast it to a document serach folder I could then get the profile type from the ProfileSearchParameters.
IManDocumentSearchFolder folderToAddSearch = (IManDocumentSearchFolder)folderToAdd;
IManProfileSearchParameters profparms = null;
ManStringsClass mstrings = null;
mstrings = new ManStringsClass();
profparms = DMSManager.Instance.Dms.CreateProfileSearchParameters();
profparms.Add(imProfileAttributeID.imProfileCustom1, clientNumber);
profparms.Add(imProfileAttributeID.imProfileType, folderToAddSearch.ProfileSearchParameters.ItemByAttribute(imProfileAttributeID.imProfileType).Value);