Skip to main content
Tweeted twitter.com/#!/StackTridion/status/595984276073652225
improved formatting and spelling
Source Link
Bart Koopman
  • 29.6k
  • 3
  • 40
  • 90

How to fetch the list of all the localized and locally created componentsComponents in a folderFolder for a particular publicationPublication using core service?

How to fetch the list of all the localized and locally created componentsComponents in a folderFolder for a particular publicationPublication using core service  ? Currently

Currently I am first fetching all the componentsComponents using the following code.

     public static IEnumerable<XNode> GetFolderItems(string folderUri, ItemType itemType)
    {
        OrganizationalItemItemsFilterData filter = new OrganizationalItemItemsFilterData();
        IEnumerable<XNode> folderItems = null;
        XElement folderData = null;
        filter.ItemTypes = new[] { ItemType.Component };
        filter.Recursive = true;
        folderData = Client.GetListXml(folderUri, filter);
        folderItems = folderData != null ? folderData.Nodes() : null;
        return folderItems;
}
public static IEnumerable<XNode> GetFolderItems(string folderUri, ItemType itemType)
{
    OrganizationalItemItemsFilterData filter = new OrganizationalItemItemsFilterData();
    IEnumerable<XNode> folderItems = null;
    XElement folderData = null;
    filter.ItemTypes = new[] { ItemType.Component };
    filter.Recursive = true;
    folderData = Client.GetListXml(folderUri, filter);
    folderItems = folderData != null ? folderData.Nodes() : null;
    return folderItems;
}

After fetching the folder components thanFolder Components, then for each folderFolder item I call the following method to fetch the localized/locally created status.

    public static bool GetComponentLocalizedStatus(string componentUri)
    {
    ComponentData componentdata;
    bool status = false;
    componentdata = Client.Read(componentUri, new ReadOptions()) as ComponentData;
    if (componentdata.BluePrintInfo.IsShared == false)
    {
       status = true;
    }
    else
       status = false;
    return status;
    }
public static bool GetComponentLocalizedStatus(string componentUri)
{
    ComponentData componentdata;
    bool status = false;
    componentdata = Client.Read(componentUri, new ReadOptions()) as ComponentData;
    if (componentdata.BluePrintInfo.IsShared == false)
    {
       status = true;
    }
    else
       status = false;
    return status;
}

This approach is not efficient. Is there a way to fetch the locally created/ localized componentsComponents present in a folderFolder in single go  ? .

How to fetch the list of all the localized and locally created components in a folder for a particular publication using core service?

How to fetch the list of all the localized and locally created components in a folder for a particular publication using core service  ? Currently I am first fetching all the components using the following code.

     public static IEnumerable<XNode> GetFolderItems(string folderUri, ItemType itemType)
    {
        OrganizationalItemItemsFilterData filter = new OrganizationalItemItemsFilterData();
        IEnumerable<XNode> folderItems = null;
        XElement folderData = null;
        filter.ItemTypes = new[] { ItemType.Component };
        filter.Recursive = true;
        folderData = Client.GetListXml(folderUri, filter);
        folderItems = folderData != null ? folderData.Nodes() : null;
        return folderItems;
}

After fetching the folder components than for each folder item I call the following method to fetch the localized/locally created status.

    public static bool GetComponentLocalizedStatus(string componentUri)
    {
    ComponentData componentdata;
    bool status = false;
    componentdata = Client.Read(componentUri, new ReadOptions()) as ComponentData;
    if (componentdata.BluePrintInfo.IsShared == false)
    {
       status = true;
    }
    else
       status = false;
    return status;
    }

This approach is not efficient. Is there a way to fetch the locally created/ localized components present in a folder in single go  ? .

How to fetch the list of all the localized and locally created Components in a Folder for a particular Publication using core service?

How to fetch the list of all the localized and locally created Components in a Folder for a particular Publication using core service?

Currently I am first fetching all the Components using the following code.

public static IEnumerable<XNode> GetFolderItems(string folderUri, ItemType itemType)
{
    OrganizationalItemItemsFilterData filter = new OrganizationalItemItemsFilterData();
    IEnumerable<XNode> folderItems = null;
    XElement folderData = null;
    filter.ItemTypes = new[] { ItemType.Component };
    filter.Recursive = true;
    folderData = Client.GetListXml(folderUri, filter);
    folderItems = folderData != null ? folderData.Nodes() : null;
    return folderItems;
}

After fetching the Folder Components, then for each Folder item I call the following method to fetch the localized/locally created status.

public static bool GetComponentLocalizedStatus(string componentUri)
{
    ComponentData componentdata;
    bool status = false;
    componentdata = Client.Read(componentUri, new ReadOptions()) as ComponentData;
    if (componentdata.BluePrintInfo.IsShared == false)
    {
       status = true;
    }
    else
       status = false;
    return status;
}

This approach is not efficient. Is there a way to fetch the locally created/ localized Components present in a Folder in single go?

deleted 85 characters in body
Source Link

How to fetch the list of all the localized and locally created components in a folder for a particular publication using core service ? Currently I am first fetching all the components using the following code.

     public static IEnumerable<XNode> GetFolderItems(string folderUri, ItemType itemType)
    {
        OrganizationalItemItemsFilterData filter = new OrganizationalItemItemsFilterData();
        RepositoryItemsFilterData filterRepo = new RepositoryItemsFilterData();
        IEnumerable<XNode> folderItems = null;
        XElement folderData = null;
        filter.ItemTypes = new[] { ItemType.Component };
        filter.Recursive = true;
        folderData = Client.GetListXml(folderUri, filter);
        folderItems = folderData != null ? folderData.Nodes() : null;
        return folderItems;
}

After fetching the folder components than for each folder item I call the following method to fetch the localized/locally created status.

    public static bool GetComponentLocalizedStatus(string componentUri)
    {
    ComponentData componentdata;
    bool status = false;
    componentdata = Client.Read(componentUri, new ReadOptions()) as ComponentData;
    if (componentdata.BluePrintInfo.IsShared == false)
    {
       status = true;
    }
    else
       status = false;
    return status;
    }

This approach is not efficient. Is there a way to fetch the locally created/ localized components present in a folder in single go ? .

How to fetch the list of all the localized and locally created components in a folder for a particular publication using core service ? Currently I am first fetching all the components using the following code.

     public static IEnumerable<XNode> GetFolderItems(string folderUri, ItemType itemType)
    {
        OrganizationalItemItemsFilterData filter = new OrganizationalItemItemsFilterData();
        RepositoryItemsFilterData filterRepo = new RepositoryItemsFilterData();
        IEnumerable<XNode> folderItems = null;
        XElement folderData = null;
        filter.ItemTypes = new[] { ItemType.Component };
        filter.Recursive = true;
        folderData = Client.GetListXml(folderUri, filter);
        folderItems = folderData != null ? folderData.Nodes() : null;
        return folderItems;
}

After fetching the folder components than for each folder item I call the following method to fetch the localized/locally created status.

    public static bool GetComponentLocalizedStatus(string componentUri)
    {
    ComponentData componentdata;
    bool status = false;
    componentdata = Client.Read(componentUri, new ReadOptions()) as ComponentData;
    if (componentdata.BluePrintInfo.IsShared == false)
    {
       status = true;
    }
    else
       status = false;
    return status;
    }

This approach is not efficient. Is there a way to fetch the locally created/ localized components present in a folder in single go ? .

How to fetch the list of all the localized and locally created components in a folder for a particular publication using core service ? Currently I am first fetching all the components using the following code.

     public static IEnumerable<XNode> GetFolderItems(string folderUri, ItemType itemType)
    {
        OrganizationalItemItemsFilterData filter = new OrganizationalItemItemsFilterData();
        IEnumerable<XNode> folderItems = null;
        XElement folderData = null;
        filter.ItemTypes = new[] { ItemType.Component };
        filter.Recursive = true;
        folderData = Client.GetListXml(folderUri, filter);
        folderItems = folderData != null ? folderData.Nodes() : null;
        return folderItems;
}

After fetching the folder components than for each folder item I call the following method to fetch the localized/locally created status.

    public static bool GetComponentLocalizedStatus(string componentUri)
    {
    ComponentData componentdata;
    bool status = false;
    componentdata = Client.Read(componentUri, new ReadOptions()) as ComponentData;
    if (componentdata.BluePrintInfo.IsShared == false)
    {
       status = true;
    }
    else
       status = false;
    return status;
    }

This approach is not efficient. Is there a way to fetch the locally created/ localized components present in a folder in single go ? .

Source Link

How to fetch the list of all the localized and locally created components in a folder for a particular publication using core service?

How to fetch the list of all the localized and locally created components in a folder for a particular publication using core service ? Currently I am first fetching all the components using the following code.

     public static IEnumerable<XNode> GetFolderItems(string folderUri, ItemType itemType)
    {
        OrganizationalItemItemsFilterData filter = new OrganizationalItemItemsFilterData();
        RepositoryItemsFilterData filterRepo = new RepositoryItemsFilterData();
        IEnumerable<XNode> folderItems = null;
        XElement folderData = null;
        filter.ItemTypes = new[] { ItemType.Component };
        filter.Recursive = true;
        folderData = Client.GetListXml(folderUri, filter);
        folderItems = folderData != null ? folderData.Nodes() : null;
        return folderItems;
}

After fetching the folder components than for each folder item I call the following method to fetch the localized/locally created status.

    public static bool GetComponentLocalizedStatus(string componentUri)
    {
    ComponentData componentdata;
    bool status = false;
    componentdata = Client.Read(componentUri, new ReadOptions()) as ComponentData;
    if (componentdata.BluePrintInfo.IsShared == false)
    {
       status = true;
    }
    else
       status = false;
    return status;
    }

This approach is not efficient. Is there a way to fetch the locally created/ localized components present in a folder in single go ? .