Hi Naren,

You probably don't use the ContentQueryManager to persist the bean. If you use the GenericQueryManager, the CMF-specific constraints will not be picked up.

Best regards,

Geert

On 9-jan-06, at 15:19, Naren wrote:

Hello
We have tried to use content management with RIFE. When we tried with the example http://rifers.org/wiki/display/RIFE/Content+management +framework

and it works like a charm. After that I have write own bean with same thing, but that does not work. It only insert data in bean table but not in content
store.

I used following code in bean
---------
package app.bean;


import com.uwyn.rife.cmf.CmfProperty;
import com.uwyn.rife.cmf.CmfValidation;
import com.uwyn.rife.cmf.MimeType;

import java.util.*;
import java.text.DecimalFormat;
import java.text.NumberFormat;


public class ProductBean extends CmfValidation
{

 private String mProducttitle=null;
    private float mPrice=Float.parseFloat("0.0");
    private byte[] mAvatar=null;
    private String mDescription=null;
    private Date  mAddProductdate=null;
    private int mId=-1;

    protected void activateValidation()
 {
     addConstraint(new CmfProperty("producttitle")
       .notNull(true)
       .notEmpty(true)
       .maxLength(50));
  addConstraint(new CmfProperty("description")
    .notNull(true)
    .notEmpty(true)
    .minLength(10));
  addConstraint(new CmfProperty("avatar")
    .persistent(false)
    .file(true));
  addConstraint(new CmfProperty("id")
    .saved(false)
    .editable(false));
 }
    public void setId(int id)
    {
      mId=id;
    }
    public int getId()
    {
      return mId;
    }

    public void setProducttitle(String producttitle)
    {
      mProducttitle=producttitle;
    }

    public void setDescription(String description)
    {
     mDescription=description;
    }

    public void setPrice(float price)
    {
     mPrice=price;
    }
    public void setAvatar(byte[] avatar)   {mAvatar=avatar;    }
    public byte[] getAvatar() { return mAvatar; }

    public void setAddProductdate(Date addProductdate) {
     mAddProductdate=addProductdate;
    }
 public String getProducttitle()
 {
  return mProducttitle;
 }

 public String getDescription()
 {
  return mDescription;
 }
 public float getPrice()
 {
 return mPrice;
 }
 public Date getAddProductdate()
 {
  return mAddProductdate;
 }

}
----------------

What am I doing wrong ? What are the main Contrainst that need to apply to
store data in Content Store.

Regards
Naren






_______________________________________________
Rife-users mailing list
[email protected]
http://www.uwyn.com/mailman/listinfo/rife-users


--
Geert Bevin                       Uwyn bvba
"Use what you need"               Avenue de Scailmont 34
http://www.uwyn.com               7170 Manage, Belgium
gbevin[remove] at uwyn dot com    Tel +32 64 84 80 03

PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 309F D6A9
Public PGP key  : available at servers pgp.mit.edu, wwwkeys.pgp.net


_______________________________________________
Rife-users mailing list
[email protected]
http://www.uwyn.com/mailman/listinfo/rife-users

Reply via email to