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

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


          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


      return obj;
  }

  protected SubObject getRequiredSubObject(BIObject obj) throws EMFUserError {
    logger.debug("IN");
    SubObject subObject = null;
    try {
      String subobjectName = this.getAttributeAsString(SpagoBIConstants.SUBOBJECT_NAME);
      if (subobjectName != null) {
        subObject = DAOFactory.getSubObjectDAO().getSubObjectByNameAndBIObjectId(subobjectName, obj.getId());
        if (subObject == null) {
View Full Code Here

        //delete subobjects eventually associated
        ISubObjectDAO subobjDAO = DAOFactory.getSubObjectDAO();
        List subobjects =  subobjDAO.getSubObjects(obj.getId());
        for (int i=0; i < subobjects.size(); i++){
          SubObject s = (SubObject) subobjects.get(i);
          //subobjDAO.deleteSubObject(s.getId());
          subobjDAO.deleteSubObjectSameConnection(s.getId(), aSession);
        }

        //delete viewpoints eventually associated
        List viewpoints = new ArrayList();
        IViewpointDAO biVPDAO = DAOFactory.getViewpointDAO();
View Full Code Here

      ExecutionInstance executionInstance = getContext().getExecutionInstance( ExecutionInstance.class.getName() );
      BIObject obj = executionInstance.getBIObject();
      String name = getAttributeAsString("name");
      String description = getAttributeAsString("description");
      UserProfile profile = (UserProfile) this.getUserProfile();
      SubObject subobject = executionInstance.getSubObject();
      Integer subobjectId = null;
      if (subobject != null) {
        subobjectId = subobject.getId();
      }
      String parameters = getParametersQueryString(executionInstance);
     
      String message = null;
      boolean inserted;
View Full Code Here

        } catch (EMFUserError e) {
          logger.error("Error while istantiating DAO", e);
          throw new SpagoBIServiceException(SERVICE_NAME, "Cannot access database", e);
        }
 
        SubObject subObject = null;
        try {
          subObject = dao.getSubObject(subObjectId);
        } catch (EMFUserError e) {
          logger.error("SubObject with id = " + subObjectId + " not found", e);
          throw new SpagoBIServiceException(SERVICE_NAME, "Customized view not found", e);
        }
       
        BIObject obj = executionInstance.getBIObject();
        if (obj.getId().equals(subObject.getBiobjId())) {
          boolean canExecuteSubObject = false;
          if (userProfile.isAbleToExecuteAction(SpagoBIConstants.DOCUMENT_MANAGEMENT_ADMIN)) {
            canExecuteSubObject = true;
          } else {
            if (subObject.getIsPublic() || subObject.getOwner().equals(userProfile.getUserId().toString())) {
              canExecuteSubObject = true;
            }
          }
          if (canExecuteSubObject) {
            executionInstance.setSubObject(subObject);
View Full Code Here

 
  /* (non-Javadoc)
   * @see it.eng.spagobi.analiticalmodel.document.dao.ISubObjectDAO#getSubObject(java.lang.Integer)
   */
  public SubObject getSubObject(Integer idSubObj) throws EMFUserError {
    SubObject sub = null;
    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
View Full Code Here

    return subObjId;
  }
   
 
  private SubObject toSubobject(SbiSubObjects hibsub) {
    SubObject subobj = new SubObject();
    subobj.setBiobjId(hibsub.getSbiObject().getBiobjId());
    subobj.setCreationDate(hibsub.getCreationDate());
    subobj.setDescription(hibsub.getDescription());
    subobj.setId(hibsub.getSubObjId());
    subobj.setIsPublic(hibsub.getIsPublic());
    subobj.setLastChangeDate(hibsub.getLastChangeDate());
    subobj.setName(hibsub.getName());
    subobj.setOwner(hibsub.getOwner());
    subobj.setContent(hibsub.getSbiBinContents().getContent());
    subobj.setBinaryContentId(hibsub.getSbiBinContents().getId());
    return subobj;
  }
View Full Code Here

    }
    return subObjId;
  }
 
  public SubObject getSubObjectByNameAndBIObjectId(String subobjectName, Integer idBIObj) throws EMFUserError {
    SubObject subObject = null;
    List subObjects = this.getSubObjects(idBIObj);
    if (subObjects != null && subObjects.size() > 0) {
      Iterator it = subObjects.iterator();
      while (it.hasNext()) {
        SubObject temp = (SubObject) it.next();
        if (temp.getName().equalsIgnoreCase(subobjectName)) {
          subObject = temp;
          break;
        }
      }
    }
View Full Code Here

          result.put("canSeeDocument", false);
        } else {
          JSONObject document = (JSONObject) SerializerFactory.getSerializer("application/json").serialize( obj ,locale);
          result.put("document", document);
          result.put("canSeeDocument", true);           
          SubObject subObject = getRequiredSubObject(obj);
          if (subObject != null) {
            if (profile.isAbleToExecuteAction(SpagoBIConstants.DOCUMENT_MANAGEMENT_ADMIN) ||
                (subObject.getIsPublic().booleanValue() || subObject.getOwner().equals(profile.getUserId()))) {
              JSONObject subObjectJSON = (JSONObject) SerializerFactory.getSerializer("application/json").serialize( subObject ,locale);
              result.put("subobject", subObjectJSON);
            } else {
              logger.warn("User cannot see subobject [" + subObject.getName() + "] of document with label [" + obj.getLabel() + "].");
              result.put("canSeeSubobject", false);
            }
          }
        }
      }
View Full Code Here

        ObjMetadata metaSubObjName = new ObjMetadata();
        String textSubName = msgBuild.getMessage(SUBOBJ_NAME, locale)
        metaSubObjName.setName(textSubName);
        metaSubObjName.setDataTypeCode("GENERAL_META");
        ObjMetacontent metaContentSubObjName = new ObjMetacontent();
        SubObject subobj = DAOFactory.getSubObjectDAO().getSubObject(subObjectId);
        metaContentSubObjName.setContent(subobj.getName().getBytes());
        ObjMetaDataAndContent metaAndContentSubObjName = new ObjMetaDataAndContent();
        metaAndContentSubObjName.setMeta(metaSubObjName);
        metaAndContentSubObjName.setMetacontent(metaContentSubObjName);
        metaDataAndContents.add(metaAndContentSubObjName);
      }   
View Full Code Here

TOP

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

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.