<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<div id="divtagdefaultwrapper" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif, EmojiFont, 'Apple Color Emoji', 'Segoe UI Emoji', NotoColorEmoji, 'Segoe UI Symbol', 'Android Emoji', EmojiSymbols;" dir="ltr">
<p>Hi again,</p>
<p><br>
</p>
<p>I did a quick check. If you run the populate script, it will create a mappe and a saksmappe.</p>
<p><br>
</p>
<p><span>A&nbsp;GET on a series that has both mappe and saksmappe e.g.&nbsp;<a href="http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/arkivdel/6f650057-352d-4446-87f9-ca19d8accbaa/mappe" class="OWAAutoLink" id="LPlnk155812" previewremoved="true">http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/arkivdel/6f650057-352d-4446-87f9-ca19d8accbaa/mappe</a></span><br>
</p>
<p><br>
</p>
<p><span style="font-size: 12pt;">will return a list of mappe. If you look at the self rels</span><br>
</p>
<p><b><br>
</b></p>
<p><b>For mappe they will be:</b></p>
<p><span>&quot;href&quot; : &quot;http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/mappe/c66f1e92-5ece-45db-acaa-a2f88c59d822/&quot;</span><br>
</p>
<p><span><b><br>
</b></span></p>
<p><span><b>For saksmappe they will be:</b></span></p>
<p><span></span></p>
<div><span style="font-size: 12pt;">&quot;href&quot; : &quot;http://localhost:8092/noark5v4/hateoas-api/sakarkiv/saksmappe/1d7610f4-9bb0-4044-959d-4e79ab86a228/&quot;,</span><br>
</div>
<div><br>
</div>
<p></p>
<p>So it is possible to filter out saksmappe. We&nbsp;do however still need to be able to just retrieve saksmappe from arkivdel.</p>
<p><br>
</p>
<p>&nbsp;- Tom</p>
<p><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> nikita-noark-bounces@nuug.no &lt;nikita-noark-bounces@nuug.no&gt; on behalf of Thomas Sødring &lt;Thomas.Sodring@hioa.no&gt;<br>
<b>Sent:</b> Tuesday, May 23, 2017 8:39:35 PM<br>
<b>To:</b> Petter Reinholdtsen; nikita-noark@nuug.no<br>
<b>Subject:</b> Re: How to know the class of an entity?</font>
<div>&nbsp;</div>
</div>
<div>
<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: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif, EmojiFont, 'Apple Color Emoji', 'Segoe UI Emoji', NotoColorEmoji, 'Segoe UI Symbol', 'Android Emoji', EmojiSymbols;">
<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" id="LPlnk592631" previewremoved="true">
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" id="LPlnk432240" previewremoved="true">https://lists.nuug.no/mailman/listinfo/nikita-noark</a>
<div id="LPBorder_GT_14955665020840.368813908300307" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_14955665020800.4695660129434609" role="presentation" cellspacing="0" style="width: 90%; position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top-width: 1px; border-top-style: dotted; border-top-color: rgb(200, 200, 200); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(200, 200, 200); background-color: rgb(255, 255, 255);">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td id="TextCell_14955665020810.6252087437731002" colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;">
<div id="LPRemovePreviewContainer_14955665020810.437641480955838"></div>
<div id="LPTitle_14955665020820.3776655688829671" style="top: 0px; color: rgb(0, 114, 198); font-weight: normal; font-size: 21px; font-family: wf_segoe-ui_light, 'Segoe UI Light', 'Segoe WP Light', 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_14955665020820.8606117682660965" href="https://lists.nuug.no/mailman/listinfo/nikita-noark" target="_blank" style="text-decoration: none;">nikita-noark Info Page - NUUG</a></div>
<div id="LPMetadata_14955665020830.09080937689728175" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
lists.nuug.no</div>
<div id="LPDescription_14955665020830.2410706502661495" style="display: block; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
To see the collection of prior postings to the list, visit the nikita-noark Archives. Using nikita-noark: To post a message to all the list members ...</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>