}
}
}
private WGRelationData createRelationData(String relName, String relType, WGContent parentContent, String relationStr) throws WGAPIException, WGIllegalArgumentException {
WGRelationData relData = null;
TMLContext relationContext = gettargetcontext().context("docid:"+ relationStr, false);
if (relationContext != null) {
if (relType.equalsIgnoreCase("normal")) {
relData = new WGRelationData(parentContent.getContentKey(), relName, relationContext.content().getStructKey(), relationContext.content().getLanguage().getName(), WGContent.RELATIONTYPE_NORMAL, null);
}
else if (relType.equalsIgnoreCase("protected")) {
relData = new WGRelationData(parentContent.getContentKey(), relName, relationContext.content().getStructKey(), relationContext.content().getLanguage().getName(), WGContent.RELATIONTYPE_PROTECTED, null);
}
else {
throw new WGIllegalArgumentException("Unknown relationtype '" + relType + "'.");
}
}