Stores an attribute in request.

@param requestAdapter the request adapter
@param processResult the process result
184352
public static void fetchAttributes(RequestAdapter requestAdapter, ProcessResult processResult) {
        if (processResult != null) {
            for (ContentResult contentResult : processResult) {
                for (ActionResult actionResult : contentResult) {
                    Object actionResultValue = actionResult.getResultValue();
                    if (actionResultValue instanceof ProcessResult) {
                        fetchAttributes(requestAdapter, (ProcessResult)actionResultValue);
                    } else {
                        String actionId = actionResult.getActionId();
                        if (actionId != null) {
                            requestAdapter.setAttribute(actionId, actionResultValue);
                        }
                    }
                }
            }
        }
    }
260459
@Override public void onActivityForResult(int requestCode) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            if (requestCode == OVERLAY_PERMISSION_REQ_CODE) {
                if (isSystemAlertGranted()) {
                    permissionCallback.onPermissionGranted(new String[]{Manifest.permission.SYSTEM_ALERT_WINDOW});
                } else {
                    permissionCallback.onPermissionDeclined(new String[]{Manifest.permission.SYSTEM_ALERT_WINDOW});
                }
            }
        } else {
            permissionCallback.onPermissionPreGranted(Manifest.permission.SYSTEM_ALERT_WINDOW);
        }
    }
184592
@Override
  public final void process(final Map<String, Object> pAddParam,
    final IRequestData pRequestData) throws Exception {
    String retrieverName = pRequestData.getParameter("nmRet");
    ICsvDataRetriever ret = this.retrievers.get(retrieverName);
    if (ret == null) {
      throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER,
        "Can't find retriever " + retrieverName);
    }
    pRequestData.setAttribute("dataTree", ret.getSampleDataRow(pAddParam));
  }
884893
@Override
    public void perform(TaskRequest req, TaskResponse res) {
        final Element rootElement = (Element) entityElement.evaluate(req, res);
        final IUserLayoutStore rdbmdls = (IUserLayoutStore) layoutStore.evaluate(req, res);
        SupportedFileTypes y = SupportedFileTypes.getApplicableFileType(rootElement, rdbmdls);
        String entityFileName = y.getSafeFileNameWithExtension(rootElement);
        ReturnValue rslt = (ReturnValue) req.getAttribute(Attributes.RETURN_VALUE);
        rslt.setValue(entityFileName);
    }
915743
@Override
    void setScanResult(final ScanResult scanResult) {
        super.setScanResult(scanResult);
        if (elementTypeSignature != null) {
            elementTypeSignature.setScanResult(scanResult);
        }
    }
898196
protected NameID encodeNameIdBasedOnNameFormat(final RequestAbstractType authnRequest,
                                                   final Object assertion,
                                                   final String nameFormat,
                                                   final SamlRegisteredService service,
                                                   final SamlRegisteredServiceServiceProviderMetadataFacade adaptor) {
        try {
            if (authnRequest instanceof AttributeQuery) {
                val query = AttributeQuery.class.cast(authnRequest);
                val nameID = query.getSubject().getNameID();
                nameID.detach();
                LOGGER.debug("Choosing NameID format [{}] with value [{}] for attribute query", nameID.getFormat(), nameID.getValue());
                return nameID;
            }

            val attribute = prepareNameIdAttribute(assertion, nameFormat, adaptor);
            val encoder = prepareNameIdEncoder(authnRequest, nameFormat, attribute, service, adaptor);
            LOGGER.debug("Encoding NameID based on [{}]", nameFormat);
            var nameId = encoder.encode(attribute);
            LOGGER.debug("Final NameID encoded with format [{}] has value [{}]", nameId.getFormat(), nameId.getValue());
            return nameId;
        } catch (final Exception e) {
            LOGGER.error(e.getMessage(), e);
        }
        return null;
    }
705275
public void setAdapter(RecyclerView.Adapter adapter) {
        if (mWrappedAdapter != null && mWrappedAdapter.getItemCount() > 0) {
            notifyItemRangeRemoved(getHeaderCount(), mWrappedAdapter.getItemCount());
        }
        setWrappedAdapter(adapter);
        notifyItemRangeInserted(getHeaderCount(), mWrappedAdapter.getItemCount());
    }
692716
@Override
    public void onBindViewHolder(RecyclerView.ViewHolder viewHolder, int position, List<Object> payloads) {
        Object tag = viewHolder.itemView.getTag(R.id.fastadapter_item_adapter);
        if (tag instanceof FastAdapter) {
            FastAdapter fastAdapter = ((FastAdapter) tag);
            IItem item = fastAdapter.getItem(position);
            if (item != null) {
                item.bindView(viewHolder, payloads);
                if (viewHolder instanceof FastAdapter.ViewHolder) {
                    ((FastAdapter.ViewHolder) viewHolder).bindView(item, payloads);
                }
                //set the R.id.fastadapter_item tag of this item to the item object (can be used when retrieving the view)
                viewHolder.itemView.setTag(R.id.fastadapter_item, item);
            }
        }
    }
1059559
@Override
    public DataBinder process(ResultSet rset) throws Exception {
        try {
            if (rset.next()) {
                ResultSetMetaData meta = rset.getMetaData();
                int width = meta.getColumnCount();
                for (int i = 1; i <= width; ++i) {
                    Object value = rset.getObject(i);
                    if (value != null) {
                        put(Strings.toLowerCamelCase(meta.getColumnLabel(i), '_'), value.toString());
                    }
                }
            } else {
                throw new NoSuchElementException("NoSuchRow");
            }
            return this;
        } finally {
            rset.close();
        }
    }
1371556
@Override
    protected String appendAttributeToQuery(final String queryBuilder, final String dataAttribute, final List<Object> queryValues) {
        if (queryBuilder != null) {
            return queryBuilder;
        }

        final String keyAttributeName;
        if (this.queryAttributeName != null) {
            keyAttributeName = this.queryAttributeName;
        } else {
            final IUsernameAttributeProvider usernameAttributeProvider = this.getUsernameAttributeProvider();
            keyAttributeName = usernameAttributeProvider.getUsernameAttribute();
        }

        if (keyAttributeName.equals(dataAttribute)) {
            return String.valueOf(queryValues.get(0));
        }

        return null;
    }
1147143
@Override
  public final void process(final Map<String, Object> pAddParam,
    final IRequestData pRequestData) throws Exception {
    String taxDestIdStr = pRequestData.getParameter("taxDestId");
    Long taxDestId = Long.parseLong(taxDestIdStr);
    String itemIdStr = pRequestData.getParameter("itemId");
    Long itemId = Long.parseLong(itemIdStr);
    String nmEnt = pRequestData.getParameter("nmEnt");
    String destTaxItemLnNm;
    String itemNm;
    if (SalesInvoiceServiceLine.class.getSimpleName().equals(nmEnt)) {
      destTaxItemLnNm = DestTaxServSelLn.class.getSimpleName().toUpperCase();
      itemNm = ServiceToSale.class.getSimpleName().toUpperCase();
    } else if (PurchaseInvoiceServiceLine.class.getSimpleName().equals(nmEnt)) {
      destTaxItemLnNm = DestTaxServPurchLn.class.getSimpleName().toUpperCase();
      itemNm = ServicePurchased.class.getSimpleName().toUpperCase();
    } else if (PurchaseInvoiceLine.class.getSimpleName().equals(nmEnt)
      || SalesInvoiceLine.class.getSimpleName().equals(nmEnt)
        || SalesReturnLine.class.getSimpleName().equals(nmEnt)
          || PurchaseReturnLine.class.getSimpleName().equals(nmEnt)) {
      destTaxItemLnNm = DestTaxGoodsLn.class.getSimpleName().toUpperCase();
      itemNm = InvItem.class.getSimpleName().toUpperCase();
    } else {
      throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER,
        "Wrong line type " + nmEnt);
    }
    String query = lazyGetQueryRevealTaxCat();
    query = query.replace(":ITEMNM", itemNm);
    query = query.replace(":DESTTAXITEMLNNM", destTaxItemLnNm);
    query = query.replace(":ITEMID", itemId.toString());
    query = query.replace(":TAXDESTID", taxDestId.toString());
    InvItemTaxCategory taxCategory = new InvItemTaxCategory();
    IRecordSet<RS> recordSet = null;
    AccSettings as = (AccSettings) pAddParam.get("accSet");
    RoundingMode rounding = as.getSalTaxRoundMode();
    try {
      this.srvDatabase.setIsAutocommit(false);
      this.srvDatabase.setTransactionIsolation(ISrvDatabase
        .TRANSACTION_READ_UNCOMMITTED);
      this.srvDatabase.beginTransaction();
      recordSet = getSrvDatabase().retrieveRecords(query);
      if (recordSet.moveToFirst()) {
        Long dtlId = recordSet.getLong("DTLID");
        Integer tdrm = null;
        Long tcId = recordSet.getLong("DTCID");
        String tcd = null;
        String tcn = null;
        Double tcRate = null;
        if (dtlId == null) {
          tcn = recordSet.getString("OTCNAME");
          tcd = recordSet.getString("OTCDESCR");
          tcId = recordSet.getLong("OTCID");
          tcRate = recordSet.getDouble("OTCRATE");
        } else if (tcId != null) {
          tdrm = recordSet.getInteger("DTRM");
          tcd = recordSet.getString("DTCDESCR");
          tcn = recordSet.getString("DTCNAME");
          tcRate = recordSet.getDouble("DTCRATE");
        }
        taxCategory.setItsId(tcId);
        taxCategory.setItsName(tcn);
        taxCategory.setTaxesDescription(tcd);
        if (tdrm != null) {
          rounding = RoundingMode.class.getEnumConstants()[tdrm];
        }
        if (tcRate != null) {
          taxCategory.setAggrOnlyPercent(BigDecimal.valueOf(tcRate));
        }
        if (recordSet.moveToNext()) {
          throw new ExceptionWithCode(ExceptionWithCode.SOMETHING_WRONG,
    "There are multiply tax category results for item id/tax dest.id/entity: "
      + itemId + "/" + taxDestId + "/" + nmEnt);
        }
      }
      this.srvDatabase.commitTransaction();
    } catch (Exception ex) {
      this.srvDatabase.rollBackTransaction();
      throw ex;
    } finally {
      if (recordSet != null) {
        recordSet.close();
      }
      this.srvDatabase.releaseResources();
    }
    pRequestData.setAttribute("taxRounding", rounding);
    pRequestData.setAttribute("taxCategory", taxCategory);
  }
421763
public boolean setCustomResponse(String pathValue, String requestType, String customData) {
        try {
            JSONObject path = getPathFromEndpoint(pathValue, requestType);
            if (path == null) {
                String pathName = pathValue;
                createPath(pathName, pathValue, requestType);
                path = getPathFromEndpoint(pathValue, requestType);
            }
            String pathId = path.getString("pathId");
            resetResponseOverride(pathId);
            setCustomResponse(pathId, customData);
            return toggleResponseOverride(pathId, true);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }
602910
@RequestMapping(method = RequestMethod.POST)
    @ResponseBody
    protected final String process(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
//        if(StrUtil.isBlank(legalStr(request))){
//            return "";
//        }
        String result = processRequest(request);
        response.getWriter().write(result);
        return null;
    }
23728
@Override
    public void registerAdapterDataObserver(RecyclerView.AdapterDataObserver observer) {
        super.registerAdapterDataObserver(observer);
        if (mFastAdapter != null) {
            mFastAdapter.registerAdapterDataObserver(observer);
        }
    }
307885
@Override
  public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
                                         @NonNull int[] grantResults) {
    if (requestCode == REQUEST_READ_CONTACTS) {
      if (grantResults.length == 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
        populateAutoComplete();
      }
    }
  }
318726
public void setRequestMap(final Map<String, Object> requestMap) {
		JKThreadLocal.setValue(JKContextConstants.HTTP_REQUEST_MAP, requestMap);
	}
1355235
public void onActivityResult(int requestCode, int resultCode, Intent data) {
        onActivityResult(requestCode, resultCode, data, null);
    }