Ejemplo n.º 1
0
        /// <summary>
        /// Gets the used items of source item.
        /// </summary>
        /// <param name="client">Tridion client object.</param>
        /// <param name="tcmItem">Item TCM id.</param>
        /// <param name="itemTypes">The item types.</param>
        /// <returns></returns>
        public static List <string> GetUsedItems(IAlchemyCoreServiceClient client, string tcmItem, ItemType[] itemTypes = null)
        {
            UsedItemsFilterData filter = new UsedItemsFilterData();

            filter.BaseColumns = ListBaseColumns.Id;
            if (itemTypes != null)
            {
                filter.ItemTypes = itemTypes;
            }

            List <string> items = client.GetListXml(tcmItem, filter).ToList().Select(x => x.TcmId).ToList();

            return(items);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets using items of source item. All revisions discovered
        /// </summary>
        /// <param name="client">Tridion client object.</param>
        /// <param name="tcmItem">Item TCM id.</param>
        /// <param name="current">if set to <c>true</c> [current].</param>
        /// <param name="itemTypes">The item types.</param>
        /// <returns></returns>
        public static List <string> GetUsingItems(IAlchemyCoreServiceClient client, string tcmItem, bool current = false, ItemType[] itemTypes = null)
        {
            UsingItemsFilterData filter = new UsingItemsFilterData();

            filter.IncludedVersions = current ? VersionCondition.OnlyLatestVersions : VersionCondition.AllVersions;
            filter.BaseColumns      = ListBaseColumns.Id;
            if (itemTypes != null)
            {
                filter.ItemTypes = itemTypes;
            }

            List <string> items = client.GetListXml(tcmItem, filter).ToList().Select(x => x.TcmId).ToList();

            return(items);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Gets Tridion items by parent container.
 /// </summary>
 /// <param name="client">Tridion client object.</param>
 /// <param name="tcmContainer">The TCM container.</param>
 /// <param name="recursive">if set to <c>true</c> [recursive].</param>
 /// <param name="schemaPurposes">schema types</param>
 /// <returns></returns>
 public static List <ItemInfo> GetItemsByParentContainer(IAlchemyCoreServiceClient client, string tcmContainer, bool recursive, SchemaPurpose[] schemaPurposes)
 {
     return(client.GetListXml(tcmContainer, new OrganizationalItemItemsFilterData {
         Recursive = recursive, ItemTypes = new ItemType[] { ItemType.Schema }, SchemaPurposes = schemaPurposes
     }).ToList());
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Gets Tridion items from parent container (folder, structure group, category).
 /// </summary>
 /// <param name="client">Tridion client object.</param>
 /// <param name="tcmContainer">The TCM container.</param>
 /// <param name="recursive">if set to <c>true</c> [recursive].</param>
 /// <returns></returns>
 public static List <ItemInfo> GetItemsByParentContainer(IAlchemyCoreServiceClient client, string tcmContainer, bool recursive)
 {
     return(client.GetListXml(tcmContainer, new OrganizationalItemItemsFilterData {
         Recursive = recursive
     }).ToList());
 }
Ejemplo n.º 5
0
 public static List <ItemInfo> GetContainersByPublication(IAlchemyCoreServiceClient client, string tcmPublication)
 {
     return(client.GetListXml(tcmPublication, new RepositoryItemsFilterData {
         ItemTypes = new[] { ItemType.Folder, ItemType.StructureGroup }
     }).ToList());
 }
Ejemplo n.º 6
0
 public static List <ItemInfo> GetKeywordsByCategory(IAlchemyCoreServiceClient client, string tcmCategory)
 {
     return(client.GetListXml(tcmCategory, new OrganizationalItemItemsFilterData {
         ItemTypes = new[] { ItemType.Keyword }
     }).ToList(ItemType.Keyword));
 }