Package it.eng.spagobi.analiticalmodel.document.bo

Examples of it.eng.spagobi.analiticalmodel.document.bo.BIObject


   *
   * @see it.eng.spagobi.analiticalmodel.document.dao.IBIObjectDAO#loadBIObjectById(java.lang.Integer)
   */
  public BIObject loadBIObjectById(Integer biObjectID) throws EMFUserError {
    logger.debug("IN");
    BIObject toReturn = null;
    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
View Full Code Here


   *
   * @see it.eng.spagobi.analiticalmodel.document.dao.IBIObjectDAO#loadBIObjectForDetail(java.lang.Integer)
   */
  public BIObject loadBIObjectForDetail(Integer id) throws EMFUserError {
    logger.debug("IN");
    BIObject biObject = null;
    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
View Full Code Here

   *
   * @see it.eng.spagobi.analiticalmodel.document.dao.IBIObjectDAO#loadBIObjectByLabel(java.lang.String)
   */
  public BIObject loadBIObjectByLabel(String label) throws EMFUserError {
    logger.debug("IN");
    BIObject biObject = null;
    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
View Full Code Here

   *
   * @see it.eng.spagobi.analiticalmodel.document.dao.IBIObjectDAO#loadBIObjectForTree(java.lang.Integer)
   */
  public BIObject loadBIObjectForTree(Integer id) throws EMFUserError {
    logger.debug("IN. start method with input id:" + id);
    BIObject biObject = null;
    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      logger.debug("hibernate session obtained:" + aSession);
View Full Code Here

   * @return the corrispondent output <code>BIObject</code>
   */
  public BIObject toBIObject(SbiObjects hibBIObject){
    logger.debug("IN");
    // create empty biobject
    BIObject aBIObject = new BIObject();
    // set type (type code and id)
    aBIObject.setBiObjectTypeCode(hibBIObject.getObjectTypeCode());
    aBIObject.setBiObjectTypeID(hibBIObject.getObjectType().getValueId());
    // set description
    String descr = hibBIObject.getDescr();
    if(descr==null) descr = "";
    aBIObject.setDescription(descr);
    // set encrypt flag
    if(hibBIObject.getEncrypt()!=null){
      aBIObject.setEncrypt(new Integer(hibBIObject.getEncrypt().intValue()));
    }
    else aBIObject.setEncrypt(new Integer(0));

    // set visible flag
    if(hibBIObject.getVisible()!=null){
      aBIObject.setVisible(new Integer(hibBIObject.getVisible().intValue()));
    }
    else aBIObject.setVisible(new Integer(0));

    // set profiled visibility information
    aBIObject.setProfiledVisibility(hibBIObject.getProfiledVisibility());
    // set engine           
    aBIObject.setEngine(new EngineDAOHibImpl().toEngine(hibBIObject.getSbiEngines()));
    // set data source
    if (hibBIObject.getDataSource()!=null){
      aBIObject.setDataSourceId(new Integer(hibBIObject.getDataSource().getDsId()));
    }
    if (hibBIObject.getDataSet()!=null){
      aBIObject.setDataSetId(new Integer(hibBIObject.getDataSet().getDsId()));
    }

    // set id
    aBIObject.setId(hibBIObject.getBiobjId());
    aBIObject.setLabel(hibBIObject.getLabel());
    aBIObject.setName(hibBIObject.getName());
    // set path
    aBIObject.setPath(hibBIObject.getPath());
    aBIObject.setUuid(hibBIObject.getUuid());
    aBIObject.setRelName(hibBIObject.getRelName());
    aBIObject.setStateCode(hibBIObject.getStateCode());
    aBIObject.setStateID(hibBIObject.getState().getValueId());

    List functionlities = new ArrayList();
    Set hibObjFuncs = hibBIObject.getSbiObjFuncs();
    for (Iterator it = hibObjFuncs.iterator(); it.hasNext(); ) {
      SbiObjFunc aSbiObjFunc = (SbiObjFunc) it.next();
      Integer functionalityId = aSbiObjFunc.getId().getSbiFunctions().getFunctId();
      functionlities.add(functionalityId);
    }
    aBIObject.setFunctionalities(functionlities);
   
    List businessObjectParameters = new ArrayList();
    Set hibObjPars = hibBIObject.getSbiObjPars();
    if(hibObjPars!=null){
      for (Iterator it = hibObjPars.iterator(); it.hasNext(); ) {
        SbiObjPar aSbiObjPar = (SbiObjPar) it.next();
        BIObjectParameter par = toBIObjectParameter(aSbiObjPar);
        businessObjectParameters.add(par);
      }
      aBIObject.setBiObjectParameters(businessObjectParameters);
    }

    aBIObject.setCreationDate(hibBIObject.getCreationDate());
    aBIObject.setCreationUser(hibBIObject.getCreationUser());

    aBIObject.setRefreshSeconds(hibBIObject.getRefreshSeconds());
    logger.debug("OUT");
    return aBIObject;
  }
View Full Code Here

  private static Logger logger = Logger.getLogger(ExecuteDocumentAction.class);
 
  public void doService() {
    logger.debug("IN");
    try {
      BIObject obj = getRequiredBIObject();
      if (obj != null) {
        UserProfile profile = (UserProfile) this.getUserProfile();
          boolean canSee = ObjectsAccessVerifier.canSee(obj, profile);
          if (!canSee) {
            logger.error("User [" + profile.getUserId() + "] cannot see document [id: '" + obj.getId() + "', label: '" + obj.getLabel() + "'].");
          } else {
          this.getServiceResponse().setAttribute(SpagoBIConstants.OBJECT, obj);
          SubObject subObject = getRequiredSubObject(obj);
          if (subObject != null) {
            if (profile.isAbleToExecuteAction(SpagoBIConstants.DOCUMENT_MANAGEMENT_ADMIN) ||
                (subObject.getIsPublic().booleanValue() || subObject.getOwner().equals(profile.getUserId()))) {
              this.getServiceResponse().setAttribute(SpagoBIConstants.SUBOBJECT, subObject);
            } else {
              logger.warn("User cannot see subobject [" + subObject.getName() + "] of document with label [" + obj.getLabel() + "].");
            }
          }
          }
      } else {
        logger.error("Document not found.");
View Full Code Here

    logger.debug("IN");
      Integer id = this.getAttributeAsInteger(ObjectsTreeConstants.OBJECT_ID);
      logger.debug("Document id in request is [" + id + "]");
      String label = this.getAttributeAsString(ObjectsTreeConstants.OBJECT_LABEL);
      logger.debug("Document label in request is [" + label + "]");
      BIObject obj = null;
      if (id != null) {
        obj = DAOFactory.getBIObjectDAO().loadBIObjectById(id);
      } else if (label != null) {
        obj = DAOFactory.getBIObjectDAO().loadBIObjectByLabel(label);
      }
View Full Code Here

      Integer id = this.getAttributeAsInteger(SpagoBIConstants.OBJECT_ID);
      if(id==null){
        logger.error("Document id not found");
        return;
      }
      BIObject document=DAOFactory.getBIObjectDAO().loadBIObjectById(id);
      String docName=document.getName();

     
//      **************get the template*****************
      logger.debug("getting template");

View Full Code Here

   
    try {
     
      // retrieving execution instance from session, no need to check if user is able to execute the current document
      ExecutionInstance executionInstance = getContext().getExecutionInstance( ExecutionInstance.class.getName() );
      BIObject obj = executionInstance.getBIObject();
      BIObjectNotesManager objectNManager = new BIObjectNotesManager();
      String execIdentifier = objectNManager.getExecutionIdentifier(obj);
     
      String owner = this.getAttributeAsString(OWNER);
      logger.debug("Parameter [" + OWNER + "] is equal to [" + owner + "]");
     
      logger.debug("Deleting notes...");
      String resultStr = null;
      try {
        ObjNote objnote = null;
        try {
          objnote = DAOFactory.getObjNoteDAO().getExecutionNotesByOwner(obj.getId(), execIdentifier, owner);
        } catch (Exception e) {
          logger.error("Cannot load notes for document [id: " + obj.getId() + ", label: " + obj.getLabel() + ", name: " + obj.getName() + "]", e);
          throw new SpagoBIServiceException(SERVICE_NAME, "Cannot erase notes", e);
        }
       
        DAOFactory.getObjNoteDAO().eraseNotesByOwner(obj.getId(), execIdentifier, owner);
     
        logger.debug("Notes deleted");
        resultStr = "ok";
      } catch (Exception e) {
        throw new SpagoBIServiceException(SERVICE_NAME, "Error while deleting notes", e);
View Full Code Here

  /* (non-Javadoc)
   * @see it.eng.spagobi.analiticalmodel.document.dao.IBIObjectDAO#loadBIObjectForDetail(java.lang.String)
   */
  public BIObject loadBIObjectForDetail(String path) throws EMFUserError {
    logger.debug("IN");
    BIObject biObject = null;
    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
View Full Code Here

TOP

Related Classes of it.eng.spagobi.analiticalmodel.document.bo.BIObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.