Search in sources :

Example 1 with JSONDocumentChangeLog

use of de.metas.ui.web.window.datatypes.json.JSONDocumentChangeLog in project metasfresh-webui-api by metasfresh.

the class WindowRestController method getDocumentChangeLog.

private JSONDocumentChangeLog getDocumentChangeLog(final DocumentPath documentPath) {
    final TableRecordReference recordRef = documentCollection.getTableRecordReference(documentPath);
    final JSONDocumentChangeLog json = documentChangeLogService.getJSONDocumentChangeLog(recordRef, userSession.getAD_Language());
    json.setPath(JSONDocumentPath.ofWindowDocumentPath(documentPath));
    return json;
}
Also used : TableRecordReference(org.adempiere.util.lang.impl.TableRecordReference) JSONDocumentChangeLog(de.metas.ui.web.window.datatypes.json.JSONDocumentChangeLog)

Example 2 with JSONDocumentChangeLog

use of de.metas.ui.web.window.datatypes.json.JSONDocumentChangeLog in project metasfresh-webui-api by metasfresh.

the class DocumentChangeLogService method toJson.

private JSONDocumentChangeLog toJson(RecordChangeLog changeLog, final String adLanguage) {
    final JSONDocumentChangeLog json = new JSONDocumentChangeLog();
    json.setCreatedByUsername(usersRepo.retrieveUserFullname(changeLog.getCreatedByUserId()));
    json.setLastChangedByUsername(usersRepo.retrieveUserFullname(changeLog.getLastChangedByUserId()));
    final ZonedDateTime created = TimeUtil.asZonedDateTime(changeLog.getCreatedTimestamp());
    json.setCreatedTimestamp(formatTimestamp(created, adLanguage));
    final ZonedDateTime updated = TimeUtil.asZonedDateTime(changeLog.getLastChangedTimestamp());
    json.setLastChangedTimestamp(formatTimestamp(updated, adLanguage));
    return json;
}
Also used : ZonedDateTime(java.time.ZonedDateTime) JSONDocumentChangeLog(de.metas.ui.web.window.datatypes.json.JSONDocumentChangeLog)

Aggregations

JSONDocumentChangeLog (de.metas.ui.web.window.datatypes.json.JSONDocumentChangeLog)2 ZonedDateTime (java.time.ZonedDateTime)1 TableRecordReference (org.adempiere.util.lang.impl.TableRecordReference)1