Examples of GroupModel


Examples of org.apache.taglibs.rdc.core.GroupModel

  public void collect(JspContext ctx, JspFragment bodyFragment)
    throws JspException, IOException {
   
    checkRuleSetStatus();

    GroupModel groupModel = (GroupModel) stateMap.get(groupTag.getId());
    Map modelMap = groupModel.getLocalMap();

    if (modelMap.get(Constants.STR_INIT_ONLY_FLAG) == Boolean.TRUE) {
      // Start off with all children in dormant state
      setStateChildren(modelMap, Constants.FSM_DORMANT);
      groupState = Constants.GRP_ALL_CHILDREN_DORMANT;
      groupModel.setState(Constants.GRP_STATE_RUNNING);
      modelMap.put(Constants.STR_INIT_ONLY_FLAG, Boolean.FALSE);
    }

    if (groupModel.getState() == Constants.GRP_STATE_RUNNING) {
      do {
        dialogManager(groupTag);
        if (bodyFragment != null) {
          bodyFragment.invoke(null);
        }
View Full Code Here

Examples of org.apache.taglibs.rdc.core.GroupModel

   * This method does the rule based dialog management based on the
   * navigational rules supplied
   */
  private void dialogManager(GroupTag groupTag) {

    GroupModel groupModel = (GroupModel) stateMap.get(groupTag.getId());
    Map children = groupModel.getLocalMap();
    if (children == null) {
      return;
    }

    List activeChildren = groupModel.getActiveChildren();
    String currentExec = null;
    NavigationRule navRule = null;

    if (activeChildren.size() == 0) {
      /*
 
View Full Code Here

Examples of org.apache.taglibs.rdc.core.GroupModel

      throw new JspException(Constants.ERR_EMPTY_RDC_STACK);
    }

    // Get the GroupModel from the stateMap or create one if it does not
    // exist and put it in stateMap  
    GroupModel groupModel = (GroupModel) stateMap.get(groupTag.getId());
    if (groupModel == null) {
      groupModel = new GroupModel();
      groupModel.setId(groupTag.getId());
      groupModel.setSubmit(groupTag.getSubmit());
      if (groupModel.getLocalMap() == null) {
        groupModel.setLocalMap(new LinkedHashMap());
      }
      if (groupModel.getGroupConfirm() == null &&
        groupTag.getConfirm().booleanValue()) {
        groupModel.setGroupConfirm(new GroupConfirm((PageContext)
          ctx, groupModel, groupTag.getId()));
      }
      groupModel.getLocalMap().put(Constants.STR_INIT_ONLY_FLAG, Boolean.TRUE);
      stateMap.put(groupTag.getId(), groupModel);
    }

    /*
     * Return now, if:
     * 1) Caller is in initOnly mode, just return as we already registered
     * or
     * 2) In dormant state then turn for execution has not yet come.
     * Check for null value as this may be called directly from JSP page
     */
    if (((Boolean) stateMap.get(Constants.STR_INIT_ONLY_FLAG) == Boolean.TRUE)
      || (groupModel.getState() == Constants.FSM_DORMANT)) {
      return false;
    }

    Map modelMap = groupModel.getLocalMap();
    stack.push(modelMap);

    if (modelMap.get(Constants.STR_INIT_ONLY_FLAG) == Boolean.TRUE) {
      // Ask children to register if in registration phase
      if (bodyFragment != null) {
View Full Code Here

Examples of org.apache.taglibs.rdc.core.GroupModel

   *
   *
   */   
  public void confirm() {
   
    GroupModel groupModel = (GroupModel) stateMap.get(groupTag.getId());
    Map modelMap = groupModel.getLocalMap();
   
    if (groupModel.getState() == Constants.GRP_STATE_RUNNING) {
      if (groupState == Constants.GRP_ALL_CHILDREN_DONE) {
        if (groupTag.getConfirm().booleanValue()) {
          if (groupModel.getGroupConfirm().doGroupConfirmation() ==
            Constants.CONF_STATE_DONE) {
              groupModel.setState(Constants.GRP_STATE_DONE);
          }
        } else {
          groupModel.setState(Constants.GRP_STATE_DONE);
        }
      }
    }
  }
View Full Code Here

Examples of org.apache.taglibs.rdc.core.GroupModel

   *
   *
   */ 
  public void finish(JspContext ctx) throws JspException, IOException {
   
    GroupModel groupModel = (GroupModel) stateMap.get(groupTag.getId());
    Map modelMap = groupModel.getLocalMap();
 
    // Populate the return value HashMap and provide the JSP scripting var
    if (groupModel.getState() == Constants.GRP_STATE_DONE) {
      Map retValMap = createReturnValueMap(modelMap);
      groupModel.setValue(retValMap);
      ctx.setAttribute(groupTag.getId(), retValMap);
    }
 
    stack.pop();
  }
View Full Code Here

Examples of org.apache.taglibs.rdc.core.GroupModel

   *
   */   
  public void collect(JspContext ctx, JspFragment bodyFragment)
    throws JspException, IOException {
   
    GroupModel groupModel = (GroupModel) stateMap.get(groupTag.getId());
    Map modelMap = groupModel.getLocalMap();

    if (modelMap.get(Constants.STR_INIT_ONLY_FLAG) == Boolean.TRUE) {
      // DD starts off with all children in dormant state
      setStateChildren(modelMap, Constants.FSM_DORMANT);
      groupState = Constants.GRP_ALL_CHILDREN_DORMANT;
      groupModel.setState(Constants.GRP_STATE_RUNNING);
      modelMap.put(Constants.STR_INIT_ONLY_FLAG, Boolean.FALSE);
    } else {
      groupState = getGroupState(groupModel);
    }
 
    // Real work at the component level is done here
    if (groupModel.getState() == Constants.GRP_STATE_RUNNING) {
      do {
        dialogManagerDD(groupModel);
        if (bodyFragment != null) {
          bodyFragment.invoke(null);
        }
View Full Code Here

Examples of org.apache.taglibs.rdc.core.GroupModel

  public static boolean isChildDone(BaseModel model) {
    if (model instanceof BaseModel &&
      model.getState() == Constants.FSM_DONE) {
      return true;
    } else if (model instanceof GroupModel) {
      GroupModel grpModel = (GroupModel) model;
      if (grpModel.getGroupConfirm() != null) {
        if (grpModel.getState() == Constants.GRP_STATE_DONE) {
          return true;
        }
      } else {
        if (grpModel.getActiveChildren().size() == 0) {
          grpModel.setState(Constants.GRP_STATE_DONE);
          return true;
        }
      }
      return false;
    } else if (model instanceof ComponentModel &&
View Full Code Here

Examples of org.ofbiz.service.group.GroupModel

    private void createGroupDefs(Element baseElement, ModelService service) {
        List<? extends Element> group = UtilXml.childElementList(baseElement, "group");
        if (UtilValidate.isNotEmpty(group)) {
            Element groupElement = group.get(0);
            groupElement.setAttribute("name", "_" + service.name + ".group");
            service.internalGroup = new GroupModel(groupElement);
            service.invoke = service.internalGroup.getGroupName();
            if (Debug.verboseOn()) Debug.logVerbose("Created INTERNAL GROUP model [" + service.internalGroup + "]", module);
        }
    }
View Full Code Here

Examples of org.ofbiz.service.group.GroupModel

                populateServicesFromNameSet(allServiceNameSet);
            }
        } else if ("group".equals(this.modelService.engineName)) {
            Set<String> allServiceNameSet = FastSet.newInstance();
            GroupModel groupModel = modelService.internalGroup;
            if (groupModel == null) {
                groupModel = ServiceGroupReader.getGroupModel(this.modelService.location);
            }

            if (groupModel != null) {
                List<GroupServiceModel> groupServiceModels = groupModel.getServices();
                for (GroupServiceModel groupServiceModel: groupServiceModels) {
                    allServiceNameSet.add(groupServiceModel.getName());
                }
            }
View Full Code Here

Examples of org.ofbiz.service.group.GroupModel

     */
    public synchronized void interfaceUpdate(DispatchContext dctx) throws GenericServiceException {
        if (!inheritedParameters) {
            // services w/ engine 'group' auto-implement the grouped services
            if (this.engineName.equals("group") && implServices.size() == 0) {
                GroupModel group = internalGroup;
                if (group == null) {
                    group = ServiceGroupReader.getGroupModel(this.location);
                }
                if (group != null) {
                    for (GroupServiceModel sm: group.getServices()) {
                        implServices.add(new ModelServiceIface(sm.getName(), sm.isOptional()));
                        if (Debug.verboseOn()) Debug.logVerbose("Adding service [" + sm.getName() + "] as interface of: [" + this.name + "]", module);
                    }
                }
            }
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.