<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>I have considered this and wondered if saksmappe and moetemappe should not be part of the mappe list. It comes down to how inheritance is handled in the core.</p>
<p><br>
</p>
<p>If inheritance is joined,&nbsp;mappe exists as a table and moetmappe and saksmappe link back to the mappe table. In essence the record is distributed across two tables and most&nbsp;CRUD operations will require a SQL join. &nbsp;This is what nikita does.</p>
<p><br>
</p>
<p>The other strategy is a table per&nbsp;entity, where there is just a moetemappe and saksmappe table. There is no mappe table. In this case a call to find all mappe would require processing of saksmappe and moetemappe on their own.</p>
<p><br>
</p>
<p>My understanding of the spec is that joined is the underlying&nbsp;method they hint at is to use joined.&nbsp;</p>
<p><br>
</p>
<p>I thought it was possible to filter out saksmappe when you get all mappe. If the entity is a mappe, then it will use arkivstruktur/mappe, but if the entity is a saksmappe it will use sakarkiv/saksmappe. This should be visible now and was one of the things
 that was fixed when I did the big anti-pattern update.</p>
<p><br>
</p>
<p><br>
</p>
<p>&nbsp;- Tom</p>
<p><br>
</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> nikita-noark-bounces@nuug.no &lt;nikita-noark-bounces@nuug.no&gt; on behalf of Petter Reinholdtsen &lt;pere@hungry.com&gt;<br>
<b>Sent:</b> Tuesday, May 23, 2017 8:20:29 PM<br>
<b>To:</b> nikita-noark@nuug.no<br>
<b>Subject:</b> How to know the class of an entity?</font>
<div>&nbsp;</div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText"><br>
Using the API, is there a well known way to figure the class of an<br>
entity?&nbsp; I have not seen it described in the spec.&nbsp; It might remove the<br>
need for a .../arkivdel/&lt;id&gt;/saksmappe endpoint, as I could instead use<br>
the .../arkivdel/&lt;id&gt;/mappe endpoint and filter out entities without the<br>
saksmappe class.<br>
<br>
When looking at &lt;URL: <a href="http://n5test.kxml.no/api/arkivstruktur/mappe">http://n5test.kxml.no/api/arkivstruktur/mappe</a> &gt;, I<br>
notice this trick which could be used to identify the class of 'self':<br>
<br>
&nbsp; &quot;_links&quot;:[<br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;rel&quot;:&quot;self&quot;,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;href&quot;:&quot;http://n5test.kxml.no/api/arkivstruktur/Mappe/37a8f68c-a9d3-4af2-b547-4fa95e36e70e&quot;,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;templated&quot;:false<br>
&nbsp;&nbsp;&nbsp; }, {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;rel&quot;:&quot;http://rel.kxml.no/noark5/v4/api/arkivstruktur/mappe&quot;,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;href&quot;:&quot;http://n5test.kxml.no/api/arkivstruktur/Mappe/37a8f68c-a9d3-4af2-b547-4fa95e36e70e&quot;,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;templated&quot;:false<br>
&nbsp;&nbsp;&nbsp; }, ...<br>
<br>
Here you can see that the 'self' link have a href that is identical to<br>
another href, and the rel of that href represent the class of the<br>
entity.<br>
<br>
Did I miss the description in the spec stating that this is the way to<br>
detect the entity class, or should we write a defect report suggesting<br>
how to figure out the class of a entity?<br>
<br>
-- <br>
Happy hacking<br>
Petter Reinholdtsen<br>
<br>
_______________________________________________<br>
nikita-noark mailing list<br>
nikita-noark@nuug.no<br>
<a href="https://lists.nuug.no/mailman/listinfo/nikita-noark">https://lists.nuug.no/mailman/listinfo/nikita-noark</a><br>
</div>
</span></font>
</body>
</html>