I cannot seem to get the image data to save to the CMF. The name field
of the bean is successfully inserted into the DB, but the image data
is definitely not being saved within the CMF. I've included all the
important information below.

public class CategoryMetaData extends MetaData {
        public void activateMetaData() {
                addConstraint(new 
ConstrainedProperty("id").identifier(true).unique(
                                true));
                addConstraint(new 
ConstrainedProperty("name").notNull(true).maxLength(
                                128));
                addConstraint(new ConstrainedProperty("image").mimeType(
                                MimeType.IMAGE_JPEG).file(true));
        }
}

---

public Category {
        private int id = -1;
        private String name = null;
        private byte[] image = null;

       ...
}

---

<r:i name="common.blueprint"/>
<r:bv name="content">
        <form name="category_data" action="<r:v
name="SUBMISSION:FORM:category_data"/>" method="post">
                <r:v name="SUBMISSION:PARAMS:category_data"/>
                <input type="input" name="name"/>
                <input type="file" name="image"/>
                <input type="submit"/>
        <form>
</r:bv>

---

        public void processElement() {
                Template template = getHtmlTemplate("testers.test");
                Category category = (Category)
getNamedSubmissionBean("category_data", "category");
                
                if(category != null){
                        CategoryManager manager = new
CategoryManager(DatabaseHelper.getDatasource());
                        manager.save(category);
                }
                print(template);
        }

CategoryManager's save uses a ContentQueryManager set to Category.class.

---
Inside the Element:

                <submission name="category_data">
                        <bean name="category" 
classname="com.warfrog.portal.beans.Category"/>
                </submission>

---

Cheers,
 Tyler
_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users

Reply via email to