ok, here we go ...

i have a mapped class (see below) and after inserting and retrieving the object out of the repository, the id (uuid) is not filled.


Base base = new Base();
base.setPath("/ocmtestpath");
base.setTitle("ocmtesttitle");
base.setName("ocmtestname");

objectContentManager.insert(cat);
try {
 Base base = (Base) objectContentManager.getObject(cat.getPath());
 // error id is not filled with uuid
} catch (Exception e) {
}



The generated (jcrocm) mappings.xml file has the entry for uuid.

After patching sling ClassDescriptorReader.parseFieldDescriptor and add the following line

fd.setUuid(this.getOptionalAttribute("uuid", false));

it works.

I am wondering there are other fields missing in parseFieldDescriptor as described in previous post.



Are you willing to patch ClassDescriptorReader and add the missing entries ? Or any other informations required ?



---mappings.xml-----------------------------------------------------


 <!--
     Class: de.dig.cms.common.ocm.Base
 -->
 <class-descriptor
    className="de.dig.cms.common.ocm.Base"
    jcrMixinTypes="mix:referenceable">

   <field-descriptor
      fieldName="id"
      uuid="true" />

   <field-descriptor
      fieldName="name"
      jcrName="true" />

   <field-descriptor
      fieldName="path"
      path="true" />
 </class-descriptor>

---Base.class------------------------------------
package ocm;

/**
* @ocm.mapped discriminator="true" jcrMixinTypes="mix:referenceable"
*/
public class Base {
   private String resourceType;

   /**
    * @ocm.field uuid="true"
    */
   private String id;

   /**
    * @ocm.field jcrName="true"
    */
   private String name;

   /**
    * @ocm.field path="true"
*/ private String path;

   public Base() {
   }

   public String getUuid() {
       return uuid;
   }

   public void setUuid(String uuid) {
       this.uuid = uuid;
   }

   public String getName() {
       return name;
   }

   public void setName(String name) {
       this.name = name;
   }

   public String getPath() {
       return path;
   }

   public void setPath(String path) {
       this.path = path;
   }


}


Carsten Ziegeler wrote:
Markus Pallo wrote:
the parsefielddescriptor of classdescriptor reader is missing uuid field
handling.

I compared the attribs in mapping file generated by
jcrocm.FieldDescriptor and ClassDescriptorReader of sling and there some
attribs more missing.

Is this according to an early adaption of jackrabbit-ocm ?

According to the last questions i posted and no replies, i am wondering
if somebody is using jcrocm ?

I fear noone is using jcr ocm here :(

Maybe it would help if you could post bugs including the errors you're
running into - the more information you give, the better the chance that
someone can help :)

Carsten



--
------------------------------------------------------------------
DIG Digitale Medienberatungs-
und Produktions- GmbH
Neckarstr. 1/5
78727 Oberndorf a. N.

Amtsgericht Stuttgart HRB 480914
Geschäftsführer: Carsten Huber
------------------------------------------------------------------
Tel: +49 (0)7423 8750 60
Fax: +49 (0)7423 8750 23
Internet: http://www.dig.de
eMail: [email protected]

Ein Unternehmen der Schwarzwälder Bote Mediengruppe



Reply via email to