ProductBean pBean
=(ProductBean)getSubmissionBean("addproduct",ProductBean.class);
Datasource ds = Datasources.getRepInstance().getDatasource
("mysql");
ContentQueryManager manager = new ContentQueryManager(ds,
ProductBean.class);
int id=manager.save(pBean);
I found the problem, you used the persistent(false) constraint on
your avatar property, this means that RIFE will not persist it. In
the wiki, this is used as a demo of virtual properties. You also
forgot to set a mimeType property, this indicates the manager that is
has to be handled as content instead of regular data. If you don't
specify it, your data will be stored in the DB table.
I have one more question, Is any support for localization in this
Content
Management ?
So that I can use different images for different languages.
There is no native support for localization since the CMF relies on
paths to identify content items. You can use any path you like. If
you use the ContentQueryManager to store the properties, those paths
will be auto-generated for you as /lowercase_bean_classname/propertyname
If you set the property to persistent(false), you can store it in any
path yourself like this:
manager.getContentManager().storeContent("/localized/language/
myimage", new Content(MimeType.IMAGE_PNG, pBean.getAvatar()), null);
You can read the javadocs of ContentManager to see how to retrieve
the content again:
http://rifers.org/docs/api/com/uwyn/rife/cmf/dam/ContentManager.html
Best regards,
Geert
--
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