public SocialDocumentAdapter(DocumentModel sourceDocument)
throws ClientException {
this.sourceDocument = sourceDocument;
if (sourceDocument != null && getSession() == null) {
throw new ClientException(
"All action will be impossible as the given getSession() is null");
}
if (sourceDocument == null) {
throw new ClientException("Give document model is null");
}
if (!SocialWorkspaceHelper.isSocialDocument(sourceDocument)) {
throw new ClientException(
"Make public a document is restricted to social document only not for :"
+ sourceDocument.getPathAsString());
}
socialWorkspace = getSocialWorkspaceService().getDetachedSocialWorkspace(
sourceDocument);
if (socialWorkspace == null) {
throw new ClientException(
"Given document is not into a social workspace");
}
}