On Tue, 2014-04-29 at 17:18 +0200, Patrick Ohly wrote:
> On Tue, 2014-04-29 at 09:50 +0200, Patrick Ohly wrote:
> > On Mon, 2014-04-28 at 23:18 +0200, Lukas Zeller wrote:
> > > Hi Patrick,
> > >
> > > > Unfortunately I am not getting the group-tag field populated. I'm
> > > > attaching my field list and profile.
> > >
> > > small oversight on my and your part :-)
> > >
> > > The attribute to be added to <property> is called "groupfield", not
> > > "grouptag"...
> >
> > I fixed that (see attached profile + field list). It fills the GROUP_TAG
> > array now, but the LABEL array only has one entry, apparently the last
> > one. The array positions also don't match:
> >
> > item34.URL:http\://custom.com
> > item34.X-ABLabel:Custom-label
> >
> > - 3 : string GROUP_TAG [ 0, n/a, 0] : <array with 19
> > elements>
> > -- element 0 : "item34"
> > - 4 : string LABEL [ 0, 0, 0] : <array with 1
> > elements>
> > -- element 0 : "Custom-label"
> > - 34 : string WEB [ 0, 0, 0] : <array with 19
> > elements>
> > -- element 0 : <unassigned>
> > ...
> > -- element 18 : "http://custom.com"
>
> I've stepped through TMimeDirProfileHandler::parseProperty() when
> parsing a simpler example:
>
> BEGIN:VCARD
> VERSION:3.0
> N:Doe;John;1;Mr.;Sr.
> FN:Mr. John 1 Doe Sr.
> UID:6f354d698b7ccd22
> item1.URL:http\://company.com
> item1.X-ABLabel:Work
> item2.URL:http\://custom.com
> item2.X-ABLabel:Custom-label
> END:VCARD
>
> When parsing item1.X-ABLabel:Work,
> TMimeDirProfileHandler::parseProperty() immediately skips over the
> parameter parsing because there is none and fieldoffsetfound was set to
> true in
> fieldoffsetfound = (aPropP->nameExts==NULL); // no first pass needed at
> all w/o nameExts, just use offs=0
>
> It then has repoffset == 0 when storing the group tag:
>
> // parameters are all processed by now, decision made to store data (if
> !dostore, routine exits above)
> // - store the group tag value if we have one
> if (aPropP->groupFieldID!=FID_NOT_SUPPORTED) {
> TItemField *g_fldP =
> aItem.getArrayFieldAdjusted(aPropP->groupFieldID+baseoffset,repoffset,false);
> if (g_fldP)
> g_fldP->setAsString(aGroupName,aGroupNameLen); // store the group name
> (aGroupName might be NULL, that's ok)
> }
>
> This happens to be correct (accidentally) for item1.X-ABLabel:Work.
Looking further at aPropP->nameExts it seems that this what relates to
<position> in the profile config. I did not have that for my X-ABLabel.
Adding it seems to fix the problem. So it seems that "groupfield" can
only be used reliably with a <property> which has a <position>, correct?
<property name="X-ABLabel" suppressempty="yes" groupfield="GROUP_TAG">
<value field="LABEL" repeat="array" increment="1" minshow="0"/>
<position field="LABEL" repeat="array" increment="1" minshow="1"/>
</property>
--
Best Regards, Patrick Ohly
The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.
_______________________________________________
os-libsynthesis mailing list
[email protected]
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis