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

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


   */
  public void insertAllSubObject(BIObject biobj, List subObjectLis, Session session) throws EMFUserError {
    logger.debug("IN");
    Iterator iter=subObjectLis.iterator();
    while(iter.hasNext()){
      SubObject subObject = (SubObject)iter.next();
      insertSubObject(biobj,subObject,session);

      //  insert metadata associated to subObject
      logger.debug("search for metadata associate to subobject wit ID "+subObject.getId());
      IObjMetacontentDAO objMetacontentDAO = DAOFactory.getObjMetacontentDAO();
      //  get metacontents associated to object
      List metacontents = objMetacontentDAO.loadObjOrSubObjMetacontents(biobj.getId(), subObject.getId());
      for (Iterator iterator = metacontents.iterator(); iterator.hasNext();) {
        ObjMetacontent metacontent = (ObjMetacontent) iterator.next();
        insertObjMetacontent(metacontent, session);
      }

View Full Code Here


      String ids = this.getAttributeAsString(SUBOBJECT_ID);
      // ids contains the id of the subobjects to be deleted separated by ,
      String[] idArray = ids.split(",");
      for (int i = 0; i < idArray.length; i++) {
        Integer id = new Integer(idArray[i]);
        SubObject subObject = null;
        try {
          subObject = dao.getSubObject(id);
        } catch (EMFUserError e) {
          logger.error("SubObject with id = " + id + " not found", e);
          throw new SpagoBIServiceException(SERVICE_NAME, "Customized view not found", e);
        }
        if (subObject.getBiobjId().equals(obj.getId())) {
          boolean canDeleteSubObject = false;
          if (userProfile.isAbleToExecuteAction(SpagoBIConstants.DOCUMENT_MANAGEMENT_ADMIN)
              || subObject.getOwner().equals(userProfile.getUserId().toString())) {
            canDeleteSubObject = true;
          }
          if (canDeleteSubObject) {
            logger.info("User [id: " + userProfile.getUserUniqueIdentifier() + ", userId: " + userProfile.getUserId() + ", name: " + userProfile.getUserName() + "] " +
                "is deleting customized view [id: " + subObject.getId() + ", name: " + subObject.getName() + "] ...");
            try {
              dao.deleteSubObject(id);
            } catch (EMFUserError e) {
              throw new SpagoBIServiceException(SERVICE_NAME, "Error while deleting customized view", e);
            }
            logger.debug("Customized view [id: " + subObject.getId() + ", name: " + subObject.getName() + "] deleted.");
          } else {
            logger.error("User [id: " + userProfile.getUserUniqueIdentifier() + ", userId: " + userProfile.getUserId() + ", name: " + userProfile.getUserName() + "] cannot delete customized view");
            throw new SpagoBIServiceException(SERVICE_NAME, "User cannot delete customized view");
          }
        } else {
          logger.error("Cannot delete customized view with id = " + subObject.getBiobjId() + ": " +
              "it is not relevant to the current document [id: " + obj.getId() + ", label: " + obj.getLabel() + ", name: " + obj.getName() + "]");
          throw new SpagoBIServiceException(SERVICE_NAME, "Cannot delete customized view: it is not relevant to the current document");
        }
       
      }
View Full Code Here

      SpagoBIRequestContainer request = new SpagoBIRequestContainer(serviceRequest);
      if (request.isBlankOrNull(SpagoBIConstants.SUBOBJECT_ID)) {
        output.append("");
      } else {
        Integer subObjId = request.getInteger(SpagoBIConstants.SUBOBJECT_ID);
        SubObject subobject = DAOFactory.getSubObjectDAO().getSubObject(subObjId);
        String dateFormat = request.getString("DATE_FORMAT");
       
        String creationDate = null;
        String lastModificationDate = null;
        try {
          creationDate = StringUtils.dateToString(subobject.getCreationDate(), dateFormat);
        } catch (Exception e) {
          logger.error(e);
          creationDate = subobject.getCreationDate().toString();
        }
        try {
          lastModificationDate = StringUtils.dateToString(subobject.getLastChangeDate(), dateFormat);
        } catch (Exception e) {
          logger.error(e);
          lastModificationDate = subobject.getLastChangeDate().toString();
        }
       
        output.append("{id: " + subobject.getId().toString() + ", " +
            "name: \"" + JavaScript.escapeText(subobject.getName()) + "\", " +
            "description: \"" + JavaScript.escapeText(subobject.getDescription()) + "\", " +
            "owner: \"" + JavaScript.escapeText(subobject.getOwner()) + "\", " +
            "creationDate: \"" + JavaScript.escapeText(creationDate) + "\", " +
            "lastModificationDate: \"" + JavaScript.escapeText(lastModificationDate) + "\", " +
            "isPublic: " + JavaScript.escapeText(subobject.getIsPublic().toString()) + "}");
      }
    } catch (Exception e) {
      logger.error("Error while recovering subobjects list", e);
      output.append("");
    } finally {
View Full Code Here

      } else {
        Integer objId = request.getInteger(SpagoBIConstants.OBJECT_ID);
        List suobjects = DAOFactory.getSubObjectDAO().getPublicSubObjects(objId);
        Iterator it = suobjects.iterator();
        while (it.hasNext()) {
          SubObject subobject = (SubObject) it.next();
          output.append("{id: " + subobject.getId().toString() + ", " +
                  "name: \"" + JavaScript.escapeText(subobject.getName()) + "\", " +
                  "description: \"" + JavaScript.escapeText(subobject.getDescription()) + "\"}");
          if (it.hasNext()) {
            output.append(";;");
          }
        }
      }
View Full Code Here

    // get the list of viewpoints
    List viewpoints = getViewpointList(obj);
    // get required snapshot
    Snapshot snapshot = getRequiredSnapshot(request, snapshots);
    // get required subObject
    SubObject subObj = getRequiredSubObject(request, subObjects);
    // get parameters
    String userProvidedParametersStr = (String) request.getAttribute(ObjectsTreeConstants.PARAMETERS);
    logger.debug("Used defined parameters: [" + userProvidedParametersStr + "]");
    // get execution modality
    String modality = (String) request.getAttribute(ObjectsTreeConstants.MODALITY);
View Full Code Here

   */
  // MPenningroth 25-JAN-2008
  // Handle new LABEL_SUB_OBJECT Preference
  private SubObject getRequiredSubObject(SourceBean request, List subObjects) {
    logger.debug("IN");
    SubObject subObj = null;
    String subObjectName = (String) request.getAttribute(SpagoBIConstants.SUBOBJECT_NAME);
    String subObjectIdStr = (String) request.getAttribute(SpagoBIConstants.SUBOBJECT_ID);
    if (subObjectName == null && subObjectIdStr == null) {
      logger.debug("Neither LABEL_SUB_OBJECT nor SUBOBJECT_ID attribute in request are specified. Returning null.");
      return null;
    }
    if (subObjectName != null) {
      logger.debug("Looking for subobject with name [" + subObjectName + "] ...");
      if (subObjects != null && subObjects.size() > 0) {
        Iterator iterSubs = subObjects.iterator();
        while (iterSubs.hasNext() && subObj == null) {
          SubObject sd = (SubObject) iterSubs.next();
          if (sd.getName().equals(subObjectName.trim())) {
            subObj = sd;
            break;
          }
        }
      }
    } else {
      logger.debug("Looking for subobject with id [" + subObjectIdStr + "] ...");
      Integer subObjId = new Integer(subObjectIdStr);
      if (subObjects != null && subObjects.size() > 0) {
        Iterator iterSubs = subObjects.iterator();
        while (iterSubs.hasNext() && subObj == null) {
          SubObject sd = (SubObject) iterSubs.next();
          if (sd.getId().equals(subObjId)) {
            subObj = sd;
            break;
          }
        }
      }
View Full Code Here

        // if user is administrator, he can delete it
        if (profile.isAbleToExecuteAction(SpagoBIConstants.DOCUMENT_MANAGEMENT_ADMIN)) {
          canDelete = true;
        } else {
          // if user is not administrator, he can delete it only if he is the owner
          SubObject subobject = subobjdao.getSubObject(subobjectId);
          if (subobject == null) {
            logger.warn("Subobject with id = " + subobjectId + " not found!");
            continue;
          }
          if (subobject.getOwner().equals(userId)) {
            canDelete = true;
          }
        }
        if (canDelete) {
          logger.error("Deleting subobject with id = " + subobjectId + " ...");
View Full Code Here

   *            The response SourceBean
   */
  private void executionSubObjectHandler(SourceBean request,
      SourceBean response) throws Exception {
    logger.debug("IN");
    SubObject subObj = getRequiredSubObject(request);
    // get object from session
    ExecutionInstance instance = getExecutionInstance();
    instance.eraseParametersValues();
    // execution
    execute(instance, subObj, null, response);
View Full Code Here

  }

  private void refreshHandler(SourceBean request, SourceBean response) throws Exception {
    logger.debug("IN");
    ExecutionInstance instance = getExecutionInstance();
    SubObject subobject = getRequiredSubObject(request);
    execute(instance, subobject, null, response);
    logger.debug("OUT");
  }
View Full Code Here

    logger.debug("IN");
    try {
      List<SubObject> subobjects= DAOFactory.getSubObjectDAO().getSubObjects(biObjectID);
      if(subobjects != null){
        for(int i =0; i<subobjects.size(); i++){
          SubObject subObj = subobjects.get(i);
          if(subObj.getName() != null){
            doc.add(new Field(IndexingConstants.SUBOBJ_NAME, subObj.getName(),
              Field.Store.YES, Field.Index.ANALYZED));
          }
          if(subObj.getDescription() != null){
            doc.add(new Field(IndexingConstants.SUBOBJ_DESCR, subObj.getDescription(),
              Field.Store.YES, Field.Index.ANALYZED));
          }
        }
      }
    } catch (EMFUserError e) {
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.