<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
color:black;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
color:black;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
color:black;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
color:black;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;
color:black;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
p.PrformatHTML, li.PrformatHTML, div.PrformatHTML
{mso-style-name:"Préformaté HTML";
mso-style-link:"Préformaté HTML Car";
margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
color:black;}
span.PrformatHTMLCar
{mso-style-name:"Préformaté HTML Car";
mso-style-priority:99;
mso-style-link:"Préformaté HTML";
font-family:Consolas;
color:black;}
p.Textedebulles, li.Textedebulles, div.Textedebulles
{mso-style-name:"Texte de bulles";
mso-style-link:"Texte de bulles Car";
margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
color:black;}
span.TextedebullesCar
{mso-style-name:"Texte de bulles Car";
mso-style-priority:99;
mso-style-link:"Texte de bulles";
font-family:"Tahoma","sans-serif";
color:black;}
span.EmailStyle26
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.EmailStyle27
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle28
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle29
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle30
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle31
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=NO-BOK link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Hi again Sandrine,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>I’d be happy to help you if I can, but I’ve read your posts again, and unfortunately I still don’t understand exactly what it is you want to do. Nor can I see exactly what your question is.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>What I tried to explain is the typical way you’d implement a way to assign categories directly from the XML content editor, using a widget. (I included _additionally_ storing the category references as a property [collector.categories] value.)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>This method and the context menu’s “Assign categories” are equivalent with regard to the assigning of categories. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>They are, however, not _fully_ equivalent: <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>When using “Assign categories” from the context menu, the property value (the mapping) will be left unmodified, and so will the XML content. And the widget uses the XML content – so any category assigned using the context menu will _not_ appear as an assigned category when you edit the file. (Quite misleading, isn’t it? But at least the other way around is more like one would expect: Categories assigned using the widget when editing _does_ appear in the “Assigned categories” list of the “Assign categories” view.)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Best regards,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Paul<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> opencms-dev-bounces@opencms.org [mailto:opencms-dev-bounces@opencms.org] <b>On Behalf Of </b>Sandrine Prousteau<br><b>Sent:</b> 9. oktober 2012 15:05<br><b>To:</b> The OpenCms mailing list<br><b>Subject:</b> Re: [opencms-dev] XmlContent & Mapping on "Assign categories", howto<o:p></o:p></span></p></div></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Thanks for your reply.</span><span lang=FR><o:p></o:p></span></p><pre><span lang=EN-US style='color:#1F497D'>I already know that I can map the values to some properties, but this is not what I expect. I’d like to use Right Click context menu Assign categories, which works with the org.opencms.relations.CmsCategoryService.</span><span lang=FR><o:p></o:p></span></pre><pre><span lang=EN-US style='color:#1F497D'> </span><span lang=FR><o:p></o:p></span></pre><pre><span lang=EN-US style='color:#1F497D'>Sandrine.</span><span lang=FR><o:p></o:p></span></pre><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><span lang=FR><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><span lang=FR><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><span lang=FR><o:p></o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>De :</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> <a href="mailto:opencms-dev-bounces@opencms.org">opencms-dev-bounces@opencms.o<span lang=FR>rg</span></a></span><span lang=FR style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> [<a href="mailto:opencms-dev-bounces@opencms.org">mailto:opencms-dev-bounces@opencms.org</a>] <b>De la part de</b> Paul-Inge Flakstad<br><b>Envoyé :</b> lundi 8 octobre 2012 18:08<br><b>À :</b> The OpenCms mailing list<br><b>Objet :</b> Re: [opencms-dev] XmlContent & Mapping on "Assign categories", howto</span><span lang=FR><o:p></o:p></span></p></div></div><p class=MsoNormal><span lang=FR> <o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Hi Sandrine,</span><span lang=FR><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> </span><span lang=FR><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Not quite sure what you’re asking, but to enable assignment of categories when editing the structured content, you need to do something like this in your XSD:</span><span lang=FR><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>1. Define the category element, e.g.: <xsd:element name="Category" type="OpenCmsString" minOccurs="0" maxOccurs="20" /></span><span lang=FR><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>2. Define the layout, e.g.: <layout element="Category" widget="CategoryWidget" configuration="onlyleafs=true|property=category" /></span><span lang=FR><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>3. Define the mapping, e.g. <mapping element="Category" mapto="propertyList:collector.categories" /></span><span lang=FR><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><span lang=FR><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>The mapping is especially important. I’ve never tested it myself, but you should be able to place the category selector in a nested element. However, I don’t think you can have one category selector in one element, and then another category selector in another element and expect that to work. (It would probably appear to work, but I don’t think the mapping would survive like you’d want.)</span><span lang=FR><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><span lang=FR><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Hope this was of some help to you.</span><span lang=FR><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><span lang=FR><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Cheers,</span><span lang=FR><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Paul</span><span lang=FR><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><span lang=FR><o:p></o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> <a href="mailto:opencms-dev-bounces@opencms.org">opencms-dev-bounces@opencms.org</a> <a href="mailto:[mailto:opencms-dev-bounces@opencms.org]">[mailto:opencms-dev-bounces@opencms.org]</a> <b>On Behalf Of </b>Sandrine Prousteau<br><b>Sent:</b> 4. oktober 2012 12:08<br><b>To:</b> The OpenCms mailing list<br><b>Subject:</b> [opencms-dev] XmlContent & Mapping on "Assign categories", howto</span><span lang=FR><o:p></o:p></span></p></div></div><p class=MsoNormal> <span lang=FR><o:p></o:p></span></p><p class=MsoNormal><span lang=FR style='color:#1F497D'>Hi all !</span><span lang=FR><o:p></o:p></span></p><p class=MsoNormal><span lang=FR style='color:#1F497D'> </span><span lang=FR><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>I have a question about category fields on xmlcontent.</span><span lang=FR><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>I know that, with a VfsFile field with CategoryWidget directly in my type xsd, this field content is mapped on categories stored when we do “Assign category” in context menu.</span><span lang=FR><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>I’d like to use a similar category field which is in a nested XSD in this type XSD, like the Xpath /ID/Category, for mapping this value.</span><span lang=FR><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Can I do that and how?</span><span lang=FR><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><span lang=FR><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Thanks in advance.</span><span lang=FR><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><span lang=FR><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>(I’m on OpenCms 8.0.4 / 8.5.0)</span><span lang=FR><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><span lang=FR><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Sandrine.</span><span lang=FR><o:p></o:p></span></p></div></body></html>