public void AddFieldToClassification() { var clHelper = new ClassificationHelper(app); var classificationId = clHelper.GetId(new SearchExpression("AlexanderChechet")); Classification cl = new Classification(app); if (classificationId == null) throw new Exception("Can't find classification"); cl.Load(classificationId.Value); var fieldHelper = new FieldDefinitionHelper(app); var fieldId = fieldHelper.GetId(new SearchExpression("Name=AlexanderChechet_multi")); if (fieldId == null) throw new Exception("Can't find field"); cl.RegisteredFields.Add(fieldId.Value); cl.Save(); }
static void Main(string[] args) { Application app = new Application(); LogOnStatus status = app.LogOn("LUXDAM", "Eduard_Pasmetukhau", "P2ssw0rd!"); if (status == LogOnStatus.LoggedOn) { Console.WriteLine("Ok"); } else Console.WriteLine(status); Classification c = new Classification(app); ClassificationHelper ch = new ClassificationHelper(app); Guid? rootGuid= ch.GetId(new SearchExpression("name = 'Luxottica Content*'")); Console.WriteLine("List of classification with parent Luxottica Content"); //Console.ReadKey(); if (rootGuid != null) { ClassificationCollection classCollections = new ClassificationCollection(app); classCollections.Load(new SearchExpression(String.Format("parent = '{0}'", rootGuid))); foreach (Classification classification in classCollections) { Console.WriteLine(classification.Label + " Guid: "+classification.Id); } } Console.WriteLine(); Console.ReadKey(); Console.WriteLine("First 10 Guids of Records in classification Luxottica Content"); RecordCollection rc = new RecordCollection(app); rc.Load(new SearchExpression(String.Format("classification = '{0}'", rootGuid))); foreach (Record r in rc.Take<Record>(10)) { Console.WriteLine(r.Id); } Console.ReadKey(); }
public void AddFilesToClassification() { var clHelper = new ClassificationHelper(app); var clId = clHelper.GetId(new SearchExpression("AlexanderChechet")); Classification cl = new Classification(app); if (clId == null) throw new Exception("Can't find classification"); var descriptions = new Dictionary<string, string>() { {"English", "123"}, {"Russian", "456"}, {"German", "789"}, }; AddRecord(@"D:\Films\Pictures\2Ax0212.jpg", clId.Value, descriptions); AddRecord(@"D:\Films\Pictures\1079.jpg",clId.Value, descriptions); AddRecord(@"D:\Films\Pictures\2006-000.jpg",clId.Value, descriptions); AddRecord(@"D:\Films\Pictures\entry.jpg",clId.Value, descriptions); }