logger.error("Document id not specified!!");
throw new Exception("Document id not specified!!");
}
logger.debug("Access to the database");
LowFunctionalityDAOHibImpl lowFunctionalityDAOHibImpl = new LowFunctionalityDAOHibImpl();
boolean exists = lowFunctionalityDAOHibImpl.checkUserRootExists(userId);
LowFunctionality lf = null;
if (exists) {
logger.debug("Personal Folder found");
}
else {
logger.debug("Personal Folder not found, now will be created");
UserUtilities.createUserFunctionalityRoot(profile);
logger.debug("Personal Folder created");
if(!(lowFunctionalityDAOHibImpl.checkUserRootExists(userId)))
throw new Exception("Personal Folder doesn't exists or could not be created");
}
lf = lowFunctionalityDAOHibImpl.loadLowFunctionalityByPath("/" + userId, false);
Integer idFunction = lf.getId();
if (idFunction == null) {
logger.error("No function associated");
throw new Exception("No function associated");