DescriptionSetImpl descSet = new DescriptionSetImpl();
descSet.add(desc);
servletCtrl.setDescriptions(descSet);
ParameterSet parameters = servlet.getInitParameterSet();
ParameterSetCtrl parameterSetCtrl = (ParameterSetCtrl)controllerFactory.get(parameters);
Parameter parameter1 = parameters.get("portlet-class");
if (parameter1 == null) {
parameterSetCtrl.add("portlet-class", portlet.getClassName());
} else {
ParameterCtrl parameterCtrl = (ParameterCtrl)controllerFactory.get(parameter1);
parameterCtrl.setValue(portlet.getClassName());
}
Parameter parameter2 = parameters.get("portlet-guid");
if (parameter2 == null) {
parameterSetCtrl.add("portlet-guid", portlet.getId().toString());
} else {
ParameterCtrl parameterCtrl = (ParameterCtrl)controllerFactory.get(parameter2);
parameterCtrl.setValue(portlet.getId().toString());
}