@CodeCompletion
public String registerportletforname(String name, String moduleDb, String module, boolean overwrite) throws WGAPIException {
// Verify portlet name rules
if (!PORTLETNAME_PATTERN.matcher(name).matches()) {
throw new WGIllegalArgumentException("The portletname may only consist of characters A-Z, a-z, 0-9, _, ., - and :");
}
// Verify portlet name not already used
TMLPortlet portlet = getportletforname(name);
if (portlet != null) {
if (overwrite) {
unregisterportletforname(name);
}
else {
throw new WGIllegalArgumentException("Portlet name '" + name + "' already registered.");
}
}
String pkey = registerportlet(moduleDb, module, name);
setitem(PORTLETNAME_ITEM_PREFIX + name, pkey);