public void doService() {
ExecutionInstance executionInstance;
IEngUserProfile userProfile;
Integer biobjectId;
String viewpointName;
String viewpointDescription;
String viewpointScope;
String viewpointOwner;
JSONObject viewpointJSON;
String viewpointString;
IViewpointDAO viewpointDAO;
Viewpoint viewpoint;
logger.debug("IN");
try{
viewpointName = getAttributeAsString(NAME);
viewpointDescription = getAttributeAsString(DESCRIPTION);
viewpointScope = getAttributeAsString(SCOPE);
viewpointJSON = getAttributeAsJSONObject( VIEWPOINT );
logger.debug("Parameter [" + NAME + "] is equals to [" + viewpointName + "]");
logger.debug("Parameter [" + DESCRIPTION + "] is equals to [" + viewpointDescription + "]");
logger.debug("Parameter [" + SCOPE + "] is equals to [" + viewpointScope + "]");
logger.debug("Parameter [" + viewpointScope + "] is equals to [" + viewpointJSON + "]");
Assert.assertTrue(!StringUtilities.isEmpty(viewpointScope), "Viewpoint's name cannot be null or empty");
Assert.assertNotNull(!StringUtilities.isEmpty(viewpointDescription), "Viewpoint's description cannot be null or empty");
Assert.assertNotNull(!StringUtilities.isEmpty(viewpointScope), "Viewpoint's scope cannot be null or empty");
Assert.assertNotNull(viewpointJSON, "Viewpoint's content cannot be null");
executionInstance = getContext().getExecutionInstance( ExecutionInstance.class.getName() );
Assert.assertNotNull(executionInstance, "Execution instance cannot be null");
userProfile = this.getUserProfile();
Assert.assertNotNull(userProfile, "Impossible to retrive user profile");
biobjectId = executionInstance.getBIObject().getId();
Assert.assertNotNull(executionInstance, "Impossible to retrive analytical document id");
logger.debug("User: [" + userProfile.getUserUniqueIdentifier() + "]");
logger.debug("Document Id: [" + biobjectId + "]");
viewpointOwner = (String) ((UserProfile)userProfile).getUserId();
Iterator it = viewpointJSON.keys();