Examples of SmsDbManager


Examples of evolaris.framework.async.business.SmsDbManager

  /**
   * @see evolaris.framework.sys.web.form.EnterEditDuplicateForm#modifyEntry(java.lang.Object, java.util.Locale, org.hibernate.Session)
   */
  @Override
  public void modifyEntry(Invocation invocation, Locale locale, Session session) {
    SmsDbManager smsDbManager = new SmsDbManager(locale,session);
    smsDbManager.modifyInvocation(invocation);
  }
View Full Code Here

Examples of evolaris.framework.async.business.SmsDbManager

  /* (non-Javadoc)
   * @see evolaris.framework.sys.web.form.EnterEditDuplicateForm#delete(java.lang.Object, java.util.Locale, org.hibernate.Session, org.apache.struts.util.MessageResources)
   */
  @Override
  public void deleteEntry(Invocation entry, Locale locale, Session session, MessageResources resources) {
    SmsDbManager mgr = new SmsDbManager(locale,session);
    mgr.deleteInteractionList(entry);
       }
View Full Code Here

Examples of evolaris.framework.async.business.SmsDbManager

  /**
   * @see evolaris.framework.sys.web.form.EnterEditDuplicateForm#createEntry(java.lang.Object, java.util.Locale, org.hibernate.Session)
   */
  @Override
  public void createEntry(Fragment fragment, Locale locale, Session session) {
    SmsDbManager smsDbManager = new SmsDbManager(locale,session);
    smsDbManager.createFragment(fragment);
       }
View Full Code Here

Examples of evolaris.framework.async.business.SmsDbManager

  /**
   * @see evolaris.framework.sys.web.form.EnterEditDuplicateForm#modifyEntry(java.lang.Object, java.util.Locale, org.hibernate.Session)
   */
  @Override
  public void modifyEntry(Fragment fragment, Locale locale, Session session) {
    SmsDbManager smsDbManager = new SmsDbManager(locale,session);
    smsDbManager.modifyFragment(fragment);
  }
View Full Code Here

Examples of evolaris.framework.async.business.SmsDbManager

  /**
   * @see evolaris.framework.sys.web.form.EnterEditDuplicateForm#delete(java.lang.Object, java.util.Locale, org.hibernate.Session, org.apache.struts.util.MessageResources)
   */
  @Override
  public void deleteEntry(Fragment entry, Locale locale, Session session, MessageResources resources) {
    SmsDbManager mgr = new SmsDbManager(locale,session);
    mgr.deleteFragment(entry);
       }
View Full Code Here

Examples of evolaris.framework.async.business.SmsDbManager

  /**
   * @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
   */
  public ActionForward list(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    Group groupToDisplay = getCurrentGroup(req);
    SmsDbManager smsDbManager = new SmsDbManager(locale, session);
   
    List<Fragment> fragments = smsDbManager.getFragments(groupToDisplay);
    for (Fragment fragment : fragments) {  // fill the cache
      Hibernate.initialize(fragment);
    }
    req.setAttribute("fragments", fragments);
    return mapping.findForward("list");
View Full Code Here

Examples of evolaris.framework.async.business.SmsDbManager

    }
    checkAccessRights(req,oldInvocation.getGroup(),null);
    req.getSession().setAttribute("oldInteractionListId", oldInvocation.getId());
    Set<CommandEntry> commandEntries = oldInvocation.getCommandEntries();
    Invocation editedInvocation = f.toEntry(new Invocation(), locale, session, getResources(req));
    SmsDbManager smsDbManager = new SmsDbManager(locale,session);
    req.getSession().setAttribute("newInteractionList", editedInvocation)// needed when we duplicate or come back
    smsDbManager.checkInvocationUniqueness(editedInvocation,false);
    smsDbManager.checkIfInvocationAllowed(editedInvocation,false);
   
    // mapping from command entries of the duplication source invocation
    MappingSet mappingSet = new MappingSet(commandEntries,editedInvocation.getGroup(), locale, session);
   
    req.getSession().setAttribute("mappingSet", mappingSet);
View Full Code Here

Examples of evolaris.framework.async.business.SmsDbManager

   
    Object oldInvocationId = req.getSession().getAttribute("oldInteractionListId");
    if (oldInvocationId == null || !(oldInvocationId instanceof Long)){
      throw new InputException(getResources(req).getMessage(locale, "admin.entryNotAvailable"),"old invocation entry not found in session",null,null);
    }
    Invocation oldInvocation = new SmsDbManager(locale,session).getInvocation((Long)oldInvocationId);
    if (oldInvocation == null){
      throw new InputException(getResources(req).getMessage(locale, "admin.entryNotAvailable"),"old invocation entry #" + oldInvocationId + " not found",null,null);
    }
    checkAccessRights(req,oldInvocation.getGroup(),null);

    Object newEntry = req.getSession().getAttribute("newInteractionList");
    if (newEntry == null || !(newEntry instanceof Invocation)){
      throw new InputException(getResources(req).getMessage(locale, "admin.entryNotAvailable"),"new invocation entry not found in session",null,null);
    }
   
    // reload references in current session
    Invocation newInvocation = (Invocation)newEntry;
    f.initialize(newInvocation,locale,session,getResources(req));
    newInvocation = new Invocation();
    f.toEntry(newInvocation, locale, session, getResources(req));
    checkAccessRights(req, newInvocation.getGroup(),null);
   
    // group assignment is not editable => perform source to destination automatically
    mappingSet.add(new Entry(oldInvocation.getGroup()), new Entry(newInvocation.getGroup()));
   
    // Create duplicated command entries according to the original execution order
    CommandEntryManager commandEntryManager = new CommandEntryManager(locale,session);
    SortedSet<CommandEntry> newCommandEntries = new TreeSet<CommandEntry>(new CommandEntryManager.CommandEntryComparator());
    Set<CommandEntry> oldCommandEntries = oldInvocation.getCommandEntries();
    SortedSet<CommandEntry> sortedOldCommandEntries = new TreeSet<CommandEntry>(new CommandEntryManager.CommandEntryComparator());
    sortedOldCommandEntries.addAll(oldCommandEntries);
    for (CommandEntry oldCommandEntry : sortedOldCommandEntries) {
      CommandEntryExtender extender = commandEntryManager.createCommandEntryExtender(oldCommandEntry);
      CommandEntry duplicatedCommandEntry = extender.duplicateCommandEntry(newInvocation.getGroup(),mappingSet);
      Set<InteractionList> invocations = new TreeSet<InteractionList>();
      invocations.add(newInvocation);
      duplicatedCommandEntry.setInteractionLists(invocations);
      commandEntryManager.create(duplicatedCommandEntry)// also sets the ID for sorting
      newCommandEntries.add(duplicatedCommandEntry);
    }
    newInvocation.setCommandEntries(newCommandEntries);
    SmsDbManager smsDbManager = new SmsDbManager(locale,session);
    smsDbManager.createInvocation(newInvocation);
     return mapping.findForward("duplicated");
  }
View Full Code Here

Examples of evolaris.framework.async.business.SmsDbManager

   * @param id  invocation ID
   * @return invocation entry; null if not found
   */
  @Override
  protected Invocation entryFromDatabase(long id) {
    SmsDbManager smsDbManager = new SmsDbManager(locale,session);
    return smsDbManager.getInvocation(id);
  }
View Full Code Here

Examples of evolaris.framework.async.business.SmsDbManager

  // prepares selection lists in session; optional storedMsisdn and storedEmail can be provided to always be included in the lists
  private void prepareSelectionLists(ActionForm form,HttpServletRequest req,Long storedMsisdn,String storedEmail) {
    InvocationEnterOrEditForm f = (InvocationEnterOrEditForm)form;
    Group group = groupPreparation(req, f.getGroupId());
    SmsDbManager smsDbManager = new SmsDbManager(locale,session);
    SortedSet<InvocationEnterOrEditForm.SelectableMsisdn> selectableMsisdns = new TreeSet<InvocationEnterOrEditForm.SelectableMsisdn>();
    SortedSet<InvocationEnterOrEditForm.SelectableEmail> selectableEmails = new TreeSet<InvocationEnterOrEditForm.SelectableEmail>();
    String storedMsisdnLabel = null;
    String storedEmailLabel = null;
    List<AllowedInvocation> allowedInvocations = smsDbManager.getAllowedInvocations(group);
    for (AllowedInvocation allowedInvocation : allowedInvocations) {
      Long allowedMsisdn = allowedInvocation.getMsisdn();
      if (allowedMsisdn != null){
        selectableMsisdns.add(new InvocationEnterOrEditForm.SelectableMsisdn(allowedMsisdn,allowedMsisdn+""));
        if (allowedMsisdn == storedMsisdn){
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.