Package evolaris.framework.smsservices.business.extenders

Examples of evolaris.framework.smsservices.business.extenders.CommandEntryExtender


    SortedSet<CommandEntry> newCommandEntries = new TreeSet<CommandEntry>(new CommandEntryManager.CommandEntryComparator());
    Set<CommandEntry> oldCommandEntries = oldFragment.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(newFragment.getGroup(),mappingSet);
      Set<InteractionList> fragments = new TreeSet<InteractionList>();
      fragments.add(newFragment);
      duplicatedCommandEntry.setInteractionLists(fragments);
      commandEntryManager.create(duplicatedCommandEntry)// also sets the ID for sorting
      newCommandEntries.add(duplicatedCommandEntry);
View Full Code Here


    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);
View Full Code Here

                CommandEntry lastFragmentCommandEntry = lastFragmentInteraction.getCommandEntry();
                if (lastFragmentCommandEntry instanceof BreakCommandEntry){
                  breakLabel = sortLabel;
                }
                interaction.setToolTip(lastFragmentInteraction.getToolTip())// behave like last fragment interaction concerning tool tip and conditions
                CommandEntryExtender lastFragmentCommandEntryExtender = commandEntryManager.createCommandEntryExtender(lastFragmentCommandEntry);
                commandMap.put(interaction.getIndentation(), lastFragmentCommandEntryExtender);
                if (!contactAvailable && lastFragmentCommandEntryExtender.assignsContact()){
                  contactAssignLabel = sortLabel;
                }
              }
            }
           }
        }
      }
     
      // check for outer loops and current user set access outside of loops
      if (commandEntry instanceof IterateCommandEntry){
        if (!withinLoop){
          loopLabel = sortLabel;
        }
      } else if (!interaction.isError() && !withinLoop && commandEntryExtender.requiresCurrentUserSet()){
        interaction.setError(true);
        interaction.setErrorDescription(messages.getString("smssvc.AccessedCurrentUserSetIsNotAvailable"));
      }
     
      // check for available contact user; no checks and prefix setting if contact already available
      if (!contactAvailable){  // both contact user assigning interactions return "a" in case of success
        if (!interaction.isError() && commandEntryExtender.requiresContactUser()){
          interaction.setError(true);
          interaction.setErrorDescription(messages.getString("smssvc.AccessedContactMayNotBeAvailable"));
        }
         if (commandEntryExtender.assignsContact()){
           contactAssignLabel = sortLabel;
        }
      }
     
      // check if command not usuable in this list by creating a command entry with the dummy event parameters
      if (!interaction.isError() && eventParameters != null && commandEntryExtender.createCommand(eventParameters, new EventVariables(eventParameters), null) == null){
        interaction.setError(true);
        interaction.setErrorDescription(messages.getString("InteractionNotAllowedInThisInteractionList"));
      }
     
      // add condition entries if appropriate           
      if (previousCommandEntry != null) {       
        String condString = commandEntryManager.getCondition(previousCommandEntry, commandEntry);
        String baseStringRepresentation = sortLabel.getBaseStringRepresentation();
        if (condString != null && !labelsUsedForCondition.contains(baseStringRepresentation)) {
          DisplayableInteractionContent condition = new DisplayableInteractionContent();
          condition.setIndentation(interaction.getIndentation() - 1)// indent one less than statement itself
          condition.setCondition(true);
          CommandEntryExtender parentCommand = commandMap.get(interaction.getIndentation()-1);
          if (parentCommand != null) {
            if (parentCommand instanceof UpcallCommandEntryExtender){
              condition.setInteractionDescription(messages.getString(parentCommand.getTooltipKey())+" '"+condString+"':");  
            } else if (parentCommand instanceof HttpCommandEntryExtender) {
              if (condString.startsWith("a")){
                condition.setInteractionDescription(messages.getString(parentCommand.getTooltipKey() + "_a___") + (condString.length() >= 2 ? (" (" + condString.substring(1) + ")") : ""));
                if (((HttpCommandEntryExtender)parentCommand).getCommandEntry().getNofEvaluatedResponseLetters() < condString.length() - 1) {
                  condition.setError(true);
                  condition.setErrorDescription(messages.getString("smssvc.unreachableBranch"));
                }
              } else if (condString.equals("b")){
                condition.setInteractionDescription(messages.getString(parentCommand.getTooltipKey() + "_b"));
              } else {
                condition.setInteractionDescription( messages.getString("smssvc.unreachableBranch"));
                condition.setError(true);
                condition.setErrorDescription(messages.getString("smssvc.unreachableBranch"));
              }
            } else if (parentCommand instanceof ImageRecognitionCommandEntryExtender) {
              try {
                condition.setInteractionDescription(messages.getString("smssvc.imageRecognition." + condString) + ":");
              } catch (Exception e) {
                condition.setInteractionDescription( messages.getString("smssvc.unreachableBranch"));
                condition.setError(true);
                condition.setErrorDescription(messages.getString("smssvc.unreachableBranch"));
              }
            } else {
              String conditionKeyBase = parentCommand.getTooltipKey();
              String conditionKey = conditionKeyBase + "_" + condString;
              String conditionDescription = condString;
              try {
                conditionDescription = messages.getString(conditionKey);
              } catch (Exception e) {
View Full Code Here

    Object commandEntryParameter = req.getAttribute("commandEntry");
    if (commandEntryParameter == null || !(commandEntryParameter instanceof CommandEntry)){
      throw new BugException("no command entry returned by the interaction enter action");
    }
    CommandEntry commandEntry = (CommandEntry)commandEntryParameter;
    CommandEntryExtender commandEntryExtender = commandEntryManager.createCommandEntryExtender(commandEntry);
    commandEntryExtender.reloadReferences()// reload outdated references
    // check access rights
    if (!req.isUserInRole(UserManagerBase.ADMINISTRATOR) && commandEntry.getGroup() != webUser.getGroup()) {
      throw new InputException(getResources(req).getMessage(locale, "smssvc.insufficientRights"));
    }
    commandEntryManager.createOrModify(commandEntry);
View Full Code Here

    SortedSet<CommandEntry> newCommandEntries = new TreeSet<CommandEntry>(new CommandEntryManager.CommandEntryComparator());
    Set<CommandEntry> oldCommandEntries = oldTimerEvent.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(newTimerEvent.getGroup(),mappingSet);
      Set<TimerEvent> timerEvents = new TreeSet<TimerEvent>();
      timerEvents.add(newTimerEvent);
      duplicatedCommandEntry.setTimerEvents(timerEvents);
      commandEntryManager.create(duplicatedCommandEntry)// also sets the ID for sorting
      newCommandEntries.add(duplicatedCommandEntry);
View Full Code Here

TOP

Related Classes of evolaris.framework.smsservices.business.extenders.CommandEntryExtender

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.