Created
February 3, 2015 16:35
-
-
Save michaelhidalgo/5c685916b4f00f823494 to your computer and use it in GitHub Desktop.
Export articles to a new library.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var defaultServer = "http://localhost:12120"; | |
var userName ="admin"; | |
var passWord ="!!tmadmin"; | |
var path = @"C:\TM3.6\Library_Data\XmlDatabase\TM_Libraries\Lib_UNO-master"; | |
var libraryName = @"ArticlesNotInViews"; | |
var originalLibrary= @"Guidance"; | |
List<String> articleIds = new List<String>(); | |
var teamMentor = defaultServer.connectToServer(true,userName, passWord); | |
bool result =teamMentor.login(userName,passWord); | |
var newLib = teamMentor.library(libraryName).delete().library(libraryName); | |
teamMentor.load_LibraryData(); | |
//Finding orinal library | |
var library = teamMentor.library(originalLibrary); | |
var allArticles = library.articles(); | |
var wantedArticles = library.Articles_Not_In_Views; | |
//Retrieving all the articles (converted to articles) that are not in views | |
var residualArticles = allArticles.Where(x => wantedArticles.Exists(a => a.Id == x.Id)).ToList(); | |
foreach(var article in residualArticles){ | |
newLib.add_Article(article); | |
} | |
return newLib; | |
return "done"; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment