Automate the creation of archiving rules
Hi,
Im trying to automate via the API the creation of Archiving rules. through alot of digging arround i've manaed to get this far
Microsoft.SharePoint.Administration.SPAdministrationWebApplication centralWeb = SPAdministrationWebApplication.Local;
string webAppUrl = centralWeb.Sites[0].Url;
using (SPSite site = new SPSite(webAppUrl/*TODO: change the url*/))
{
using (SPWeb rootWeb = site.RootWeb)
{
IConfigurationReader configurationReader = new SPConfigurationReader(rootWeb);
LivelinkConfigurationProvider configurationProvider = new LivelinkConfigurationProvider(configurationReader);
ProfileConfig profileConfig = configurationProvider.ProfileConfig;
Profile p = new Profile();
Opentext.SharePoint.Livelink.Profiles.Rule rul = new Opentext.SharePoint.Livelink.Profiles.Rule();
rul.Action = Opentext.SharePoint.Livelink.Configuration.Common.FileArchivingActionType.SyncedCopyAction;
Object obj = new object();
ArchivingFolder archfoflder = new ArchivingFolder("CS10Dev", -2000, 363613, "363613", "AGA Test", obj);
Settings set = new Settings(Opentext.SharePoint.Configuration.Common.IncludedVersionsType.All, archfoflder);
rul.Settings = set;
LLNode node = new LLNode("CS10Dev", -97926, 585326);
LLNamedNode llnode = new LLNamedNode(node, "585326", "Routine Enquiries");
rul.RMClassification = llnode;
Query query = new Query("test", "<Eq><FieldRef Name='File_x0020_Plan_x0020_No'/><Value Type='Lookup'>1/5/2/1 Budget Speech</Value></Eq>", true, true);
rul.Query = query;
profileConfig.Profiles[0].AddRule();
}
}
When i run it and step through i can see that i am in fact openeing the correct profile. i dont get any errors but the rule is not added. am i missing something?
thanks in advance
Categories
- All Categories
- Cloud Editions
- 1 Thrust Services
- cat as link
- 1 Core SaaS Application development
- 10 Developer Announcements
- 15 General Questions
- 33.4K TeamSite
- 141 Application Governance & Archiving
- 15.2K Designing Analytics Reports
- 1K DevShare Downloads
- Core SaaS Applications
- nested parent
- 4.3K Developing Analytics Applications
- 8.8K Documentum Developer Forum
- Media Management developer
- 159 Transactional Content Processing (TCP)
- 1.7K Web Experience Management
- 55 Tempo Social
- 1 XM Fax