Package com.centraview.administration.authorization

Examples of com.centraview.administration.authorization.AuthorizationLocal


  {
    boolean retVal = false;
    try {
      InitialContext ic = CVUtility.getInitialContext();
      AuthorizationLocalHome home = (AuthorizationLocalHome) ic.lookup("local/Authorization");
      AuthorizationLocal local = home.create();
      local.setDataSource(dataSource);
      retVal = local.isModuleVisible(moduleName, individualId);
    } catch (Exception e) {
      logger.error("[isModuleVisible]: Exception", e);
    }
    return retVal;
  }
View Full Code Here


  {
    HashMap hm = new HashMap();
    try {
      InitialContext ic = CVUtility.getInitialContext();
      AuthorizationLocalHome home = (AuthorizationLocalHome) ic.lookup("local/Authorization");
      AuthorizationLocal local = home.create();
      local.setDataSource(dataSource);

      hm = local.getNoneRightFieldMethod(moduleName, individualId);
      if (hm != null) {
        Collection col = hm.values();
        Iterator it = col.iterator();

        Class clDB = objDBVO.getClass();
View Full Code Here

  {
    ModuleFieldRightMatrix retVal = null;
    try {
      InitialContext ic = CVUtility.getInitialContext();
      AuthorizationLocalHome home = (AuthorizationLocalHome) ic.lookup("local/Authorization");
      AuthorizationLocal local = home.create();
      local.setDataSource(dataSource);
      retVal = local.getUserSecurityProfileMatrix(moduleName, individualId, byListCol);
    } catch (Exception e) {
      logger.error("[getUserModuleRight]: Exception", e);
    }
    return retVal;
  }
View Full Code Here

  {
    boolean retVal = false;
    try {
      InitialContext ic = CVUtility.getInitialContext();
      AuthorizationLocalHome home = (AuthorizationLocalHome) ic.lookup("local/Authorization");
      AuthorizationLocal local = home.create();
      local.setDataSource(dataSource);
      retVal = local.canPerformRecordOperation(indId, moduleName, recordId, privilegeLevel);
    } catch (Exception e) {
      logger.error("[canPerformRecordOperation]: Exception", e);
    }
    return retVal;
  }
View Full Code Here

        }
      }

      InitialContext ic = CVUtility.getInitialContext();
      AuthorizationLocalHome authorizationHome = (AuthorizationLocalHome)ic.lookup("local/Authorization");
      AuthorizationLocal authorizationLocal = authorizationHome.create();
      authorizationLocal.setDataSource(dataSource);
      authorizationLocal.saveCurrentDefaultPermission("Projects", projectId, userId);
    }catch (Exception e){
      System.out.println("[Exception][ProjectEJB.addProject] Exception Thrown: " + e);
      e.printStackTrace();
    }finally{
      dl.destroy();
View Full Code Here

        }
      }

      // TODO: we may not need to do this as tasks are activites and activites don't seem to use recordauth.
      AuthorizationLocalHome authorizationHome = (AuthorizationLocalHome)ic.lookup("local/Authorization");
      AuthorizationLocal authorizationLocal = authorizationHome.create();
      authorizationLocal.setDataSource(dataSource);
      authorizationLocal.saveCurrentDefaultPermission("Tasks", activityId, userId);
    }catch (Exception e){
      System.out.println("[Exception][TaskEJB.addTask] Exception Thrown: " + e);
      e.printStackTrace();
    }finally{
      dl.destroy();
View Full Code Here

      timeSlipId = dl.getAutoGeneratedKey();

            InitialContext ic = CVUtility.getInitialContext();
            AuthorizationLocalHome authorizationHome = (AuthorizationLocalHome)ic.lookup("local/Authorization");
            AuthorizationLocal authorizationLocal = authorizationHome.create();
            authorizationLocal.setDataSource(dataSource);
            authorizationLocal.saveCurrentDefaultPermission("Time Slips", timeSlipId, userId);
    }
    catch(Exception e)
    {
      System.out.println("[Exception][TimeSlipEJB.addTimeSlip] Exception Thrown: "+e);
      e.printStackTrace();
View Full Code Here

      ContactHelperLocal contactHelperRemote =  contactHelperHome.create();
      contactHelperRemote.setDataSource(this.dataSource);

      // Setting the Record Permission for newly Created record.
      AuthorizationLocalHome authHome=(AuthorizationLocalHome)ic.lookup("local/Authorization");
      AuthorizationLocal authRemote=(AuthorizationLocal)authHome.create();
      authRemote.setDataSource(this.dataSource);

      // get the Default Error Message Template for the Support replying emails
      EmailSettingsLocalHome emailSettingsHome=(EmailSettingsLocalHome)ic.lookup("local/EmailSettings");
      EmailSettingsLocal emailSettingsRemote=(EmailSettingsLocal)emailSettingsHome.create();
      emailSettingsRemote.setDataSource(this.dataSource);

      // Its a predefined Template for the replying message for the newly created Ticket
      EmailTemplateForm ticketTemplateForm = emailSettingsRemote.getEmailTemplate(AdministrationConstantKeys.EMAIL_TEMPLATE_SUPPORTTICKET);

      // Its a predefined Template for the replying message for the new created Thread
      EmailTemplateForm threadTemplateForm = emailSettingsRemote.getEmailTemplate(AdministrationConstantKeys.EMAIL_TEMPLATE_SUPPORTTHREAD);

      // Its a predefined Template for the replying for Error Message
      EmailTemplateForm errorTemplateForm = emailSettingsRemote.getEmailTemplate(AdministrationConstantKeys.EMAIL_TEMPLATE_SUPPORTERROR);

      emailSettingsRemote = null;
      emailSettingsHome = null;

      String defaultMessageBody = "";

      for (int i=0; i < messageIDs.size() ; i++) {
        int messageID = ((Integer) messageIDs.get(i)).intValue();
        if (messageID != -1) {
          MailMessageVO mailMessageVO = this.getEmailMessageVO(ownerID, messageID);
          String messageFrom = mailMessageVO.getFromAddress();

          InternetAddress emailAddress = new InternetAddress(messageFrom);
          messageFrom = emailAddress.getAddress();

          String messageSubject = mailMessageVO.getSubject();
          String messageBody = mailMessageVO.getBody();
          Html2Text plainMessageBody = new Html2Text(messageBody);

          int accountID = mailMessageVO.getEmailAccountID();
          int ticketID = 0;

          int startIndex = messageSubject.indexOf("TICKET#");
          int endIndex = -1;
          if (startIndex >0) {
            endIndex = messageSubject.indexOf("#",(startIndex + 7));
          }

          if (startIndex >0 && endIndex > startIndex) {
            startIndex = startIndex + 7;
            String tempTicketID =messageSubject.substring(startIndex,endIndex);
            if (tempTicketID != null && !tempTicketID.equals("")) {
              ticketID = Integer.parseInt(tempTicketID);
            }
          }

          if (ticketID == 0) {
            TicketVO ticketVO = new TicketVO();
            ticketVO.setTitle(messageSubject);
            ticketVO.setDetail(plainMessageBody.getPlainText());
            ticketVO.setPriorityId(1);
            ticketVO.setStatusId(1);
            ticketVO.setCreatedBy(ownerID);

            HashMap contactInfo = contactHelperRemote.getContactInfoForEmailAddress(messageFrom);

            int assignedId = 0;
            int entityId = 0;
            int individualId = 0;

            if (strAssignedID != null && !strAssignedID.equals("")) {
              try {
                assignedId = Integer.parseInt(strAssignedID);
              } catch(NumberFormatException nfe){
                // already set a default value
              }
            }

            if (contactInfo != null && contactInfo.size() != 0) {
              entityId = ((Number) contactInfo.get("EntityID")).intValue();
              individualId = ((Number) contactInfo.get("IndividualID")).intValue();
            }else{
              // initialize thread vo
              ThreadVO tVO = new ThreadVO();
              tVO.setTitle(messageFrom+": "+messageSubject);
              tVO.setDetail("");
              tVO.setPriorityId(1);
              tVO.setCreatedBy(ownerID);
              tVO.setOwner(ownerID);

              ticketVO.setThreadVO(tVO);
            } // end of else if (contactInfo != null && contactInfo.size() != 0)

            ticketVO.setAssignedToId(assignedId);
            ticketVO.setRefEntityId(entityId);
            ticketVO.setRefIndividualId(individualId);

            defaultMessageBody = ticketTemplateForm.getBody();
            String ticketSubject = ticketTemplateForm.getSubject();

            try {
              ticketID = ticketRemote.addTicket(ownerID, ticketVO);
            }catch(Exception e){
              defaultMessageBody = errorTemplateForm.getBody();
            }// end of catch block

            messageSubject = ticketSubject+"-["+messageSubject+"] TICKET#"+ticketID+"#";
            int arrBlank[] = {};
            authRemote.saveRecordPermission(ownerID,-1,"Ticket",ticketID,arrBlank,arrBlank,arrBlank);
          }else{
            // initialize thread vo
            ThreadVO tVO = new ThreadVO();
            tVO.setTitle(messageSubject);
            tVO.setDetail(plainMessageBody.getPlainText());
View Full Code Here

        } //end of while loop(itt.hasNext())
      } //end of if statement ((attchmentids != null) && (attchmentids.size() != 0))

            InitialContext ic = CVUtility.getInitialContext();
            AuthorizationLocalHome authorizationHome = (AuthorizationLocalHome)ic.lookup("local/Authorization");
            AuthorizationLocal authorizationLocal = authorizationHome.create();
            authorizationLocal.setDataSource(dataSource);
            authorizationLocal.saveCurrentDefaultPermission("Events", eventid, userID);

    }
    catch(Exception exe)
    {
      exe.printStackTrace();
View Full Code Here

      itemID = cvdl.getAutoGeneratedKey();

      InitialContext ic = CVUtility.getInitialContext();
      AuthorizationLocalHome authorizationHome = (AuthorizationLocalHome)ic.lookup("local/Authorization");
      AuthorizationLocal authorizationLocal = authorizationHome.create();
      authorizationLocal.setDataSource(dataSource);
      authorizationLocal.saveCurrentDefaultPermission("Item", itemID, individualID);

    }catch(Exception e){
      System.out.println("[Exception][ItemEJB.addItem] Exception Thrown: " + e);
      //e.printStackTrace();
      throw new ItemException(ItemException.INSERT_FAILED, "Failed in item ejb while adding item");
View Full Code Here

TOP

Related Classes of com.centraview.administration.authorization.AuthorizationLocal

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.