Beispiel #1
0
        // LIVE or Staging
        public void CreateNewTargetTypes()
        {
            var list = GetTargetTypes();

            // Lookup the unique names for target types in CSV
            foreach (string targetTypeName in _targets.Select(p => p.TargetType).Distinct())
            {
                // Do not add when target type is existing
                if (!list.Exists(t => t.Title == targetTypeName))
                {
                    var tt = _core.GetDefaultData(ItemType.TargetType, null) as TargetTypeData;
                    tt.Title       = targetTypeName;
                    tt.Description = targetTypeName;
                    _core.Create(tt, _readOpts);
                }
            }
        }
Beispiel #2
0
 /// <summary>
 /// Creates the specified <see cref="T:Tridion.ContentManager.CoreService.IdentifiableObjectData" /> derived class
 /// from Tridion
 /// </summary>
 /// <typeparam name="T"><see cref="T:Tridion.ContentManager.CoreService.IdentifiableObjectData" /> derived class</typeparam>
 /// <param name="objectData"><see cref="T:Tridion.ContentManager.CoreService.IdentifiableObjectData" /> derived class</param>
 /// <param name="readOptions"><see cref="T:Tridion.ContentManager.CoreService.Client.ReadOptions"/></param>
 /// <returns><see cref="T:Tridion.ContentManager.CoreService.IdentifiableObjectData" /> derived class</returns>
 internal T Create <T>(T objectData, ReadOptions readOptions) where T : IdentifiableObjectData
 {
     return(mClient.Create(objectData, readOptions) as T);
 }