Create cjah entity from html
@param id
@param html
@param cb
549798
function createCjahEntity(id, html, cb) {
    let entity = null
    try {
        let $ = parser.load(html)
        let trs = $('table tbody tr')

        // Not found
        if (!trs || trs.length === 0) {
            cb(utils.errorNoData())
            return
        }

        let states = utils.tableParser(
        trs,
        {
            'id': { 'idx': 1, 'mandatory': true },
            'date': {'idx': 3, 'mandatory': true, 'parser': elem => { return moment.tz( elem, 'DD/MM/YYYY h:mm:ssa', 'en', zone).format()}},
            'state': { 'idx': 5, 'mandatory': true }
        },
        elem => true)

        entity = new CjahInfo({
            id: states[0].id,
            state: states[0].state,
            states: states
        })
    } catch (error) {
        return cb(utils.errorParser(id, error.message))
    }

    cb(null, entity)
}
636622
public void loadDefinition(
        final String entityId,
        final CmsEntity editedEntity,
        final I_CmsSimpleCallback<CmsContentDefinition> callback) {

        CmsRpcAction<CmsContentDefinition> action = new CmsRpcAction<CmsContentDefinition>() {

            @Override
            public void execute() {

                start(0, true);
                getService().loadDefinition(
                    entityId,
                    m_clientId,
                    editedEntity,
                    getSkipPaths(),
                    m_context.getSettingPresets(),
                    this);
            }

            @Override
            protected void onResponse(final CmsContentDefinition result) {

                registerContentDefinition(result);
                WidgetRegistry.getInstance().registerExternalWidgets(
                    result.getExternalWidgetConfigurations(),
                    new Command() {

                        public void execute() {

                            stop(false);
                            callback.execute(result);
                        }
                    });
            }
        };
        action.execute();
    }
149732
function createEntity(html, id) {
    let $ = parser.load(html)

    let table = $('tr.past')

    let states = utils.tableParser(table, {
        date: {
            idx: 3,
            mandatory: true
        },
        hours: {
            idx: 5,
            mandatory: true
        },
        state: {
            idx: 7,
            mandatory: true
        },
        area: {
            idx: 9,
            mandatory: false
        }
    }).map(line => {
        let d = line.date + ' ' + line.hours
        return {
            date: moment.tz(d, "DD/MM/YYYY HH:mm", zone).format(),
            state: line.state,
            area: line.area
        }
    })

    return new EntityInfo({
        id: id,
        states: states
    })
}
539923
public static HtmlTree A_ID(HtmlStyle styleClass, String id, Content body) {
        HtmlTree htmltree = A_ID(id, body);
        if (styleClass != null)
            htmltree.addStyle(styleClass);
        return htmltree;
    }
517090
private void createCompleteKey(Key parent, long id) {
    String kind = entityMetadata.getKind();
    if (parent == null) {
      key = entityManager.newNativeKeyFactory().setKind(kind).newKey(id);
    } else {
      key = Key.newBuilder(parent, kind, id).build();
    }
  }
993578
private Document cmisObject( String id ) {
        CmisObject cmisObject;
        try {
             cmisObject   = session.getObject(id);
        } catch (CmisObjectNotFoundException e) {
            return null;
        }

        // object does not exist? return null
        if (cmisObject == null) {
            return null;
        }

        // converting CMIS object to JCR node
        switch (cmisObject.getBaseTypeId()) {
            case CMIS_FOLDER:
                return cmisFolder(cmisObject);
            case CMIS_DOCUMENT:
                return cmisDocument(cmisObject);
            case CMIS_POLICY:
            case CMIS_RELATIONSHIP:
            case CMIS_SECONDARY:
            case CMIS_ITEM:
        }

        // unexpected object type
        return null;
    }
7556
static EntityIdValue fromId(String id, String siteIri) {
		switch (guessEntityTypeFromId(id)) {
			case EntityIdValueImpl.JSON_ENTITY_TYPE_ITEM:
				return new ItemIdValueImpl(id, siteIri);
			case EntityIdValueImpl.JSON_ENTITY_TYPE_PROPERTY:
				return new PropertyIdValueImpl(id, siteIri);
			case EntityIdValueImpl.JSON_ENTITY_TYPE_LEXEME:
				return new LexemeIdValueImpl(id, siteIri);
			case EntityIdValueImpl.JSON_ENTITY_TYPE_FORM:
				return new FormIdValueImpl(id, siteIri);
			case EntityIdValueImpl.JSON_ENTITY_TYPE_SENSE:
				return new SenseIdValueImpl(id, siteIri);
			default:
				throw new IllegalArgumentException("Entity id \"" + id + "\" is not supported.");
		}
	}
1161701
public void loadContentDefinition(final String entityId, final Command callback) {

        AsyncCallback<CmsContentDefinition> asyncCallback = new AsyncCallback<CmsContentDefinition>() {

            public void onFailure(Throwable caught) {

                onRpcError(caught);
            }

            public void onSuccess(CmsContentDefinition result) {

                registerContentDefinition(result);
                callback.execute();
            }
        };
        getService().loadContentDefinition(entityId, asyncCallback);
    }
1216725
function setRequestId(id, cb) {
  var ns = getLoggerNamespace();
  ns.run(function() {
    ns.set('requestId', id);
    cb();
  });
}
386676
@Transactional
  @PostMapping(
      value = "/{entityTypeId}",
      headers = "Content-Type=application/x-www-form-urlencoded")
  public void createFromFormPost(
      @PathVariable("entityTypeId") String entityTypeId,
      HttpServletRequest request,
      HttpServletResponse response) {
    Map<String, Object> paramMap = new HashMap<>();
    for (String param : request.getParameterMap().keySet()) {
      String[] values = request.getParameterValues(param);
      String value = values != null ? StringUtils.join(values, ',') : null;
      if (StringUtils.isNotBlank(value)) {
        paramMap.put(param, value);
      }
    }

    createInternal(entityTypeId, paramMap, response);
  }
569742
function createCorreosEntity(html) {
    let $ = parser.load(html)

    var id = $('.shipping span').get(0).children[0].data.trim()
    var state = $('.status').get(0).children[2].data.trim()
    var state2 = ""
    try {
        state2 = $('.status-desc .status-message').get(0).children[0].data.trim()
    } catch (e) {
        // sometimes there is no state2
    }

    var deliveryDate = $('.status').get(0).children[4]
    if (deliveryDate !== undefined) {
        deliveryDate = deliveryDate.data.trim()
        deliveryDate = deliveryDate.substring(deliveryDate.indexOf(',') + 1)
        deliveryDate = getDeliveryDate(deliveryDate.trim())
    }

    var origin = $('.origin').get(0).children[0].data.trim()
    var destiny = $('.destiny').get(0).children[0].data.trim()
    origin = origin.substring(origin.indexOf(':') + 1).trim()
    destiny = destiny.substring(destiny.indexOf(':') + 1).trim()

    let states = utils.tableParser(
        $('table tbody tr'),
        {
            'date': {
                'idx': 1, 'mandatory': true, 'parser': elem => {
                    return moment.tz(elem, ', DD/MM/YYYY HH:mm', 'es', zone).format()
                }
            },
            'state': {'idx': 5, 'mandatory': true},
            'area': {'idx': 3}
        },
        elem => true)

    return new CorreosInfo({
        id: id,
        state: state.replace('.', ''),
        state2: state2.replace('.', ''),
        origin: origin,
        destiny: destiny,
        deliveryDate: deliveryDate,
        states: states
    })
}
672859
public void copyElement(final String id, final I_CmsSimpleCallback<CmsUUID> callback) {

        CmsRpcAction<CmsUUID> action = new CmsRpcAction<CmsUUID>() {

            @Override
            public void execute() {

                start(200, false);
                getContainerpageService().copyElement(
                    CmsCoreProvider.get().getStructureId(),
                    new CmsUUID(id),
                    getData().getLocale(),
                    this);
            }

            @Override
            protected void onResponse(CmsUUID result) {

                stop(false);
                callback.execute(result);
            }

        };
        action.execute();
    }
1103186
@SuppressWarnings("unchecked")
  public <C extends CDACallback<T>> C one(String id, C callback) {
    return (C) Callbacks.subscribeAsync(baseQuery().one(id), callback, client);
  }
1224624
function(id) {
        if (typeof id !== "string") {
            YAHOO.log("id is not a string, assuming it is an HTMLElement");
            id = Dom.generateId(id);
        }
        this.invalidHandleIds[id] = id;
    }
769531
public void set_async_reply_cb(final int id, final CallBack cb) {
        final AsyncCallObject aco = async_request_table.get(id);
        if (aco != null) {
            aco.cb = cb;
        }
    }
764645
function create(body, cb) {
  var validates = Schema(body);

  if(!validates) {
    return cb(new exceptions.BadRequest());
  }

  body.expires_at = stampify(conf.session_maxage);

  var q = qb.insert(body);
  db.getClient(function(err, client, done) {
    client.query(q[0], q[1], function(err, r) {
      if(err) {
        if(err.code == 23505) {
          err = new exceptions.AlreadyExists();
        }
        cb(err);
        done(err);
      } else {
        cb(null, r.rows[0]);
        done();
      }
    });
  });
}
1160449
public static HtmlTree A_ID(String id, Content body) {
        HtmlTree htmltree = new HtmlTree(HtmlTag.A);
        htmltree.addAttr(HtmlAttr.ID, nullCheck(id));
        htmltree.addContent(nullCheck(body));
        return htmltree;
    }