<p>Make something with a model.</p>
@param pReqVars additional request scoped parameters
@throws Exception - an exception
@param pFactoryAppBeans with make
165055
@Override
  public final void make(final Map<String, Object> pReqVars) throws Exception {
    @SuppressWarnings("unchecked")
    AFactoryAppBeans<RS> factoryAppBeans =
      (AFactoryAppBeans<RS>) this.factoryAndServlet.getFactoryAppBeans();
    this.factoryAndServlet.getHttpServlet().getServletContext()
      .setAttribute("srvI18n", factoryAppBeans.lazyGet("ISrvI18n"));
    this.factoryAndServlet.getHttpServlet().getServletContext()
      .setAttribute("sessionTracker",
        factoryAppBeans.lazyGet("ISessionTracker"));
  }
1132302
@Override
  public final synchronized PrepareDbAfterGetCopy
    lazyGetPrepareDbAfterFullImport() throws Exception {
    String beanName = getPrepareDbAfterFullImportName();
    PrepareDbAfterGetCopy prepareDbAfterGetCopyMysql =
      (PrepareDbAfterGetCopy) getBeansMap().get(beanName);
    if (prepareDbAfterGetCopyMysql == null) {
      prepareDbAfterGetCopyMysql =
        new PrepareDbAfterGetCopy();
      prepareDbAfterGetCopyMysql.setLogger(lazyGetLogger());
      prepareDbAfterGetCopyMysql.setFactoryAppBeans(this);
      getBeansMap().put(beanName, prepareDbAfterGetCopyMysql);
      lazyGetLogger().info(null, FactoryAppBeansMysql.class, beanName
        + " has been created.");
    }
    return prepareDbAfterGetCopyMysql;
  }
1327404
@Override
  public final void makeFirstPrepareForSave(final Map<String, Object> pAddParam,
    final ManufacturingProcess pEntity,
      final IRequestData pRequestData) throws Exception {
    if (pEntity.getItsQuantity().doubleValue() == 0) {
      throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER,
        "Quantity is 0! " + pAddParam.get("user"));
    }
    pEntity.setInvItem(getSrvOrm()
      .retrieveEntity(pAddParam, pEntity.getInvItem()));
    if (!InvItem.WORK_IN_PROGRESS_ID.equals(pEntity.getInvItem().getItsType()
      .getItsId())) {
      throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER,
        "type_must_be_work_in_progress");
    }
    if (pEntity.getReversedId() != null) {
      pEntity.setIsComplete(true);
      pEntity.setTheRest(BigDecimal.ZERO);
    } else {
      pEntity.setTheRest(pEntity.getItsQuantity());
    }
    //rounding:
    pEntity.setItsQuantity(pEntity.getItsQuantity().setScale(
      getSrvAccSettings().lazyGetAccSettings(pAddParam)
        .getQuantityPrecision(), getSrvAccSettings()
          .lazyGetAccSettings(pAddParam).getRoundingMode()));
    pEntity.setItsCost(pEntity.getItsTotal().divide(
      pEntity.getItsQuantity(), getSrvAccSettings()
        .lazyGetAccSettings(pAddParam).getCostPrecision(),
          getSrvAccSettings().lazyGetAccSettings(pAddParam).getRoundingMode()));
  }
1220810
@NotNull
    public final ArtifactFactoryConfig init(@NotNull final SrcGen4JContext context, final Map<String, String> vars) {
        Contract.requireArgNotNull("context", context);
        this.context = context;
        inheritVariables(vars);
        return this;
    }
628411
protected final FactoryPersistableBase
    createPutFactoryPersistableBase(
      final Class<?> pBeanClass) throws Exception {
    FactoryPersistableBase factory = new FactoryPersistableBase();
    factory.setObjectClass(pBeanClass);
    factory.setDatabaseId(this.srvDatabase.getIdDatabase());
    //assigning fully initialized object:
    this.factoriesMap
      .put(pBeanClass, factory);
    return factory;
  }
546008
public static void premain(final String agentArgs, final Instrumentation instrumentation) {
    System.out.println("Initialiting Appmon4jAgent");

    Appmon4JAgentConfiguration configuration = null;
    try {
      configuration = Appmon4JAgentConfiguration.load(agentArgs);
    } catch (Exception e) {
      System.err.println("failed to load appmon4j agent configuration from " + agentArgs + ".");
      e.printStackTrace();
    }

    if (configuration != null) {
      new Appmon4JAgent(configuration, instrumentation);
    } else {
      System.err.println("appmon4j Agent: Unable to start up. No valid configuration found. Will do nothing. ");
    }
  }
980808
@Override
	public void afterPropertiesSet() throws Exception {
		if (this.requestFactory == null) {
			SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
			requestFactory.setConnectTimeout(1000);
			requestFactory.setReadTimeout(3000);
			this.requestFactory = requestFactory;
		}

		template = new RestTemplate(this.requestFactory);
		template.setMessageConverters(Arrays.asList(requestConverter, responseConverter));

		if (locationUpdaterEnabled) {
			Runnable worker = new Runnable() {
				@Override
				public void run() {
					updateMembers();
				}
			};
			locationUpdater.scheduleAtFixedRate(worker, 5000, 5000, TimeUnit.MILLISECONDS);
		}
	}
576873
@Override
  public final HandlerEntityRequest<RS>
    lazyGetHandlerEntityRequest() throws Exception {
    String beanName = this.factoryAppBeans.getHandlerEntityRequestName();
    @SuppressWarnings("unchecked")
    HandlerEntityRequest<RS> hndlEntityReq = (HandlerEntityRequest<RS>)
      this.factoryAppBeans.getBeansMap().get(beanName);
    if (hndlEntityReq == null) {
      hndlEntityReq = new HandlerEntityRequest<RS>();
      hndlEntityReq.setWriteTi(this.factoryAppBeans.getWriteTi());
      hndlEntityReq.setReadTi(this.factoryAppBeans.getReadTi());
      hndlEntityReq.setWriteReTi(this.factoryAppBeans.getWriteReTi());
      hndlEntityReq.setWrReSpTr(this.factoryAppBeans.getWrReSpTr());
      hndlEntityReq
        .setSrvDatabase(this.factoryAppBeans.lazyGetSrvDatabase());
      hndlEntityReq.setFillEntityFromReq(
        this.factoryAppBeans.lazyGetFillEntityFromReq());
      hndlEntityReq.setLogger(
        this.factoryAppBeans.lazyGetLogger());
      hndlEntityReq.setSecureLogger(
        this.factoryAppBeans.lazyGetSecureLogger());
      hndlEntityReq
        .setEntitiesFactoriesFatory(lazyGetFctBcFctSimpleEntities());
      hndlEntityReq
        .setProcessorsFactory(lazyGetFctBnProcessors());
      hndlEntityReq
        .setProcessorsNamesHolder(new HldProcessorNames());
      hndlEntityReq
        .setEntitiesProcessorsFactory(lazyGetFctBnEntitiesProcessors());
      hndlEntityReq
        .setEntitiesProcessorsNamesHolder(new HldEntitiesProcessorNames());
      @SuppressWarnings("unchecked")
      HashMap<String, Class<?>> mcl = (HashMap<String, Class<?>>)
        this.factoryAppBeans.getEntitiesMap().clone();
      hndlEntityReq.setEntitiesMap(mcl);
      lazyGetFctBnProcessors().getSrvEntitiesPage()
        .setEntitiesMap(mcl);
      this.factoryAppBeans.getBeansMap().put(beanName, hndlEntityReq);
      this.factoryAppBeans.lazyGetLogger().info(null, AFactoryAppBeans.class,
        beanName + " has been created.");
    }
    return hndlEntityReq;
  }
424974
@Override
  public final FctBnProcessors<RS>
    lazyGetFctBnProcessors() throws Exception {
    String beanName = getFctBnProcessorsName();
    @SuppressWarnings("unchecked")
    FctBnProcessors<RS> fctBnProcessors = (FctBnProcessors<RS>)
      this.factoryAppBeans.getBeansMap().get(beanName);
    if (fctBnProcessors == null) {
      fctBnProcessors = new FctBnProcessors<RS>();
      SrvEntitiesPage<RS> srvEp = new SrvEntitiesPage<RS>();
      srvEp.setHlpEntitiesPage(this.factoryAppBeans.lazyGetHlpEntitiesPage());
      srvEp.setLogger(this.factoryAppBeans.lazyGetLogger());
      fctBnProcessors.setSrvEntitiesPage(srvEp);
      fctBnProcessors.setSrvOrm(this.factoryAppBeans.lazyGetSrvOrm());
      fctBnProcessors.setI18nRequestHandler(this.factoryAppBeans
        .lazyGetHndlI18nRequest());
      this.factoryAppBeans.getBeansMap().put(beanName, fctBnProcessors);
    }
    return fctBnProcessors;
  }
136671
@Override
  public final void process(final Map<String, Object> pReqVars,
    final IRequestData pRequestData) throws Exception {
    retrieveStartData(pReqVars);
    List<PriceCategory> defPcs = this.srvOrm.retrieveListWithConditions(pReqVars, PriceCategory.class, "where DFOL=1");
    if (defPcs.size() != 1) {
      throw new ExceptionWithCode(ExceptionWithCode.CONFIGURATION_MISTAKE, "where_is_no_only_default_online_price_category");
    }
    SettingsAdd settingsAdd = (SettingsAdd) pReqVars.get("setAdd");
    TradingSettings tradSet = (TradingSettings) pReqVars.get("tradSet");
    GoodsInListLuv goodsInListLuv = (GoodsInListLuv) pReqVars.get("goodsInListLuv");
    pReqVars.remove("goodsInListLuv");
    String refreshAll = pRequestData.getParameter("refreshAll");
    List<GoodsSpecifics> goodsSpecificsLst;
    if (refreshAll != null) {
      goodsSpecificsLst = retrieveItemSpecificsLst(pReqVars, null, GoodsSpecifics.class);
    } else {
      goodsSpecificsLst = retrieveItemSpecificsLst(pReqVars, goodsInListLuv.getGoodsSpecificLuv(), GoodsSpecifics.class);
    }
    updateForItemSpecificsList(pReqVars, goodsSpecificsLst, settingsAdd, goodsInListLuv, tradSet, I18nInvItem.class, EShopItemType.GOODS);
    pRequestData.setAttribute("totalUpdatedGdSp", goodsSpecificsLst.size());
    goodsSpecificsLst = null;
    List<PriceGoods> goodsPriceLst;
    if (refreshAll != null) {
      goodsPriceLst = retrieveItemPriceLst(pReqVars, null, PriceGoods.class, defPcs.get(0).getItsId());
    } else {
      goodsPriceLst = retrieveItemPriceLst(pReqVars, goodsInListLuv.getGoodsPriceLuv(), PriceGoods.class, defPcs.get(0).getItsId());
    }
    updateForItemPriceList(pReqVars, goodsPriceLst, settingsAdd, goodsInListLuv, EShopItemType.GOODS);
    pRequestData.setAttribute("totalUpdatedGdPr", goodsPriceLst.size());
    goodsPriceLst = null;
    List<GoodsPlace> goodsPlaceLst;
    if (refreshAll != null) {
      goodsPlaceLst = retrieveItemPlaceLst(pReqVars, null, GoodsPlace.class);
    } else {
      goodsPlaceLst = retrieveItemPlaceLst(pReqVars, goodsInListLuv.getGoodsAvailableLuv(), GoodsPlace.class);
    }
    updateForItemPlaceList(pReqVars, goodsPlaceLst, settingsAdd, goodsInListLuv, EShopItemType.GOODS);
    pRequestData.setAttribute("totalUpdatedGdAv", goodsPlaceLst.size());
    goodsPlaceLst = null;
    List<ServiceSpecifics> serviceSpecificsLst;
    if (refreshAll != null) {
      serviceSpecificsLst = retrieveItemSpecificsLst(pReqVars, null, ServiceSpecifics.class);
    } else {
      serviceSpecificsLst = retrieveItemSpecificsLst(pReqVars, goodsInListLuv.getServiceSpecificLuv(), ServiceSpecifics.class);
    }
    updateForItemSpecificsList(pReqVars, serviceSpecificsLst, settingsAdd, goodsInListLuv, tradSet, I18nServiceToSale.class, EShopItemType.SERVICE);
    pRequestData.setAttribute("totalUpdatedServSp", serviceSpecificsLst.size());
    serviceSpecificsLst = null;
    List<ServicePrice> servicePriceLst;
    if (refreshAll != null) {
      servicePriceLst = retrieveItemPriceLst(pReqVars, null, ServicePrice.class, defPcs.get(0).getItsId());
    } else {
      servicePriceLst = retrieveItemPriceLst(pReqVars, goodsInListLuv.getServicePriceLuv(), ServicePrice.class, defPcs.get(0).getItsId());
    }
    updateForItemPriceList(pReqVars, servicePriceLst, settingsAdd, goodsInListLuv, EShopItemType.SERVICE);
    pRequestData.setAttribute("totalUpdatedServPr", servicePriceLst.size());
    servicePriceLst = null;
    List<ServicePlace> servicePlaceLst;
    if (refreshAll != null) {
      servicePlaceLst = retrieveItemPlaceLst(pReqVars, null, ServicePlace.class);
    } else {
      servicePlaceLst = retrieveItemPlaceLst(pReqVars, goodsInListLuv.getServicePlaceLuv(), ServicePlace.class);
    }
    updateForItemPlaceList(pReqVars, servicePlaceLst, settingsAdd, goodsInListLuv, EShopItemType.SERVICE);
    pRequestData.setAttribute("totalUpdatedServAv", servicePlaceLst.size());
    servicePlaceLst = null;
    List<SeGoodsSpecifics> seGoodSpecificsLst;
    if (refreshAll != null) {
      seGoodSpecificsLst = retrieveItemSpecificsLst(pReqVars, null, SeGoodsSpecifics.class);
    } else {
      seGoodSpecificsLst = retrieveItemSpecificsLst(pReqVars, goodsInListLuv.getSeGoodSpecificLuv(), SeGoodsSpecifics.class);
    }
    updateForItemSpecificsList(pReqVars, seGoodSpecificsLst, settingsAdd, goodsInListLuv, tradSet, I18nSeGoods.class, EShopItemType.SEGOODS);
    pRequestData.setAttribute("totalUpdatedSeGoodSp", seGoodSpecificsLst.size());
    seGoodSpecificsLst = null;
    List<SeGoodsPrice> seGoodPriceLst;
    if (refreshAll != null) {
      seGoodPriceLst = retrieveItemPriceLst(pReqVars, null, SeGoodsPrice.class, defPcs.get(0).getItsId());
    } else {
      seGoodPriceLst = retrieveItemPriceLst(pReqVars, goodsInListLuv.getSeGoodPriceLuv(), SeGoodsPrice.class, defPcs.get(0).getItsId());
    }
    updateForItemPriceList(pReqVars, seGoodPriceLst, settingsAdd, goodsInListLuv, EShopItemType.SEGOODS);
    pRequestData.setAttribute("totalUpdatedSeGoodPr", seGoodPriceLst.size());
    seGoodPriceLst = null;
    List<SeGoodsPlace> seGoodPlaceLst;
    if (refreshAll != null) {
      seGoodPlaceLst = retrieveItemPlaceLst(pReqVars, null, SeGoodsPlace.class);
    } else {
      seGoodPlaceLst = retrieveItemPlaceLst(pReqVars, goodsInListLuv.getSeGoodPlaceLuv(), SeGoodsPlace.class);
    }
    updateForItemPlaceList(pReqVars, seGoodPlaceLst, settingsAdd, goodsInListLuv, EShopItemType.SEGOODS);
    pRequestData.setAttribute("totalUpdatedSeGoodAv", seGoodPlaceLst.size());
    seGoodPlaceLst = null;
    List<SeServiceSpecifics> seServiceSpecificsLst;
    if (refreshAll != null) {
      seServiceSpecificsLst = retrieveItemSpecificsLst(pReqVars, null, SeServiceSpecifics.class);
    } else {
      seServiceSpecificsLst = retrieveItemSpecificsLst(pReqVars, goodsInListLuv.getSeServiceSpecificLuv(), SeServiceSpecifics.class);
    }
    updateForItemSpecificsList(pReqVars, seServiceSpecificsLst, settingsAdd, goodsInListLuv, tradSet, I18nSeService.class, EShopItemType.SESERVICE);
    pRequestData.setAttribute("totalUpdatedSeServiceSp", seServiceSpecificsLst.size());
    seServiceSpecificsLst = null;
    List<SeServicePrice> seServicePriceLst;
    if (refreshAll != null) {
      seServicePriceLst = retrieveItemPriceLst(pReqVars, null, SeServicePrice.class, defPcs.get(0).getItsId());
    } else {
      seServicePriceLst = retrieveItemPriceLst(pReqVars, goodsInListLuv.getSeServicePriceLuv(), SeServicePrice.class, defPcs.get(0).getItsId());
    }
    updateForItemPriceList(pReqVars, seServicePriceLst, settingsAdd, goodsInListLuv, EShopItemType.SESERVICE);
    pRequestData.setAttribute("totalUpdatedSeServicePr", seServicePriceLst.size());
    seServicePriceLst = null;
    List<SeServicePlace> seServicePlaceLst;
    if (refreshAll != null) {
      seServicePlaceLst = retrieveItemPlaceLst(pReqVars, null, SeServicePlace.class);
    } else {
      seServicePlaceLst = retrieveItemPlaceLst(pReqVars, goodsInListLuv.getSeServicePlaceLuv(), SeServicePlace.class);
    }
    updateForItemPlaceList(pReqVars, seServicePlaceLst, settingsAdd, goodsInListLuv, EShopItemType.SESERVICE);
    pRequestData.setAttribute("totalUpdatedSeServiceAv", seServicePlaceLst.size());
    seServicePlaceLst = null;
    pReqVars.remove("langPreferences");
  }
1006337
@Override
  public final synchronized void makeWith(final Map<String, Object> pReqVars,
    final FactoryAndServlet pFactoryAndServlet) throws Exception {
    @SuppressWarnings("unchecked")
    AFactoryAppBeans<RS> factoryAppBeans =
      (AFactoryAppBeans<RS>) pFactoryAndServlet.getFactoryAppBeans();
    File webAppPath = new File(pFactoryAndServlet.getHttpServlet().
      getServletContext().getRealPath(""));
    factoryAppBeans.setWebAppPath(webAppPath.getPath());
    String isShowDebugMessagesStr = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("isShowDebugMessages");
    factoryAppBeans.setIsShowDebugMessages(Boolean
      .valueOf(isShowDebugMessagesStr));
    String detailLevelStr = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("detailLevel");
    factoryAppBeans.setDetailLevel(Integer.parseInt(detailLevelStr));
    String newDatabaseIdStr = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("newDatabaseId");
    factoryAppBeans.setNewDatabaseId(Integer.parseInt(newDatabaseIdStr));
    String ormSettingsDir = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("ormSettingsDir");
    factoryAppBeans.setOrmSettingsDir(ormSettingsDir);
    String ormSettingsBaseFile = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("ormSettingsBaseFile");
    factoryAppBeans.setOrmSettingsBaseFile(ormSettingsBaseFile);
    String uvdSettingsDir = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("uvdSettingsDir");
    factoryAppBeans.setUvdSettingsDir(uvdSettingsDir);
    String uvdSettingsBaseFile = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("uvdSettingsBaseFile");
    factoryAppBeans.setUvdSettingsBaseFile(uvdSettingsBaseFile);
    String writeTi = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("writeTi");
    factoryAppBeans.setWriteTi(Integer.parseInt(writeTi));
    String readTi = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("readTi");
    factoryAppBeans.setReadTi(Integer.parseInt(readTi));
    String writeReTi = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("writeReTi");
    factoryAppBeans.setWriteReTi(Integer.parseInt(writeReTi));
    String wrReSpTr = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("wrReSpTr");
    factoryAppBeans.setWrReSpTr(Boolean.valueOf(wrReSpTr));
    String fastLoc = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("fastLoc");
    factoryAppBeans.setFastLoc(Boolean.parseBoolean(fastLoc));
    String jdbcUrl = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("databaseName");
    if (jdbcUrl != null && jdbcUrl.contains(ASrvOrm.WORD_CURRENT_DIR)) {
      jdbcUrl = jdbcUrl.replace(ASrvOrm.WORD_CURRENT_DIR,
        factoryAppBeans.getWebAppPath() + File.separator);
    } else if (jdbcUrl != null
      && jdbcUrl.contains(ASrvOrm.WORD_CURRENT_PARENT_DIR)) {
      File fcd = new File(factoryAppBeans.getWebAppPath());
      jdbcUrl = jdbcUrl.replace(ASrvOrm.WORD_CURRENT_PARENT_DIR,
        fcd.getParent() + File.separator);
    }
    String langCountriesStr = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("langCountries");
    List<String> lngCntLst = new ArrayList<String>();
    for (String str : langCountriesStr.split(",")) {
      lngCntLst.add(str);
    }
    String[] lngCntArr = new String[lngCntLst.size()];
    factoryAppBeans.lazyGetSrvI18n().add(lngCntLst.toArray(lngCntArr));
    LstnDbChanged<RS> lstnDbChanged = new LstnDbChanged<RS>();
    lstnDbChanged.setFactoryAndServlet(pFactoryAndServlet);
    factoryAppBeans.getListenersDbChanged().add(lstnDbChanged);
    factoryAppBeans.setDatabaseName(jdbcUrl);
    String databaseUser = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("databaseUser");
    factoryAppBeans.setDatabaseUser(databaseUser);
    String databasePassword = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("databasePassword");
    factoryAppBeans.setDatabasePassword(databasePassword);
    pFactoryAndServlet.getHttpServlet().getServletContext()
      .setAttribute("srvI18n", factoryAppBeans.lazyGet("ISrvI18n"));
    pFactoryAndServlet.getHttpServlet().getServletContext()
      .setAttribute("sessionTracker",
        factoryAppBeans.lazyGet("ISessionTracker"));
    //to create/initialize database if need:
    factoryAppBeans.lazyGet("ISrvOrm");
  }
1025722
@Override
  public final List<Node<String>> getSampleDataRow(
    final Map<String, Object> pReqVars) throws Exception {
    String lang = (String) pReqVars.get("lang");
    List<Node<String>> result = new ArrayList<Node<String>>();
    Integer idx = 1;
    Node<String> nodeService = new Node<String>();
    result.add(nodeService);
    nodeService.setItsName(getSrvI18n().getMsg("service", lang));
    nodeService.setItsNodes(new ArrayList<Node<String>>());
    Node<String> nodeServiceName = new Node<String>();
    nodeService.getItsNodes().add(nodeServiceName);
    nodeServiceName.setItsName(getSrvI18n().getMsg("itsName", lang));
    nodeServiceName.setItsValue(idx.toString() + ";itsName");
    Node<String> nodeServiceId = new Node<String>();
    nodeService.getItsNodes().add(nodeServiceId);
    nodeServiceId.setItsName(getSrvI18n().getMsg("itsId", lang));
    nodeServiceId.setItsValue(idx.toString() + ";itsId");
    Node<String> nodeServiceItsCategory = new Node<String>();
    nodeService.getItsNodes().add(nodeServiceItsCategory);
    nodeServiceItsCategory.setItsName(getSrvI18n().getMsg("itsCategory", lang));
    nodeServiceItsCategory.setItsNodes(new ArrayList<Node<String>>());
    Node<String> nodeServiceItsCategoryName = new Node<String>();
    nodeServiceItsCategory.getItsNodes().add(nodeServiceItsCategoryName);
    nodeServiceItsCategoryName.setItsName(getSrvI18n().getMsg("itsName", lang));
    nodeServiceItsCategoryName
      .setItsValue(idx.toString() + ";itsCategory,itsName");
    Node<String> nodeServiceItsCategoryId = new Node<String>();
    nodeServiceItsCategory.getItsNodes().add(nodeServiceItsCategoryId);
    nodeServiceItsCategoryId.setItsName(getSrvI18n().getMsg("itsId", lang));
    nodeServiceItsCategoryId.setItsValue(idx.toString() + ";itsCategory,itsId");
    idx++;
    Node<String> nodePrice = new Node<String>();
    result.add(nodePrice);
    nodePrice.setItsName(getSrvI18n().getMsg("itsPrice", lang));
    nodePrice.setItsValue(idx.toString());
    idx++;
    Node<String> nodeCost = new Node<String>();
    result.add(nodeCost);
    nodeCost.setItsName(getSrvI18n().getMsg("itsCost", lang));
    nodeCost.setItsValue(idx.toString());
    idx++;
    Node<String> nodeQuantity = new Node<String>();
    result.add(nodeQuantity);
    nodeQuantity.setItsName(getSrvI18n().getMsg("itsQuantity", lang));
    nodeQuantity.setItsValue(idx.toString());
    idx++;
    Node<String> nodeIsAvailable = new Node<String>();
    result.add(nodeIsAvailable);
    nodeIsAvailable.setItsName(getSrvI18n().getMsg("isAvailable", lang));
    nodeIsAvailable.setItsValue(idx.toString());
    Set<String> ndFlIdNm = new HashSet<String>();
    ndFlIdNm.add("itsId");
    ndFlIdNm.add("itsName");
    pReqVars.put("InvItemTaxCategoryneededFields", ndFlIdNm);
    pReqVars.put("TaxneededFields", ndFlIdNm);
    List<InvItemTaxCategoryLine> allTaxCatsLns = getSrvOrm()
      .retrieveList(pReqVars, InvItemTaxCategoryLine.class);
    pReqVars.remove("InvItemTaxCategoryneededFields");
    pReqVars.remove("TaxneededFields");
    List<Tax> usedTaxes = new ArrayList<Tax>();
    List<InvItemTaxCategory> usedTaxCats = new ArrayList<InvItemTaxCategory>();
    for (InvItemTaxCategoryLine tcl : allTaxCatsLns) {
      boolean txListed = false;
      for (Tax tx : usedTaxes) {
        if (tx.getItsId().equals(tcl.getTax().getItsId())) {
          txListed = true;
          break;
        }
      }
      if (!txListed) {
        usedTaxes.add(tcl.getTax());
      }
      int tci = -1;
      for (InvItemTaxCategory tc : usedTaxCats) {
        if (tc.getItsId().equals(tcl.getItsOwner().getItsId())) {
          tci = usedTaxCats.indexOf(tc);
          break;
        }
      }
      if (tci == -1) {
        usedTaxCats.add(tcl.getItsOwner());
        tcl.getItsOwner().setTaxes(new ArrayList<InvItemTaxCategoryLine>());
        tcl.getItsOwner().getTaxes().add(tcl);
      } else {
        usedTaxCats.get(tci).getTaxes().add(tcl);
      }
    }
    boolean isOnlyTax = true;
    for (InvItemTaxCategory txc : usedTaxCats) {
      if (txc.getTaxes().size() > 1) {
        isOnlyTax = false;
        break;
      }
    }
    if (isOnlyTax) {
      idx++;
      addTaxWr(result, idx.toString(),
        getSrvI18n().getMsg("OnlyTax", lang), lang);
    } else {
      idx++;
      addTaxCatWr(result, idx.toString(),
        getSrvI18n().getMsg("taxCategory", lang), lang);
      Collections.sort(usedTaxes, new CmprHasIdLong<Tax>());
      for (Tax tx : usedTaxes) {
        idx++;
        addTaxWr(result, idx.toString(), tx.getItsName(), lang);
      }
      Collections.sort(usedTaxCats, new CmprHasIdLong<InvItemTaxCategory>());
      for (InvItemTaxCategory txc : usedTaxCats) {
        idx++;
        addTaxCatWr(result, idx.toString(), txc.getItsName(), lang);
      }
    }
    return result;
  }
283762
@Override
    public boolean beforeSolve(ReconfigurationProblem p) throws SchedulerException {
        for (VM vm : source.getMapping().getAllVMs()) {
            int vmId = p.getVM(vm);
            int v = getVMAllocation(vmId);
            if (v < 0) {
                int prevUsage = rc.getConsumption(vm);
                minVMAllocation(vmId, prevUsage);
            }

        }

        ChocoView v = rp.getView(Packing.VIEW_ID);
        if (v == null) {
            throw SchedulerModelingException.missingView(rp.getSourceModel(), Packing.VIEW_ID);
        }

        IntVar[] host = new IntVar[p.getFutureRunningVMs().size()];
        int[] demand = new int[host.length];
        int i = 0;
        for (VM vm : p.getFutureRunningVMs()) {
            host[i] = rp.getVMAction(vm).getDSlice().getHoster();
            demand[i] = getVMAllocation(p.getVM(vm));
            i++;
        }
        ((Packing) v).addDim(rc.getResourceIdentifier(),
                virtRcUsage,
                demand,
                host);

        return linkVirtualToPhysicalUsage();
    }
1050921
@Override
  public final void makeOtherEntries(final Map<String, Object> pAddParam,
    final Wage pEntity, final IRequestData pRequestData,
      final boolean pIsNew) throws Exception {
    String actionAdd = pRequestData.getParameter("actionAdd");
    if ("fill".equals(actionAdd)) {
      //User can change method as he want
      String srvFillWgLnNm = getSrvAccSettings().lazyGetAccSettings(pAddParam)
        .getWageTaxesMethod().getServiceName();
      ISrvFillWageLines srvFillWageLines = (ISrvFillWageLines) this
        .factoryAppBeans.lazyGet(srvFillWgLnNm);
      srvFillWageLines.fillWageLines(pAddParam, pEntity);
    } else if ("makeAccEntries".equals(actionAdd)) {
      if (pEntity.getReversedId() == null) {
        WageLine wl = new WageLine();
        wl.setItsOwner(pEntity);
        List<WageLine> wageLines = getSrvOrm().
          retrieveListForField(pAddParam, wl, "itsOwner");
        for (WageLine wageLine : wageLines) {
          String whereStr = " where ITSOWNER=" + pEntity.getEmployee()
            .getItsId() + " and WAGETYPE=" + wageLine.getWageType().getItsId();
          EmployeeYearWage employeeYearWage = getSrvOrm()
            .retrieveEntityWithConditions(pAddParam,
              EmployeeYearWage.class, whereStr);
          if (employeeYearWage == null) {
            employeeYearWage = new EmployeeYearWage();
            employeeYearWage.setItsOwner(pEntity.getEmployee());
            employeeYearWage.setIsNew(true);
            employeeYearWage.setIdDatabaseBirth(getSrvOrm().getIdDatabase());
            employeeYearWage.setWageType(wageLine.getWageType());
          }
          employeeYearWage.setTotalWageYear(employeeYearWage.getTotalWageYear()
            .add(wageLine.getGrossWage())
              .subtract(wageLine.getTaxesEmployee()));
          if (employeeYearWage.getIsNew()) {
            getSrvOrm().insertEntity(pAddParam, employeeYearWage);
            employeeYearWage.setIsNew(false);
          } else {
            getSrvOrm().updateEntity(pAddParam, employeeYearWage);
          }
        }
      } else {
        WageLine wl = new WageLine();
        Wage reversed = getSrvOrm().
          retrieveEntityById(pAddParam, Wage.class, pEntity.getReversedId());
        wl.setItsOwner(reversed);
        List<WageLine> wageLines = getSrvOrm().
          retrieveListForField(pAddParam, wl, "itsOwner");
        for (WageLine wageLine : wageLines) {
          String whereStr = " where ITSOWNER=" + pEntity.getEmployee()
            .getItsId() + " and WAGETYPE=" + wageLine.getWageType().getItsId();
          EmployeeYearWage employeeYearWage = getSrvOrm()
            .retrieveEntityWithConditions(pAddParam,
              EmployeeYearWage.class, whereStr);
          employeeYearWage.setTotalWageYear(employeeYearWage.getTotalWageYear()
            .subtract(wageLine.getGrossWage())
              .add(wageLine.getTaxesEmployee()));
          getSrvOrm().updateEntity(pAddParam, employeeYearWage);
        }
      }
    }
  }
1281694
protected void initializeTargetMappings() throws Exception {
        // NOTE: namespace preinvoke/postinvoke not necessary as the only
        // external
        // code being run is the servlet's init() and that is handled in the
        // ServletWrapper

        // check if an extensionFactory is present for *.jsp:
        // We do this by constructing an arbitrary mapping which
        // will only match the *.xxx extension pattern
        //
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE))
            logger.entering(CLASS_NAME, "initializeTargetMappings");

        initializeStaticFileHandler();

        initializeInvokerProcessor();

        if (config.isDirectoryBrowsingEnabled()) {
            try {
                IServletWrapper dirServlet = getServletWrapper("DirectoryBrowsingServlet");
                requestMapper.addMapping(DIR_BROWSING_MAPPING, dirServlet);
            } catch (WebContainerException wce) {
                // pk435011
                logger.logp(Level.WARNING, CLASS_NAME, "initializeTargetMappings", "mapping.for.directorybrowsingservlet.already.exists");

            } catch (Exception exc) {
                // pk435011
                logger.logp(Level.WARNING, CLASS_NAME, "initializeTargetMappings", "mapping.for.directorybrowsingservlet.already.exists");
            }
        }

    }
350252
private void exposeVariables() throws JspTagException {

        if (deferredExpression == null) {
            /*
             * We need to support null items returned from next(); we
             * do this simply by passing such non-items through to the
             * scoped variable as effectively 'null' (that is, by calling
             * removeAttribute()).
             *
             * Also, just to be defensive, we handle the case of a null
             * 'status' object as well.
             *
             * We call getCurrent() and getLoopStatus() (instead of just using
             * 'item' and 'status') to bridge to subclasses correctly.
             * A subclass can override getCurrent() or getLoopStatus() but still
             * depend on our doStartTag() and doAfterBody(), which call this
             * method (exposeVariables()), to expose 'item' and 'status'
             * correctly.
             */
            if (itemId != null) {
                if (getCurrent() == null) {
                    pageContext.removeAttribute(itemId, PageContext.PAGE_SCOPE);
                } else {
                    pageContext.setAttribute(itemId, getCurrent());
                }
            }
        } else { //this is using a DeferredExpression
            ELContext myELContext = pageContext.getELContext();
            VariableMapper vm = myELContext.getVariableMapper();
            vm.setVariable(itemId, (ValueExpression) getCurrent());
        }
        if (statusId != null) {
            if (getLoopStatus() == null) {
                pageContext.removeAttribute(statusId, PageContext.PAGE_SCOPE);
            } else {
                pageContext.setAttribute(statusId, getLoopStatus());
            }
        }

    }
309295
@Override
  public final synchronized void makeWith(final Map<String, Object> pReqVars,
    final FactoryAndServlet pFactoryAndServlet) throws Exception {
    @SuppressWarnings("unchecked")
    AFactoryAppBeans<RS> factoryAppBeans =
      (AFactoryAppBeans<RS>) pFactoryAndServlet.getFactoryAppBeans();
    File webAppPath = new File(pFactoryAndServlet.getHttpServlet()
      .getServletContext().getRealPath(""));
    factoryAppBeans.setWebAppPath(webAppPath.getPath());
    String isShowDebugMessagesStr = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("isShowDebugMessages");
    factoryAppBeans.setIsShowDebugMessages(Boolean
      .valueOf(isShowDebugMessagesStr));
    String newDatabaseIdStr = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("newDatabaseId");
    factoryAppBeans.setNewDatabaseId(Integer.parseInt(newDatabaseIdStr));
    String ormSettingsDir = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("ormSettingsDir");
    factoryAppBeans.setOrmSettingsDir(ormSettingsDir);
    String ormSettingsBaseFile = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("ormSettingsBaseFile");
    factoryAppBeans.setOrmSettingsBaseFile(ormSettingsBaseFile);
    String uvdSettingsDir = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("uvdSettingsDir");
    factoryAppBeans.setUvdSettingsDir(uvdSettingsDir);
    String uvdSettingsBaseFile = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("uvdSettingsBaseFile");
    factoryAppBeans.setUvdSettingsBaseFile(uvdSettingsBaseFile);
    String writeTi = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("writeTi");
    factoryAppBeans.setWriteTi(Integer.parseInt(writeTi));
    String readTi = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("readTi");
    factoryAppBeans.setReadTi(Integer.parseInt(readTi));
    String writeReTi = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("writeReTi");
    factoryAppBeans.setWriteReTi(Integer.parseInt(writeReTi));
    String wrReSpTr = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("wrReSpTr");
    factoryAppBeans.setWrReSpTr(Boolean.valueOf(wrReSpTr));
    String fastLoc = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("fastLoc");
    factoryAppBeans.setFastLoc(Boolean.parseBoolean(fastLoc));
    String jdbcUrl = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("databaseName");
    if (jdbcUrl != null && jdbcUrl.contains(ASrvOrm.WORD_CURRENT_DIR)) {
      jdbcUrl = jdbcUrl.replace(ASrvOrm.WORD_CURRENT_DIR,
        factoryAppBeans.getWebAppPath() + File.separator);
    } else if (jdbcUrl != null
      && jdbcUrl.contains(ASrvOrm.WORD_CURRENT_PARENT_DIR)) {
      File fcd = new File(factoryAppBeans.getWebAppPath());
      jdbcUrl = jdbcUrl.replace(ASrvOrm.WORD_CURRENT_PARENT_DIR,
        fcd.getParent() + File.separator);
    }
    String langCountriesStr = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("langCountries");
    List<String> lngCntLst = new ArrayList<String>();
    for (String str : langCountriesStr.split(",")) {
      lngCntLst.add(str);
    }
    String[] lngCntArr = new String[lngCntLst.size()];
    factoryAppBeans.lazyGetSrvI18n().add(lngCntLst.toArray(lngCntArr));
    LstnDbChanged<RS> lstnDbChanged = new LstnDbChanged<RS>();
    lstnDbChanged.setFactoryAndServlet(pFactoryAndServlet);
    factoryAppBeans.getListenersDbChanged().add(lstnDbChanged);
    factoryAppBeans.setDatabaseName(jdbcUrl);
    String databaseUser = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("databaseUser");
    factoryAppBeans.setDatabaseUser(databaseUser);
    String databasePassword = pFactoryAndServlet.getHttpServlet()
      .getInitParameter("databasePassword");
    factoryAppBeans.setDatabasePassword(databasePassword);
    pFactoryAndServlet.getHttpServlet().getServletContext()
      .setAttribute("srvI18n", factoryAppBeans.lazyGet("ISrvI18n"));
    pFactoryAndServlet.getHttpServlet().getServletContext()
      .setAttribute("sessionTracker",
        factoryAppBeans.lazyGet("ISessionTracker"));
    HndlTradeVarsRequest<RS> hndlTradeVarsRequest =
      new HndlTradeVarsRequest<RS>();
    hndlTradeVarsRequest.setLogger(factoryAppBeans.lazyGetLogger());
    hndlTradeVarsRequest.setSrvDatabase(factoryAppBeans.lazyGetSrvDatabase());
    hndlTradeVarsRequest.setSrvOrm(factoryAppBeans.lazyGetSrvOrm());
    hndlTradeVarsRequest.setUtlTradeJsp((UtlTradeJsp)
      factoryAppBeans.lazyGet("utlTradeJsp"));
    hndlTradeVarsRequest.setSrvSettingsAdd((ISrvSettingsAdd)
      factoryAppBeans.lazyGet("ISrvSettingsAdd"));
    hndlTradeVarsRequest.setSrvTradingSettings((ISrvTradingSettings)
      factoryAppBeans.lazyGet("ISrvTradingSettings"));
    HndlAccVarsRequest<RS> hndlAccVarsRequest = new HndlAccVarsRequest<RS>();
    hndlAccVarsRequest.setAdditionalI18nReqHndl(hndlTradeVarsRequest);
    hndlAccVarsRequest.setLogger(factoryAppBeans.lazyGetLogger());
    hndlAccVarsRequest.setSrvDatabase(factoryAppBeans.lazyGetSrvDatabase());
    hndlAccVarsRequest.setSrvOrm(factoryAppBeans.lazyGetSrvOrm());
    hndlAccVarsRequest.setSrvAccSettings((ISrvAccSettings) factoryAppBeans
      .lazyGet("ISrvAccSettings"));
    factoryAppBeans.lazyGetHndlI18nRequest()
      .setAdditionalI18nReqHndl(hndlAccVarsRequest);
    @SuppressWarnings("unchecked")
    ISrvDatabase<RS> srvDb = (ISrvDatabase<RS>)
      factoryAppBeans.lazyGet("ISrvDatabase");
    SrvAddTheFirstUser<RS> srvAddFiU = new SrvAddTheFirstUser<RS>();
    srvAddFiU.setSrvDatabase(srvDb);
    pFactoryAndServlet.getHttpServlet().getServletContext()
      .setAttribute("srvAddTheFirstUser", srvAddFiU);
    DataBaseLoginService srvDbl = (DataBaseLoginService)
      pFactoryAndServlet.getHttpServlet().getServletContext()
        .getAttribute("JDBCRealm");
    if (srvDbl != null) {
      SrvGetUserCredentials<RS> srvCr = new SrvGetUserCredentials<RS>();
      srvCr.setSrvDatabase(srvDb);
      srvDbl.setSrvGetUserCredentials(srvCr);
      LstnUserPswdChanged lstnUserPswdChanged = new LstnUserPswdChanged();
      lstnUserPswdChanged.setDbLoginService(srvDbl);
      pFactoryAndServlet.getHttpServlet().getServletContext()
        .setAttribute("ILstnUserPswdChanged", lstnUserPswdChanged);
    }
    //crypto init:
    CryptoHelper ch = (CryptoHelper) factoryAppBeans.lazyGet("ICryptoHelper");
    KeyStore ks = (KeyStore) pFactoryAndServlet.getHttpServlet()
      .getServletContext().getAttribute("ajettyKeystore");
    ch.setKeyStore(ks);
    String passw = (String) pFactoryAndServlet.getHttpServlet()
      .getServletContext().getAttribute("ksPassword");
    ch.setKsPassword(passw.toCharArray());
    Integer ajettyIn = (Integer) pFactoryAndServlet.getHttpServlet()
      .getServletContext().getAttribute("ajettyIn");
    ch.setAjettyIn(ajettyIn);
  }