* @param request HTTP request
* @return registration info or <code>null</code> if unable to extract registration info
*/
private HrRecord extractRegistrationInfo(HttpServletRequest request) {
ApplicationContext appCtx = ApplicationContext.getInstance();
ApplicationConfiguration appCfg = appCtx.getConfiguration();
HrRecord record = new HrRecord();
StringAttributeMap attributes = new StringAttributeMap();
boolean updateContent = true;
boolean updateDefinition = true;
boolean autoApprove = true;
for (String paramName : new EnumerationAdapter<String>(request.getParameterNames())) {
String paramValue = request.getParameter(paramName);
if (paramName.equalsIgnoreCase("uuid")) {
record.setUuid(paramValue);
}
if (paramName.equalsIgnoreCase("name")) {
record.setName(paramValue);
}
else if (paramName.equalsIgnoreCase("url")) {
record.setHostUrl(paramValue);
}
else if (paramName.equalsIgnoreCase("soapurl")) {
attributes.add(new StringAttribute(ArcGISProtocol.SOAP_URL,paramValue));
}
else if (paramName.equalsIgnoreCase("protocol")) {
ProtocolFactory factory = appCfg.getProtocolFactories().get(paramValue);
if (factory!=null) {
record.setProtocol(factory.newProtocol());
}
}
else if (paramName.equalsIgnoreCase("frequency")) {
record.setHarvestFrequency(HarvestFrequency.checkValueOf(paramValue));
}
else if (paramName.equalsIgnoreCase("sendNotification")) {
record.setSendNotification(Val.chkBool(paramValue, false));
}
else if (paramName.equalsIgnoreCase("updateContent")) {
updateContent = Val.chkBool(paramValue, true);
}
else if (paramName.equalsIgnoreCase("updateDefinition")) {
updateDefinition = Val.chkBool(paramValue, true);
}
else if (paramName.equalsIgnoreCase("autoApprove")) {
autoApprove = Val.chkBool(paramValue, true);
}
else if (paramName.equalsIgnoreCase("findable")) {
record.setFindable(Val.chkBool(paramValue, true));
}
else if (paramName.equalsIgnoreCase("searchable")) {
record.setSearchable(Val.chkBool(paramValue, true));
}
else if (paramName.equalsIgnoreCase("synchronizable")) {
record.setSynchronizable(Val.chkBool(paramValue, true));
}
else {
attributes.add(new StringAttribute(paramName,paramValue));
}
}
if (record.getProtocol()==null || record.getProtocol().getKind().equalsIgnoreCase(ProtocolType.None.name())) {
ProtocolFactory factory = appCfg.getProtocolFactories().get(ProtocolType.RES.name());
if (factory!=null) {
record.setProtocol(factory.newProtocol());
}
}