<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic TableReferences in Directories : can we extend the schema? in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/tablereferences-in-directories-can-we-extend-the-schema/m-p/324553#M11554</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;I'm actually playing with directories and table references.
I have no problem with "basic" use of tableReference.&lt;/P&gt;
&lt;P&gt;My problem is that i would like to add some additional information in the reference table.
Let's take an example with two directories : profile and function (the content of these directories doesn't really matter).&lt;/P&gt;
&lt;P&gt;Let's check the contrib :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;directory name="profile"&amp;gt;
	&amp;lt;schema&amp;gt;profile&amp;lt;/schema&amp;gt;
	&amp;lt;table&amp;gt;profile&amp;lt;/table&amp;gt;
	[...]
	&amp;lt;references&amp;gt;
		&amp;lt;tableReference field="functions" directory="function"
				table="profile2function" sourceColumn="profileId" targetColumn="functionId
				schema="profile2function" dataFile="directories/profile2function.csv" /&amp;gt;
		&amp;lt;/references&amp;gt;
&amp;lt;/directory&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It works perfectly when i only need a mapping/reference table with [profileId, functionId].
But I would like to add an additional metadata in this mapping, let's say "status".&lt;/P&gt;
&lt;P&gt;I tried to create a schema profile2function.xsd with profileId, functionId and status. I also added it to the required contribution.&lt;/P&gt;
&lt;P&gt;Well, it seems that it doesn't work like I expected, because when i try to access the directory (in admin center, for example), I get an exception saying "column not found: status" while loading the csv file. (because i put the additional column in the csv file, of course)&lt;/P&gt;
&lt;P&gt;So my question is : am I misunderstanding the meaning of schema in tableReference?
Maybe this schema field doesn't have this purpose, and we're not able to extend this mapping table?&lt;BR /&gt; /&amp;gt;
Or do you think i did a mistake somewhere?&lt;/P&gt;
&lt;P&gt;If I take a look at the method getTable() of TableReference, i can see that we only add the sourceColumn and targetColumn here. We could maybe play with the extended schema in this method, to add the additional columns?&lt;/P&gt;
&lt;P&gt;Maybe it would be easier to create our own extended mapping table, and handling manually the id references, but i don't like this approach.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Wed, 21 Nov 2012 02:04:40 GMT</pubDate>
    <dc:creator>Aykut_Açikel</dc:creator>
    <dc:date>2012-11-21T02:04:40Z</dc:date>
    <item>
      <title>TableReferences in Directories : can we extend the schema?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/tablereferences-in-directories-can-we-extend-the-schema/m-p/324553#M11554</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;I'm actually playing with directories and table references.
I have no problem with "basic" use of tableReference.&lt;/P&gt;
&lt;P&gt;My problem is that i would like to add some additional information in the reference table.
Let's take an example with two directories : profile and function (the content of these directories doesn't really matter).&lt;/P&gt;
&lt;P&gt;Let's check the contrib :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;directory name="profile"&amp;gt;
	&amp;lt;schema&amp;gt;profile&amp;lt;/schema&amp;gt;
	&amp;lt;table&amp;gt;profile&amp;lt;/table&amp;gt;
	[...]
	&amp;lt;references&amp;gt;
		&amp;lt;tableReference field="functions" directory="function"
				table="profile2function" sourceColumn="profileId" targetColumn="functionId
				schema="profile2function" dataFile="directories/profile2function.csv" /&amp;gt;
		&amp;lt;/references&amp;gt;
&amp;lt;/directory&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It works perfectly when i only need a mapping/reference table with [profileId, functionId].
But I would like to add an additional metadata in this mapping, let's say "status".&lt;/P&gt;
&lt;P&gt;I tried to create a schema profile2function.xsd with profileId, functionId and status. I also added it to the required contribution.&lt;/P&gt;
&lt;P&gt;Well, it seems that it doesn't work like I expected, because when i try to access the directory (in admin center, for example), I get an exception saying "column not found: status" while loading the csv file. (because i put the additional column in the csv file, of course)&lt;/P&gt;
&lt;P&gt;So my question is : am I misunderstanding the meaning of schema in tableReference?
Maybe this schema field doesn't have this purpose, and we're not able to extend this mapping table?&lt;BR /&gt; /&amp;gt;
Or do you think i did a mistake somewhere?&lt;/P&gt;
&lt;P&gt;If I take a look at the method getTable() of TableReference, i can see that we only add the sourceColumn and targetColumn here. We could maybe play with the extended schema in this method, to add the additional columns?&lt;/P&gt;
&lt;P&gt;Maybe it would be easier to create our own extended mapping table, and handling manually the id references, but i don't like this approach.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Nov 2012 02:04:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/tablereferences-in-directories-can-we-extend-the-schema/m-p/324553#M11554</guid>
      <dc:creator>Aykut_Açikel</dc:creator>
      <dc:date>2012-11-21T02:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: TableReferences in Directories : can we extend the schema?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/tablereferences-in-directories-can-we-extend-the-schema/m-p/324554#M11555</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Table references only handle a limited set of use cases, complex schemas are not always supported and i guess you're running into one of the limitations.&lt;/P&gt;
&lt;P&gt;Defining new table references is an option, but it can be tricky to implement, and you may run into other limitations of the directory service API.&lt;/P&gt;
&lt;P&gt;If you do not need to retrieve that kind of information from an external directory, you might want to consider persisting this information in documents in the Nuxeo repository instead.&lt;/P&gt;
&lt;P&gt;As you're describing a "profiles" or "roles" feature, you might be interested in using computed groups and security policies to make the link between these settings and security/filter checks in the application.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Nov 2012 00:42:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/tablereferences-in-directories-can-we-extend-the-schema/m-p/324554#M11555</guid>
      <dc:creator>Anahide_Tchertc</dc:creator>
      <dc:date>2012-11-23T00:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: TableReferences in Directories : can we extend the schema?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/tablereferences-in-directories-can-we-extend-the-schema/m-p/324555#M11556</link>
      <description>&lt;P&gt;I've decided to persist this information in documents.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Nov 2012 12:10:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/tablereferences-in-directories-can-we-extend-the-schema/m-p/324555#M11556</guid>
      <dc:creator>Aykut_Açikel</dc:creator>
      <dc:date>2012-11-23T12:10:52Z</dc:date>
    </item>
  </channel>
</rss>

