if(valueStr != null && valueStr.length() > 0)
((DestinationIF) model).getData().setAttribute(PASSWORD_ATTR, valueStr);
}
};
PasswordEditor editor = new PasswordEditor();
editor.setSize(10);
FieldInfo fieldInfo = new FieldInfo(
PASSWORD_ATTR,
PASSWORD_ATTR,
modifier,
editor);
//add the configuration to the context for usage in the http-requests.
addField(PASSWORD_ATTR, fieldInfo);
}
// Import type
{
ModelModifier modifier = new DefaultModelModifier() {
public Object getModelValue(Object model) throws Exception {
Integer value = ((DestinationIF) model)
.getData().getIntegerAttribute(IMPORT_MODE_ATTR);
return value != null ? value : new Integer(0);
}
public void setModelValue(Object model, Object value) throws Exception {
int intValue = value != null ? ((Integer) value).intValue() : 0;
((DestinationIF) model).getData().setAttribute(IMPORT_MODE_ATTR, intValue);
}
};
SelectEditor editor = new SelectEditor();
for(Iterator i = IMPORT_MODES.keySet().iterator(); i.hasNext();) {
Integer optionNumber = (Integer) i.next();
String optionName = (String) IMPORT_MODES.get(optionNumber);
editor.addOption(new DefaultSelectOption(optionNumber, optionName));
}
editor.setFormatter(new IntegerFormatter());
//and finally create the configurationObject
FieldInfo fieldInfo = new FieldInfo(
IMPORT_MODE_ATTR,
IMPORT_MODE_ATTR,
modifier,
editor);
//add the configuration to the context for usage in the http-requests.
addField(IMPORT_MODE_ATTR, fieldInfo);
}
// Create product groups
{
ModelModifier modifier = new DefaultModelModifier() {
public Object getModelValue(Object model) throws Exception {
Boolean value = ((DestinationIF) model)
.getData().getBooleanAttribute(CREATE_GROUPS_ATTR);
if(value == null)
value = Boolean.FALSE;
return value;
}
public void setModelValue(Object model, Object value) throws Exception {
boolean booleanValue = value != null ? ((Boolean) value).booleanValue()
: false;
((DestinationIF) model).getData().setAttribute(CREATE_GROUPS_ATTR, booleanValue);
}
};
BooleanEditor editor = new BooleanEditor();
FieldInfo fieldInfo = new FieldInfo(
CREATE_GROUPS_ATTR,
CREATE_GROUPS_ATTR,
modifier,
editor);
//add the configuration to the context for usage in the http-requests.
addField(CREATE_GROUPS_ATTR, fieldInfo);
}
// Additive group update mode
{
ModelModifier modifier = new DefaultModelModifier() {
public Object getModelValue(Object model) throws Exception {
Boolean value = ((DestinationIF) model)
.getData().getBooleanAttribute(ADDITIVE_GROUP_UPDATE_ATTR);
if(value == null)
value = Boolean.FALSE;
return value;
}
public void setModelValue(Object model, Object value) throws Exception {
boolean booleanValue = value != null ? ((Boolean) value).booleanValue()
: false;
((DestinationIF) model).getData().setAttribute(
ADDITIVE_GROUP_UPDATE_ATTR,
booleanValue);
}
};
BooleanEditor editor = new BooleanEditor();
FieldInfo fieldInfo = new FieldInfo(
ADDITIVE_GROUP_UPDATE_ATTR,
ADDITIVE_GROUP_UPDATE_ATTR,
modifier,
editor);
//add the configuration to the context for usage in the http-requests.
addField(ADDITIVE_GROUP_UPDATE_ATTR, fieldInfo);
}
// Additive option update mode
{
ModelModifier modifier = new DefaultModelModifier() {
public Object getModelValue(Object model) throws Exception {
Boolean value = ((DestinationIF) model)
.getData().getBooleanAttribute(ADDITIVE_OPTION_UPDATE_ATTR);
if(value == null)
value = Boolean.FALSE;
return value;
}
public void setModelValue(Object model, Object value) throws Exception {
boolean booleanValue = value != null ? ((Boolean) value).booleanValue()
: false;
((DestinationIF) model).getData().setAttribute(
ADDITIVE_OPTION_UPDATE_ATTR,
booleanValue);
}
};
BooleanEditor editor = new BooleanEditor();
FieldInfo fieldInfo = new FieldInfo(
ADDITIVE_OPTION_UPDATE_ATTR,
ADDITIVE_OPTION_UPDATE_ATTR,
modifier,
editor);
//add the configuration to the context for usage in the http-requests.
addField(ADDITIVE_OPTION_UPDATE_ATTR, fieldInfo);
}
{
ModelModifier modifier = new DefaultModelModifier() {
public Object getModelValue(Object model) throws Exception {
String protectedGroups =
((PipeComponentIF) model).getData().getAttribute(PROTECTED_GROUPS_ATTR);
if(protectedGroups == null) {
return "";
} else {
return protectedGroups;
}
}
public void setModelValue(Object model, Object value) throws Exception {
((PipeComponentIF) model).getData().setAttribute(
PROTECTED_GROUPS_ATTR,
(String) value);
}
};
TextAreaEditor editor = new TextAreaEditor();
editor.setCols(70);
editor.setRows(10);
//and finally create the configurationObject
FieldInfo fieldInfo = new FieldInfo(
PROTECTED_GROUPS_ATTR,