public void addRelation(String elementCode, String contentType) throws ApsSystemException {
try {
SmallContentType smallContentType =
(SmallContentType) this.getContentManager().getSmallContentTypesMap().get(contentType);
if (null == smallContentType) {
throw new ApsSystemException("Content type missing : " + contentType);
}
if (null == this.getContentTypeElements().get(contentType)) {
this.getContentTypeElements().put(contentType, new ArrayList<String>());
}
this.checkReference(elementCode);
List<String> contentTypeCategories = this.getContentTypeElements().get(contentType);
if (!contentTypeCategories.contains(elementCode)) {
contentTypeCategories.add(elementCode);
}
this.updateConfig();
} catch (Throwable t) {
ApsSystemUtils.logThrowable(t, this, "addCategoryRelation");
throw new ApsSystemException("Error adding Category Relation", t);
}
}