snipt

Ctrl+h for KB shortcuts

C#

Get the embedded schemas used in a given schema

1
2
3
4
5
6
7
/*
Originally Published by: Alexander Klock
Original URL: http://codedweapon.com/2012/12/getting-using-and-used-items-with-core-services/
*/

SessionAwareCoreServiceClient client = new SessionAwareCoreServiceClient("netTcp_2011");
XElement schemas = client.GetListXml("tcm:2-184-8", new UsedItemsFilterData { ItemTypes = new[] { ItemType.Schema } });
https://snipt.net/embed/a0e1fa76f7c2f5d3542f3f69b1c71476/
https://snipt.net/raw/a0e1fa76f7c2f5d3542f3f69b1c71476/
a0e1fa76f7c2f5d3542f3f69b1c71476
csharp
C#
8
2016-09-19T08:31:47
True
False
False
/api/public/snipt/51724/
get-the-embedded-schemas-used-in-a-given-schema
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="cm">/*</span> </span><span id="L-2"><a name="L-2"></a><span class="cm">Originally Published by: Alexander Klock</span> </span><span id="L-3"><a name="L-3"></a><span class="cm">Original URL: http://codedweapon.com/2012/12/getting-using-and-used-items-with-core-services/</span> </span><span id="L-4"><a name="L-4"></a><span class="cm">*/</span> </span><span id="L-5"><a name="L-5"></a> </span><span id="L-6"><a name="L-6"></a><span class="n">SessionAwareCoreServiceClient</span> <span class="n">client</span> <span class="p">=</span> <span class="k">new</span> <span class="n">SessionAwareCoreServiceClient</span><span class="p">(</span><span class="s">&quot;netTcp_2011&quot;</span><span class="p">);</span> </span><span id="L-7"><a name="L-7"></a><span class="n">XElement</span> <span class="n">schemas</span> <span class="p">=</span> <span class="n">client</span><span class="p">.</span><span class="n">GetListXml</span><span class="p">(</span><span class="s">&quot;tcm:2-184-8&quot;</span><span class="p">,</span> <span class="k">new</span> <span class="n">UsedItemsFilterData</span> <span class="p">{</span> <span class="n">ItemTypes</span> <span class="p">=</span> <span class="k">new</span><span class="p">[]</span> <span class="p">{</span> <span class="n">ItemType</span><span class="p">.</span><span class="n">Schema</span> <span class="p">}</span> <span class="p">});</span> </span></pre></div> </td></tr></table>
"Core Service", Tridion

C#

Getting all components using a given keyword (ClassifiedItemsFilterData method)

1
2
3
4
5
6
/*
Originally Published by: Alexander Klock
Original URL: http://codedweapon.com/2012/12/getting-using-and-used-items-with-core-services/
*/

XElement components = client.GetListXml("tcm:2-213-1024", new ClassifiedItemsFilterData());
https://snipt.net/embed/c1e351e30c27e9df729cb316cb54e320/
https://snipt.net/raw/c1e351e30c27e9df729cb316cb54e320/
c1e351e30c27e9df729cb316cb54e320
csharp
C#
7
2016-09-24T14:57:56
True
False
False
/api/public/snipt/51723/
getting-all-components-using-a-given-keyword-classifieditemsfilterdata-method
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="cm">/*</span> </span><span id="L-2"><a name="L-2"></a><span class="cm">Originally Published by: Alexander Klock</span> </span><span id="L-3"><a name="L-3"></a><span class="cm">Original URL: http://codedweapon.com/2012/12/getting-using-and-used-items-with-core-services/</span> </span><span id="L-4"><a name="L-4"></a><span class="cm">*/</span> </span><span id="L-5"><a name="L-5"></a> </span><span id="L-6"><a name="L-6"></a><span class="n">XElement</span> <span class="n">components</span> <span class="p">=</span> <span class="n">client</span><span class="p">.</span><span class="n">GetListXml</span><span class="p">(</span><span class="s">&quot;tcm:2-213-1024&quot;</span><span class="p">,</span> <span class="k">new</span> <span class="n">ClassifiedItemsFilterData</span><span class="p">());</span> </span></pre></div> </td></tr></table>
"Core Service", Tridion
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.