Please would you mind telling me how the attributes of a class such as firstName, lastName, OrganizationId… are stored in the database after entered on the jsp page.
Is it, e.g., this code that stores the organizationId in MySQL?
props.put(ContentModel.PROP_ORGID, super.getCompanyId());
this.nodeService.setProperties(nodeRef, props);
Creating an aspect allows us to store an attribute into the database MySQL? What do I do wrong while doing that:
-I add an attribute department in my class MyNewUserWizard
-I add an aspect via extension-context.xml as follow:
<namespaces>
<namespace uri="custom.model" prefix="custom"/>
</namespaces>
<!–types–>
<!– Definition of new Content Aspect: Department of the user –>
<aspects>
<aspect name="custom:Myperson">
<title>Department</title>
<properties>
<property name="custom:department">
<type>d:text</type>
</property>
</properties>
</aspect>
</aspects>
-I add the variables in my sub class of ContentModel:
public interface MyContentModel extends ContentModel
{
// person
static final QName PROP_DEPARTMENT = QName.createQName("custom.model", "department");
static final QName ASPECT_Myperson = QName.createQName("custom.model", "Myperson");
}
-I add this code in the function finish() of MyNewUserWizad:
Map<QName, Serializable> myprops = new HashMap<QName, Serializable>(5);
myprops.put(MyContentModel.PROP_DEPARTMENT, this.department);
this.nodeService.addAspect(nodeRef, MyContentModel.ASPECT_Myperson,myprops);
Is there another way to store attributes values in the database than using aspects?
Thanks in advance for your help