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

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


      String subobjectIdStr = (String) serviceRequest.getAttribute("subobject_id");
      Integer subobjectId = null;
      if (subobjectIdStr != null && !subobjectIdStr.trim().equals("")) {
        subobjectId = new Integer(subobjectIdStr);
        // check if user is able to see the required subobject
        SubObject subobject = DAOFactory.getSubObjectDAO().getSubObject(subobjectId);
        if (!subobject.getIsPublic() && !subobject.getOwner().equals(userId)) {
          logger.error("Current user [" + userId + "] CANNOT execute subobject with id = " + subobjectId + " of document with id = " + docId + "!!!!");
          throw new Exception("Current user [" + userId + "] CANNOT execute subobject with id = " + subobjectId + " of document with id = " + docId + "!!!!");
        }
      }
     
View Full Code Here


   */
  public Map getParameterMap(Object analyticalDocument, Object analyticalDocumentSubObject, IEngUserProfile profile, String roleName) {
   
    Map parameters;
    BIObject biObject;
    SubObject subObject;
   
    logger.debug("IN");
   
    try{
      Assert.assertNotNull(analyticalDocument, "Input parameter [analyticalDocument] cannot be null");
      Assert.assertTrue((analyticalDocument instanceof BIObject), "Input parameter [analyticalDocument] cannot be an instance of [" + analyticalDocument.getClass().getName()+ "]");
      biObject = (BIObject)analyticalDocument;
     
      if(analyticalDocumentSubObject == null) {
        logger.warn("Input parameter [subObject] is null");
        return getParameterMap(analyticalDocument, profile, roleName);
      }       
      Assert.assertTrue((analyticalDocumentSubObject instanceof SubObject), "Input parameter [subObjectDetail] cannot be an instance of [" + analyticalDocumentSubObject.getClass().getName()+ "]");
      subObject = (SubObject) analyticalDocumentSubObject;
           
      parameters = getRequestParameters(biObject);
     
      parameters.put("nameSubObject",  subObject.getName() != null? subObject.getName(): "" );
      parameters.put("descriptionSubObject", subObject.getDescription() != null? subObject.getDescription(): "");
      parameters.put("visibilitySubObject", subObject.getIsPublic().booleanValue()?"Public":"Private" );
      parameters.put("subobjectId", subObject.getId());
     
      parameters = applySecurity(parameters, profile);
      //parameters = addDocumentParametersInfo(parameters, biObject);
      parameters = applyService(parameters, biObject);
      parameters.put("isFromCross", "false");
View Full Code Here

   */
  public Map getParameterMap(Object analyticalDocument, Object analyticalDocumentSubObject, IEngUserProfile profile, String roleName) {
   
    Map parameters;
    BIObject biObject;
    SubObject subObject;
   
    logger.debug("IN");
   
    try{
      Assert.assertNotNull(analyticalDocument, "Input parameter [analyticalDocument] cannot be null");
      Assert.assertTrue((analyticalDocument instanceof BIObject), "Input parameter [analyticalDocument] cannot be an instance of [" + analyticalDocument.getClass().getName()+ "]");
      biObject = (BIObject)analyticalDocument;
     
      if(analyticalDocumentSubObject == null) {
        logger.warn("Input parameter [subObject] is null");
        return getParameterMap(analyticalDocument, profile, roleName);
      }       
      Assert.assertTrue((analyticalDocumentSubObject instanceof SubObject), "Input parameter [subObjectDetail] cannot be an instance of [" + analyticalDocumentSubObject.getClass().getName()+ "]");
      subObject = (SubObject) analyticalDocumentSubObject;
           
      parameters = getRequestParameters(biObject);
     
      parameters.put("nameSubObject",  subObject.getName() != null? subObject.getName(): "" );
      parameters.put("descriptionSubObject", subObject.getDescription() != null? subObject.getDescription(): "");
      parameters.put("visibilitySubObject", subObject.getIsPublic().booleanValue()?"Public":"Private" );
      parameters.put("subobjectId", subObject.getId());
     
      parameters = applySecurity(parameters, profile);
      //parameters = addDocumentParametersInfo(parameters, biObject);
      parameters = applyService(parameters, biObject);
      parameters.put("isFromCross", "false");
View Full Code Here

   
    Map map = new Hashtable();
    try{
      BIObject biobj = (BIObject)object;
      map = getMap(biobj);
      SubObject subObjectDetail = (SubObject) subObject;
     
      Integer id = subObjectDetail.getId();
     
      map.put("nameSubObject",  subObjectDetail.getName() != null? subObjectDetail.getName(): "" );
      map.put("descriptionSubObject", subObjectDetail.getDescription() != null? subObjectDetail.getDescription(): "");
      map.put("visibilitySubObject", subObjectDetail.getIsPublic().booleanValue()?"Public":"Private" );
          map.put("subobjectId", subObjectDetail.getId());
   
     
    } catch (ClassCastException cce) {
        logger.error("The second parameter is not a SubObjectDetail type", cce);
    }
View Full Code Here

  Map map = new Hashtable();
  try {
      BIObject biobj = (BIObject) object;
      map = getMap(biobj);
      SubObject subObjectDetail = (SubObject) subObject;

      Integer id = subObjectDetail.getId();

      map.put("nameSubObject", subObjectDetail.getName());
      map.put("descriptionSubObject", subObjectDetail.getDescription());
      map.put("visibilitySubObject", subObjectDetail.getIsPublic().booleanValue() ? "Public" : "Private");
      map.put("subobjectId", subObjectDetail.getId());

  } catch (ClassCastException cce) {
      logger.error("The second parameter is not a SubObjectDetail type", cce);
  }
View Full Code Here

   */
  public Map getParameterMap(Object analyticalDocument, Object analyticalDocumentSubObject, IEngUserProfile profile, String roleName) {
   
    Map parameters;
    BIObject biObject;
    SubObject subObject;
   
    logger.debug("IN");
   
    try{
      Assert.assertNotNull(analyticalDocument, "Input parameter [analyticalDocument] cannot be null");
      Assert.assertTrue((analyticalDocument instanceof BIObject), "Input parameter [analyticalDocument] cannot be an instance of [" + analyticalDocument.getClass().getName()+ "]");
      biObject = (BIObject)analyticalDocument;
     
      if(analyticalDocumentSubObject == null) {
        logger.warn("Input parameter [subObject] is null");
        return getParameterMap(analyticalDocument, profile, roleName);
      }       
      Assert.assertTrue((analyticalDocumentSubObject instanceof SubObject), "Input parameter [subObjectDetail] cannot be an instance of [" + analyticalDocumentSubObject.getClass().getName()+ "]");
      subObject = (SubObject) analyticalDocumentSubObject;
           
      parameters = getRequestParameters(biObject);
     
      parameters.put("nameSubObject",  subObject.getName() != null? subObject.getName(): "" );
      parameters.put("descriptionSubObject", subObject.getDescription() != null? subObject.getDescription(): "");
      parameters.put("visibilitySubObject", subObject.getIsPublic().booleanValue()?"Public":"Private" );
      parameters.put("subobjectId", subObject.getId());
     
      parameters = applySecurity(parameters, profile);
      parameters = addDocumentParametersInfo(parameters, biObject);
      parameters = applyService(parameters, biObject);
      parameters.put("isFromCross", "false");
View Full Code Here

    logger.debug("IN");
    Map map = new Hashtable();
    try {
      BIObject biobj = (BIObject) object;
      map = getMap(biobj, profile, roleName);
      SubObject subObj = (SubObject) subObject;
      map = getParameterMap(object, profile, roleName);
      String nameSub = (subObj.getName()==null)?"":subObj.getName();
      map.put("nameSubObject", nameSub);
      String descrSub = (subObj.getDescription()==null)?"":subObj.getDescription();
      map.put("descriptionSubObject", descrSub);
      String visStr = "Private";
      boolean visBool = subObj.getIsPublic().booleanValue();
      if (visBool)
        visStr = "Public";
      map.put("visibilitySubObject", visStr);
      map.put("subobjectId", subObj.getId());

    } catch (ClassCastException cce) {
      logger.error("The second parameter is not a SubObjectDetail type", cce);

    }
View Full Code Here

      logger.debug("IN");
      Content content=new Content();
      try {
          Integer id = new Integer(subObjectId);
          ISubObjectDAO subdao = DAOFactory.getSubObjectDAO();
          SubObject subobj = subdao.getSubObject(id);
          byte[] cont = subobj.getContent();
          BASE64Encoder bASE64Encoder = new BASE64Encoder();
          content.setContent(bASE64Encoder.encode(cont));
          content.setFileName(subobj.getName());
          return content;
      } catch (NumberFormatException e) {
          logger.error("NumberFormatException",e);
      } catch (EMFUserError e) {
          logger.error("EMFUserError",e);
View Full Code Here

    private Content readSubObjectContent(String user,String subObjectName, Integer objId){
      logger.debug("IN");
      Content content=new Content();
      try {
          ISubObjectDAO subdao = DAOFactory.getSubObjectDAO();
          SubObject subobj = subdao.getSubObjectByNameAndBIObjectId(subObjectName, objId);
          byte[] cont = subobj.getContent();
          BASE64Encoder bASE64Encoder = new BASE64Encoder();
          content.setContent(bASE64Encoder.encode(cont));
          content.setFileName(subobj.getName());
          return content;
      } catch (NumberFormatException e) {
          logger.error("NumberFormatException",e);
      } catch (EMFUserError e) {
          logger.error("EMFUserError",e);
View Full Code Here

      Integer docId = new Integer(documentiId);
      boolean subobjExists = false;
     
      //gets subobj if yet presents
      Integer id = null;
      SubObject objSub = subdao.getSubObjectByNameAndBIObjectId(analysisName, docId);
      if (objSub != null){
        id = objSub.getId();
        //check ability to modify:
        if (!user.equals(objSub.getOwner())) {
            logger.debug("KO - User " + user + " cannot modify subobjects");
            return "KO - You cannot modify subobjects";
          }
        subobjExists = true;
      }
      else
        objSub = new SubObject();
     
      objSub.setDescription(analysisDescription);
     
      if (visibilityBoolean!=null && visibilityBoolean.equals("true")){
        objSub.setIsPublic(new Boolean(true));
      }else{
        objSub.setIsPublic(new Boolean(false));
      }
      objSub.setOwner(user);
      objSub.setName(analysisName);
      objSub.setContent(content.getBytes());
     
      //if subobject doesn't exist, it will be created
      if (!subobjExists)
        id = subdao.saveSubObject(docId, objSub);
      else
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.