Compare commits
4 Commits
e15dd14cab
...
3ecc6275bc
| Author | SHA1 | Date | |
|---|---|---|---|
| 3ecc6275bc | |||
| d0397e475e | |||
| 51d9f7fa22 | |||
| 80dc3b40d3 |
71
custom/Espo/Custom/Api/JunctionData/GetDokumentes.php
Normal file
71
custom/Espo/Custom/Api/JunctionData/GetDokumentes.php
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Espo\Custom\Api\JunctionData;
|
||||||
|
|
||||||
|
use Espo\Core\Api\Action;
|
||||||
|
use Espo\Core\Api\Request;
|
||||||
|
use Espo\Core\Api\Response;
|
||||||
|
use Espo\Core\Api\ResponseComposer;
|
||||||
|
use Espo\Core\Exceptions\BadRequest;
|
||||||
|
use Espo\Core\Exceptions\NotFound;
|
||||||
|
use Espo\ORM\EntityManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GET /api/v1/JunctionData/CAIKnowledge/:knowledgeId/dokumentes
|
||||||
|
*
|
||||||
|
* Returns all documents linked to a knowledge entry with junction table data
|
||||||
|
*/
|
||||||
|
class GetDokumentes implements Action
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
private EntityManager $entityManager
|
||||||
|
) {}
|
||||||
|
|
||||||
|
public function process(Request $request): Response
|
||||||
|
{
|
||||||
|
$knowledgeId = $request->getRouteParam('knowledgeId');
|
||||||
|
|
||||||
|
if (!$knowledgeId) {
|
||||||
|
throw new BadRequest('Knowledge ID is required');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Verify knowledge exists
|
||||||
|
$knowledge = $this->entityManager->getEntityById('CAIKnowledge', $knowledgeId);
|
||||||
|
if (!$knowledge) {
|
||||||
|
throw new NotFound('Knowledge entry not found');
|
||||||
|
}
|
||||||
|
|
||||||
|
$pdo = $this->entityManager->getPDO();
|
||||||
|
|
||||||
|
$sql = "
|
||||||
|
SELECT
|
||||||
|
j.id as junctionId,
|
||||||
|
j.c_a_i_knowledge_id as cAIKnowledgeId,
|
||||||
|
j.c_dokumente_id as cDokumenteId,
|
||||||
|
j.ai_document_id as aiDocumentId,
|
||||||
|
j.syncstatus,
|
||||||
|
j.last_sync as lastSync,
|
||||||
|
d.id as documentId,
|
||||||
|
d.name as documentName,
|
||||||
|
d.blake3hash as blake3hash,
|
||||||
|
d.created_at as documentCreatedAt,
|
||||||
|
d.modified_at as documentModifiedAt
|
||||||
|
FROM c_a_i_knowledge_dokumente j
|
||||||
|
INNER JOIN c_dokumente d ON j.c_dokumente_id = d.id
|
||||||
|
WHERE j.c_a_i_knowledge_id = :knowledgeId
|
||||||
|
AND j.deleted = 0
|
||||||
|
AND d.deleted = 0
|
||||||
|
ORDER BY j.id DESC
|
||||||
|
";
|
||||||
|
|
||||||
|
$sth = $pdo->prepare($sql);
|
||||||
|
$sth->execute(['knowledgeId' => $knowledgeId]);
|
||||||
|
|
||||||
|
$results = $sth->fetchAll(\PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
return ResponseComposer::json([
|
||||||
|
'total' => count($results),
|
||||||
|
'list' => $results
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
178
custom/Espo/Custom/Api/JunctionData/LinkDokument.php
Normal file
178
custom/Espo/Custom/Api/JunctionData/LinkDokument.php
Normal file
@@ -0,0 +1,178 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Espo\Custom\Api\JunctionData;
|
||||||
|
|
||||||
|
use Espo\Core\Api\Action;
|
||||||
|
use Espo\Core\Api\Request;
|
||||||
|
use Espo\Core\Api\Response;
|
||||||
|
use Espo\Core\Api\ResponseComposer;
|
||||||
|
use Espo\Core\Exceptions\BadRequest;
|
||||||
|
use Espo\Core\Exceptions\NotFound;
|
||||||
|
use Espo\Core\Exceptions\Conflict;
|
||||||
|
use Espo\ORM\EntityManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST /api/v1/JunctionData/CAIKnowledge/:knowledgeId/dokumentes/:documentId
|
||||||
|
*
|
||||||
|
* Creates or updates relationship with junction table data
|
||||||
|
* This endpoint links the entities AND sets junction columns in one call
|
||||||
|
*/
|
||||||
|
class LinkDokument implements Action
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
private EntityManager $entityManager
|
||||||
|
) {}
|
||||||
|
|
||||||
|
public function process(Request $request): Response
|
||||||
|
{
|
||||||
|
$knowledgeId = $request->getRouteParam('knowledgeId');
|
||||||
|
$documentId = $request->getRouteParam('documentId');
|
||||||
|
$data = $request->getParsedBody();
|
||||||
|
|
||||||
|
if (!$knowledgeId || !$documentId) {
|
||||||
|
throw new BadRequest('Knowledge ID and Document ID are required');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Verify entities exist
|
||||||
|
$knowledge = $this->entityManager->getEntityById('CAIKnowledge', $knowledgeId);
|
||||||
|
if (!$knowledge) {
|
||||||
|
throw new NotFound('Knowledge entry not found');
|
||||||
|
}
|
||||||
|
|
||||||
|
$document = $this->entityManager->getEntityById('CDokumente', $documentId);
|
||||||
|
if (!$document) {
|
||||||
|
throw new NotFound('Document not found');
|
||||||
|
}
|
||||||
|
|
||||||
|
$pdo = $this->entityManager->getPDO();
|
||||||
|
|
||||||
|
// Check if link already exists
|
||||||
|
$existing = $this->checkIfLinked($knowledgeId, $documentId);
|
||||||
|
|
||||||
|
if ($existing) {
|
||||||
|
// Link exists - update junction columns
|
||||||
|
return $this->updateExisting($knowledgeId, $documentId, $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create new link via ORM (triggers hooks like DokumenteSyncStatus)
|
||||||
|
$this->entityManager->getRDBRepository('CAIKnowledge')
|
||||||
|
->getRelation($knowledge, 'dokumentes')
|
||||||
|
->relate($document);
|
||||||
|
|
||||||
|
// Now set junction columns if provided
|
||||||
|
if (!empty((array)$data)) {
|
||||||
|
return $this->updateExisting($knowledgeId, $documentId, $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return created entry
|
||||||
|
$result = $this->getJunctionEntry($knowledgeId, $documentId);
|
||||||
|
|
||||||
|
return ResponseComposer::json($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function checkIfLinked(string $knowledgeId, string $documentId): bool
|
||||||
|
{
|
||||||
|
$pdo = $this->entityManager->getPDO();
|
||||||
|
|
||||||
|
$sql = "
|
||||||
|
SELECT COUNT(*) as count
|
||||||
|
FROM c_a_i_knowledge_dokumente
|
||||||
|
WHERE c_a_i_knowledge_id = :knowledgeId
|
||||||
|
AND c_dokumente_id = :documentId
|
||||||
|
AND deleted = 0
|
||||||
|
";
|
||||||
|
|
||||||
|
$sth = $pdo->prepare($sql);
|
||||||
|
$sth->execute([
|
||||||
|
'knowledgeId' => $knowledgeId,
|
||||||
|
'documentId' => $documentId
|
||||||
|
]);
|
||||||
|
|
||||||
|
$result = $sth->fetch(\PDO::FETCH_ASSOC);
|
||||||
|
return $result['count'] > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function updateExisting(string $knowledgeId, string $documentId, \stdClass $data): Response
|
||||||
|
{
|
||||||
|
$pdo = $this->entityManager->getPDO();
|
||||||
|
|
||||||
|
// Build dynamic UPDATE SET clause
|
||||||
|
$setClauses = [];
|
||||||
|
$params = [
|
||||||
|
'knowledgeId' => $knowledgeId,
|
||||||
|
'documentId' => $documentId
|
||||||
|
];
|
||||||
|
|
||||||
|
if (isset($data->aiDocumentId)) {
|
||||||
|
$setClauses[] = "ai_document_id = :aiDocumentId";
|
||||||
|
$params['aiDocumentId'] = $data->aiDocumentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($data->syncstatus)) {
|
||||||
|
$allowedStatuses = ['new', 'unclean', 'synced', 'failed', 'unsupported'];
|
||||||
|
if (!in_array($data->syncstatus, $allowedStatuses)) {
|
||||||
|
throw new BadRequest('Invalid syncstatus value. Allowed: ' . implode(', ', $allowedStatuses));
|
||||||
|
}
|
||||||
|
$setClauses[] = "syncstatus = :syncstatus";
|
||||||
|
$params['syncstatus'] = $data->syncstatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($data->lastSync)) {
|
||||||
|
$setClauses[] = "last_sync = :lastSync";
|
||||||
|
$params['lastSync'] = $data->lastSync;
|
||||||
|
} elseif (isset($data->updateLastSync) && $data->updateLastSync === true) {
|
||||||
|
$setClauses[] = "last_sync = NOW()";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($setClauses)) {
|
||||||
|
$sql = "
|
||||||
|
UPDATE c_a_i_knowledge_dokumente
|
||||||
|
SET " . implode(', ', $setClauses) . "
|
||||||
|
WHERE c_a_i_knowledge_id = :knowledgeId
|
||||||
|
AND c_dokumente_id = :documentId
|
||||||
|
AND deleted = 0
|
||||||
|
";
|
||||||
|
|
||||||
|
$sth = $pdo->prepare($sql);
|
||||||
|
$sth->execute($params);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return updated data
|
||||||
|
$result = $this->getJunctionEntry($knowledgeId, $documentId);
|
||||||
|
|
||||||
|
return ResponseComposer::json($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getJunctionEntry(string $knowledgeId, string $documentId): array
|
||||||
|
{
|
||||||
|
$pdo = $this->entityManager->getPDO();
|
||||||
|
|
||||||
|
$sql = "
|
||||||
|
SELECT
|
||||||
|
id as junctionId,
|
||||||
|
c_a_i_knowledge_id as cAIKnowledgeId,
|
||||||
|
c_dokumente_id as cDokumenteId,
|
||||||
|
ai_document_id as aiDocumentId,
|
||||||
|
syncstatus,
|
||||||
|
last_sync as lastSync
|
||||||
|
FROM c_a_i_knowledge_dokumente
|
||||||
|
WHERE c_a_i_knowledge_id = :knowledgeId
|
||||||
|
AND c_dokumente_id = :documentId
|
||||||
|
AND deleted = 0
|
||||||
|
";
|
||||||
|
|
||||||
|
$sth = $pdo->prepare($sql);
|
||||||
|
$sth->execute([
|
||||||
|
'knowledgeId' => $knowledgeId,
|
||||||
|
'documentId' => $documentId
|
||||||
|
]);
|
||||||
|
|
||||||
|
$result = $sth->fetch(\PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
if (!$result) {
|
||||||
|
throw new NotFound('Junction entry not found');
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
}
|
||||||
123
custom/Espo/Custom/Api/JunctionData/UpdateJunction.php
Normal file
123
custom/Espo/Custom/Api/JunctionData/UpdateJunction.php
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Espo\Custom\Api\JunctionData;
|
||||||
|
|
||||||
|
use Espo\Core\Api\Action;
|
||||||
|
use Espo\Core\Api\Request;
|
||||||
|
use Espo\Core\Api\Response;
|
||||||
|
use Espo\Core\Api\ResponseComposer;
|
||||||
|
use Espo\Core\Exceptions\BadRequest;
|
||||||
|
use Espo\Core\Exceptions\NotFound;
|
||||||
|
use Espo\ORM\EntityManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PUT /api/v1/JunctionData/CAIKnowledge/:knowledgeId/dokumentes/:documentId
|
||||||
|
*
|
||||||
|
* Updates junction table columns for an existing relationship
|
||||||
|
*/
|
||||||
|
class UpdateJunction implements Action
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
private EntityManager $entityManager
|
||||||
|
) {}
|
||||||
|
|
||||||
|
public function process(Request $request): Response
|
||||||
|
{
|
||||||
|
$knowledgeId = $request->getRouteParam('knowledgeId');
|
||||||
|
$documentId = $request->getRouteParam('documentId');
|
||||||
|
$data = $request->getParsedBody();
|
||||||
|
|
||||||
|
if (!$knowledgeId || !$documentId) {
|
||||||
|
throw new BadRequest('Knowledge ID and Document ID are required');
|
||||||
|
}
|
||||||
|
|
||||||
|
$pdo = $this->entityManager->getPDO();
|
||||||
|
|
||||||
|
// Build dynamic UPDATE SET clause
|
||||||
|
$setClauses = [];
|
||||||
|
$params = [
|
||||||
|
'knowledgeId' => $knowledgeId,
|
||||||
|
'documentId' => $documentId
|
||||||
|
];
|
||||||
|
|
||||||
|
if (isset($data->aiDocumentId)) {
|
||||||
|
$setClauses[] = "ai_document_id = :aiDocumentId";
|
||||||
|
$params['aiDocumentId'] = $data->aiDocumentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($data->syncstatus)) {
|
||||||
|
$allowedStatuses = ['new', 'unclean', 'synced', 'failed', 'unsupported'];
|
||||||
|
if (!in_array($data->syncstatus, $allowedStatuses)) {
|
||||||
|
throw new BadRequest('Invalid syncstatus value. Allowed: ' . implode(', ', $allowedStatuses));
|
||||||
|
}
|
||||||
|
$setClauses[] = "syncstatus = :syncstatus";
|
||||||
|
$params['syncstatus'] = $data->syncstatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($data->lastSync)) {
|
||||||
|
$setClauses[] = "last_sync = :lastSync";
|
||||||
|
$params['lastSync'] = $data->lastSync;
|
||||||
|
} elseif (isset($data->updateLastSync) && $data->updateLastSync === true) {
|
||||||
|
$setClauses[] = "last_sync = NOW()";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($setClauses)) {
|
||||||
|
throw new BadRequest('No fields to update. Provide at least one of: aiDocumentId, syncstatus, lastSync');
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = "
|
||||||
|
UPDATE c_a_i_knowledge_dokumente
|
||||||
|
SET " . implode(', ', $setClauses) . "
|
||||||
|
WHERE c_a_i_knowledge_id = :knowledgeId
|
||||||
|
AND c_dokumente_id = :documentId
|
||||||
|
AND deleted = 0
|
||||||
|
";
|
||||||
|
|
||||||
|
$sth = $pdo->prepare($sql);
|
||||||
|
$sth->execute($params);
|
||||||
|
|
||||||
|
$affectedRows = $sth->rowCount();
|
||||||
|
|
||||||
|
if ($affectedRows === 0) {
|
||||||
|
throw new NotFound('Junction entry not found or no changes made');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return updated data
|
||||||
|
$result = $this->getJunctionEntry($knowledgeId, $documentId);
|
||||||
|
|
||||||
|
return ResponseComposer::json($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getJunctionEntry(string $knowledgeId, string $documentId): array
|
||||||
|
{
|
||||||
|
$pdo = $this->entityManager->getPDO();
|
||||||
|
|
||||||
|
$sql = "
|
||||||
|
SELECT
|
||||||
|
id as junctionId,
|
||||||
|
c_a_i_knowledge_id as cAIKnowledgeId,
|
||||||
|
c_dokumente_id as cDokumenteId,
|
||||||
|
ai_document_id as aiDocumentId,
|
||||||
|
syncstatus,
|
||||||
|
last_sync as lastSync
|
||||||
|
FROM c_a_i_knowledge_dokumente
|
||||||
|
WHERE c_a_i_knowledge_id = :knowledgeId
|
||||||
|
AND c_dokumente_id = :documentId
|
||||||
|
AND deleted = 0
|
||||||
|
";
|
||||||
|
|
||||||
|
$sth = $pdo->prepare($sql);
|
||||||
|
$sth->execute([
|
||||||
|
'knowledgeId' => $knowledgeId,
|
||||||
|
'documentId' => $documentId
|
||||||
|
]);
|
||||||
|
|
||||||
|
$result = $sth->fetch(\PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
if (!$result) {
|
||||||
|
throw new NotFound('Junction entry not found');
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -35,22 +35,24 @@ class CDokumente extends \Espo\Core\Hooks\Base
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Berechne neue Hashes
|
// Berechne Blake3 Hash
|
||||||
$newMd5 = hash_file('md5', $filePath);
|
$fileContent = file_get_contents($filePath);
|
||||||
$newSha256 = hash_file('sha256', $filePath);
|
if ($fileContent === false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Setze Hashes
|
$newBlake3 = \blake3($fileContent);
|
||||||
$entity->set('md5sum', $newMd5);
|
|
||||||
$entity->set('sha256', $newSha256);
|
// Setze Hash
|
||||||
|
$entity->set('blake3hash', $newBlake3);
|
||||||
|
|
||||||
// Bestimme Status
|
// Bestimme Status
|
||||||
if ($entity->isNew()) {
|
if ($entity->isNew()) {
|
||||||
$entity->set('fileStatus', 'new');
|
$entity->set('fileStatus', 'new');
|
||||||
} else {
|
} else {
|
||||||
$oldMd5 = $entity->getFetched('md5sum');
|
$oldBlake3 = $entity->getFetched('blake3hash');
|
||||||
$oldSha256 = $entity->getFetched('sha256');
|
|
||||||
|
|
||||||
if ($oldMd5 !== $newMd5 || $oldSha256 !== $newSha256) {
|
if ($oldBlake3 !== $newBlake3) {
|
||||||
$entity->set('fileStatus', 'changed');
|
$entity->set('fileStatus', 'changed');
|
||||||
} else {
|
} else {
|
||||||
$entity->set('fileStatus', 'synced');
|
$entity->set('fileStatus', 'synced');
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
{
|
|
||||||
"labels": {
|
|
||||||
"Create CAICollectionCDokumente": "AI-Collection-Dokument-Verknüpfung erstellen",
|
|
||||||
"CAICollectionCDokumente": "AI-Collection-Dokument-Verknüpfungen"
|
|
||||||
},
|
|
||||||
"fields": {
|
|
||||||
"cAICollection": "AI-Collection",
|
|
||||||
"cAICollectionId": "AI-Collection ID",
|
|
||||||
"cDokumente": "Dokument",
|
|
||||||
"cDokumenteId": "Dokument ID",
|
|
||||||
"xaifileid": "XAI File ID",
|
|
||||||
"syncStatus": "Sync-Status",
|
|
||||||
"deleted": "Gelöscht"
|
|
||||||
},
|
|
||||||
"links": {
|
|
||||||
"cAICollection": "AI-Collection",
|
|
||||||
"cDokumente": "Dokument"
|
|
||||||
},
|
|
||||||
"options": {
|
|
||||||
"syncStatus": {
|
|
||||||
"new": "Neu",
|
|
||||||
"changed": "Geändert",
|
|
||||||
"synced": "Synchronisiert",
|
|
||||||
"deleted": "Gelöscht"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tooltips": {
|
|
||||||
"xaifileid": "Externe XAI File ID für dieses Dokument",
|
|
||||||
"syncStatus": "Synchronisierungsstatus mit XAI"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,31 +1,30 @@
|
|||||||
{
|
{
|
||||||
"labels": {
|
|
||||||
"Create CAIKnowledgeCDokumente": "AI Knowledge-Dokument Verknüpfung erstellen",
|
|
||||||
"CAIKnowledgeCDokumente": "AI Knowledge-Dokument Verknüpfung"
|
|
||||||
},
|
|
||||||
"fields": {
|
"fields": {
|
||||||
"cAIKnowledge": "AI Knowledge",
|
"cAIKnowledge": "AI Knowledge",
|
||||||
"cAIKnowledgeId": "AI Knowledge ID",
|
|
||||||
"cDokumente": "Dokument",
|
"cDokumente": "Dokument",
|
||||||
"cDokumenteId": "Dokument ID",
|
|
||||||
"aiDocumentId": "AI Dokument-ID",
|
"aiDocumentId": "AI Dokument-ID",
|
||||||
"syncstatus": "Sync-Status",
|
"syncstatus": "Sync-Status",
|
||||||
"lastSync": "Letzte Synchronisation",
|
"lastSync": "Letzte Synchronisation",
|
||||||
"syncedHash": "Sync-Hash"
|
"syncedHash": "Sync-Hash"
|
||||||
},
|
},
|
||||||
|
"links": {
|
||||||
|
"cAIKnowledge": "AI Knowledge",
|
||||||
|
"cDokumente": "Dokument"
|
||||||
|
},
|
||||||
|
"labels": {
|
||||||
|
"Create CAIKnowledgeCDokumente": "Verknüpfung erstellen"
|
||||||
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"syncstatus": {
|
"syncstatus": {
|
||||||
"new": "Neu",
|
"new": "Neu",
|
||||||
"unclean": "Unklar",
|
"unclean": "Geändert",
|
||||||
"synced": "Synchronisiert",
|
"synced": "Synchronisiert",
|
||||||
"failed": "Fehlgeschlagen",
|
"failed": "Fehler",
|
||||||
"unsupported": "Nicht unterstützt"
|
"unsupported": "Nicht unterstützt"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tooltips": {
|
"tooltips": {
|
||||||
"aiDocumentId": "Externe AI-Dokument-Referenz-ID",
|
"aiDocumentId": "Externe AI-Dokument-Referenz-ID",
|
||||||
"syncstatus": "Status der Synchronisation mit externem AI-System",
|
"syncedHash": "Hash-Wert des zuletzt synchronisierten Dokument-Zustands"
|
||||||
"lastSync": "Zeitpunkt der letzten erfolgreichen Synchronisation",
|
|
||||||
"syncedHash": "Hash-Wert des zuletzt synchronisierten Dokument-Zustands (zur Änderungserkennung)"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,10 +2,7 @@
|
|||||||
"fields": {
|
"fields": {
|
||||||
"dokument": "Download",
|
"dokument": "Download",
|
||||||
"preview": "Vorschau",
|
"preview": "Vorschau",
|
||||||
"ydocumentuuid": "Y-Document-UUID",
|
"blake3hash": "Blake3-Hash",
|
||||||
"md5sum": "MD5-Prüfsumme",
|
|
||||||
"sha256": "SHA256-Prüfsumme",
|
|
||||||
"fileStatus": "Datei-Status",
|
|
||||||
"contactsvmhdokumente": "Freigegebene Nutzer",
|
"contactsvmhdokumente": "Freigegebene Nutzer",
|
||||||
"vmhMietverhltnisesDokumente": "Mietverhältnisse",
|
"vmhMietverhltnisesDokumente": "Mietverhältnisse",
|
||||||
"vmhErstgespraechsdokumente": "Erstgespräche",
|
"vmhErstgespraechsdokumente": "Erstgespräche",
|
||||||
@@ -41,13 +38,6 @@
|
|||||||
"Create CDokumente": "Dokument erstellen"
|
"Create CDokumente": "Dokument erstellen"
|
||||||
},
|
},
|
||||||
"tooltips": {
|
"tooltips": {
|
||||||
"fileStatus": "Status der Datei: new = neu hochgeladen, changed = geändert, synced = synchronisiert"
|
"blake3hash": "Kryptografischer Blake3-Hash der Datei (schneller und sicherer als MD5/SHA256)"
|
||||||
},
|
|
||||||
"options": {
|
|
||||||
"fileStatus": {
|
|
||||||
"new": "Neu",
|
|
||||||
"changed": "Geändert",
|
|
||||||
"synced": "Synchronisiert"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
{
|
|
||||||
"labels": {
|
|
||||||
"Create CAICollectionCDokumente": "Create AI Collection Document Link",
|
|
||||||
"CAICollectionCDokumente": "AI Collection Document Links"
|
|
||||||
},
|
|
||||||
"fields": {
|
|
||||||
"cAICollection": "AI Collection",
|
|
||||||
"cAICollectionId": "AI Collection ID",
|
|
||||||
"cDokumente": "Document",
|
|
||||||
"cDokumenteId": "Document ID",
|
|
||||||
"xaifileid": "XAI File ID",
|
|
||||||
"syncStatus": "Sync Status",
|
|
||||||
"deleted": "Deleted"
|
|
||||||
},
|
|
||||||
"links": {
|
|
||||||
"cAICollection": "AI Collection",
|
|
||||||
"cDokumente": "Document"
|
|
||||||
},
|
|
||||||
"options": {
|
|
||||||
"syncStatus": {
|
|
||||||
"new": "New",
|
|
||||||
"changed": "Changed",
|
|
||||||
"synced": "Synced",
|
|
||||||
"deleted": "Deleted"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tooltips": {
|
|
||||||
"xaifileid": "External XAI file ID for this document",
|
|
||||||
"syncStatus": "Synchronization status with XAI"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
{
|
|
||||||
"labels": {
|
|
||||||
"Create CAIKnowledgeCDokumente": "Create AI Knowledge-Document Link",
|
|
||||||
"CAIKnowledgeCDokumente": "AI Knowledge-Document Link"
|
|
||||||
},
|
|
||||||
"fields": {
|
|
||||||
"cAIKnowledge": "AI Knowledge",
|
|
||||||
"cAIKnowledgeId": "AI Knowledge ID",
|
|
||||||
"cDokumente": "Document",
|
|
||||||
"cDokumenteId": "Document ID",
|
|
||||||
"aiDocumentId": "AI Document ID",
|
|
||||||
"syncstatus": "Sync Status",
|
|
||||||
"lastSync": "Last Synchronization",
|
|
||||||
"syncedHash": "Sync Hash"
|
|
||||||
},
|
|
||||||
"options": {
|
|
||||||
"syncstatus": {
|
|
||||||
"new": "New",
|
|
||||||
"unclean": "Unclean",
|
|
||||||
"synced": "Synced",
|
|
||||||
"failed": "Failed",
|
|
||||||
"unsupported": "Unsupported"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tooltips": {
|
|
||||||
"aiDocumentId": "External AI document reference ID",
|
|
||||||
"syncstatus": "Synchronization status with external AI system",
|
|
||||||
"lastSync": "Timestamp of the last successful synchronization",
|
|
||||||
"syncedHash": "Hash value of the last synchronized document state (for change detection)"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"fields": {
|
||||||
|
"cAIKnowledge": "AI Knowledge",
|
||||||
|
"cDokumente": "Document",
|
||||||
|
"aiDocumentId": "AI Document ID",
|
||||||
|
"syncstatus": "Sync Status",
|
||||||
|
"lastSync": "Last Sync",
|
||||||
|
"syncedHash": "Synced Hash"
|
||||||
|
},
|
||||||
|
"links": {
|
||||||
|
"cAIKnowledge": "AI Knowledge",
|
||||||
|
"cDokumente": "Document"
|
||||||
|
},
|
||||||
|
"labels": {
|
||||||
|
"Create CAIKnowledgeCDokumente": "Create Link"
|
||||||
|
},
|
||||||
|
"options": {
|
||||||
|
"syncstatus": {
|
||||||
|
"new": "New",
|
||||||
|
"unclean": "Changed",
|
||||||
|
"synced": "Synced",
|
||||||
|
"failed": "Failed",
|
||||||
|
"unsupported": "Unsupported"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tooltips": {
|
||||||
|
"aiDocumentId": "External AI document reference ID",
|
||||||
|
"syncedHash": "Hash value of last synced document state"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,21 +1,17 @@
|
|||||||
{
|
{
|
||||||
"fields": {
|
"fields": {
|
||||||
"dokument": "Download",
|
"dokument": "Download",
|
||||||
"ydocumentuuid": "Y-Document-UUID",
|
|
||||||
"preview": "Preview",
|
"preview": "Preview",
|
||||||
"contactsvmhdokumente": "Portal Users",
|
"contactsvmhdokumente": "Portal Users",
|
||||||
"vmhMietverhltnisesDokumente": "Tenancies",
|
"vmhMietverhltnisesDokumente": "Tenancies",
|
||||||
"vmhErstgespraechsdokumente": "Initial Consultations",
|
"vmhErstgespraechsdokumente": "Initial Consultations",
|
||||||
"vmhRumungsklagesdokumente": "Eviction Lawsuits",
|
"vmhRumungsklagesdokumente": "Eviction Lawsuits",
|
||||||
"kuendigungDokumente": "Terminations",
|
"kuendigungDokumente": "Terminations",
|
||||||
"md5sum": "MD5 Checksum",
|
"blake3hash": "Blake3 Hash",
|
||||||
"sha256": "SHA256 Checksum",
|
|
||||||
"beteiligte2dokumente": "Parties",
|
"beteiligte2dokumente": "Parties",
|
||||||
"mietobjekt2dokumente": "Properties",
|
"mietobjekt2dokumente": "Properties",
|
||||||
"mietinkassosdokumente": "Rent Collection",
|
"mietinkassosdokumente": "Rent Collection",
|
||||||
"kndigungensdokumente": "Terminations",
|
"kndigungensdokumente": "Terminations",
|
||||||
"fileStatus": "File Status",
|
|
||||||
"advowareAktens": "Advoware Akten",
|
|
||||||
"advowareAktens": "Advoware Akten",
|
"advowareAktens": "Advoware Akten",
|
||||||
"aIKnowledges": "AI Knowledge",
|
"aIKnowledges": "AI Knowledge",
|
||||||
"advowareAktenHnr": "Advoware HNR",
|
"advowareAktenHnr": "Advoware HNR",
|
||||||
@@ -47,13 +43,6 @@
|
|||||||
"listForAIKnowledge": "List for AI Knowledge"
|
"listForAIKnowledge": "List for AI Knowledge"
|
||||||
},
|
},
|
||||||
"tooltips": {
|
"tooltips": {
|
||||||
"fileStatus": "File status: new = newly uploaded, changed = modified, synced = synchronized"
|
"blake3hash": "Cryptographic Blake3 hash of the file (faster and more secure than MD5/SHA256)"
|
||||||
},
|
|
||||||
"options": {
|
|
||||||
"fileStatus": {
|
|
||||||
"new": "New",
|
|
||||||
"changed": "Changed",
|
|
||||||
"synced": "Synchronized"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -10,6 +10,9 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
{
|
||||||
|
"name": "aktivierungsstatus"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "syncStatus"
|
"name": "syncStatus"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -40,9 +40,8 @@
|
|||||||
"rows": [
|
"rows": [
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name": "ydocumentuuid"
|
"name": "blake3hash"
|
||||||
},
|
}
|
||||||
{}
|
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
"dynamicLogicVisible": null,
|
"dynamicLogicVisible": null,
|
||||||
@@ -52,77 +51,6 @@
|
|||||||
"hidden": false,
|
"hidden": false,
|
||||||
"noteText": null,
|
"noteText": null,
|
||||||
"noteStyle": "info",
|
"noteStyle": "info",
|
||||||
"customLabel": "Externe Identifikatoren"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"rows": [
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"name": "fileStatus"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "md5sum"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"name": "sha256"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
],
|
|
||||||
"dynamicLogicVisible": null,
|
|
||||||
"style": "default",
|
|
||||||
"tabBreak": false,
|
|
||||||
"tabLabel": null,
|
|
||||||
"hidden": false,
|
|
||||||
"noteText": null,
|
|
||||||
"noteStyle": "info",
|
|
||||||
"customLabel": "Technische Daten"
|
"customLabel": "Technische Daten"
|
||||||
},
|
|
||||||
{
|
|
||||||
"rows": [
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"name": "aktennr"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "syncStatus"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "advowareLastSync"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
],
|
|
||||||
"dynamicLogicVisible": null,
|
|
||||||
"style": "default",
|
|
||||||
"tabBreak": false,
|
|
||||||
"tabLabel": null,
|
|
||||||
"hidden": false,
|
|
||||||
"noteText": null,
|
|
||||||
"noteStyle": "info",
|
|
||||||
"customLabel": "Advoware Sync"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"rows": [
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"name": "xaiId"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "xaiCollections"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "xaiSyncStatus"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
],
|
|
||||||
"dynamicLogicVisible": null,
|
|
||||||
"style": "default",
|
|
||||||
"tabBreak": false,
|
|
||||||
"tabLabel": null,
|
|
||||||
"hidden": false,
|
|
||||||
"noteText": null,
|
|
||||||
"noteStyle": "info",
|
|
||||||
"customLabel": "x.AI Sync"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -9,6 +9,21 @@
|
|||||||
"route": "/CPuls/:id/abschliessen-fuer-team",
|
"route": "/CPuls/:id/abschliessen-fuer-team",
|
||||||
"method": "post",
|
"method": "post",
|
||||||
"actionClassName": "Espo\\Custom\\Api\\CPuls\\AbschliessenFuerTeam"
|
"actionClassName": "Espo\\Custom\\Api\\CPuls\\AbschliessenFuerTeam"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"route": "/JunctionData/CAIKnowledge/:knowledgeId/dokumentes",
|
||||||
|
"method": "get",
|
||||||
|
"actionClassName": "Espo\\Custom\\Api\\JunctionData\\GetDokumentes"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"route": "/JunctionData/CAIKnowledge/:knowledgeId/dokumentes/:documentId",
|
||||||
|
"method": "put",
|
||||||
|
"actionClassName": "Espo\\Custom\\Api\\JunctionData\\UpdateJunction"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"route": "/JunctionData/CAIKnowledge/:knowledgeId/dokumentes/:documentId",
|
||||||
|
"method": "post",
|
||||||
|
"actionClassName": "Espo\\Custom\\Api\\JunctionData\\LinkDokument"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,87 +0,0 @@
|
|||||||
{
|
|
||||||
"fields": {
|
|
||||||
"id": {
|
|
||||||
"type": "id",
|
|
||||||
"dbType": "bigint",
|
|
||||||
"autoincrement": true
|
|
||||||
},
|
|
||||||
"cAICollection": {
|
|
||||||
"type": "link"
|
|
||||||
},
|
|
||||||
"cAICollectionId": {
|
|
||||||
"type": "varchar",
|
|
||||||
"len": 17,
|
|
||||||
"index": true
|
|
||||||
},
|
|
||||||
"cDokumente": {
|
|
||||||
"type": "link"
|
|
||||||
},
|
|
||||||
"cDokumenteId": {
|
|
||||||
"type": "varchar",
|
|
||||||
"len": 17,
|
|
||||||
"index": true
|
|
||||||
},
|
|
||||||
"xaifileid": {
|
|
||||||
"type": "varchar",
|
|
||||||
"len": 255,
|
|
||||||
"isCustom": true,
|
|
||||||
"tooltip": true,
|
|
||||||
"copyToClipboard": true
|
|
||||||
},
|
|
||||||
"syncStatus": {
|
|
||||||
"type": "enum",
|
|
||||||
"required": false,
|
|
||||||
"options": [
|
|
||||||
"new",
|
|
||||||
"changed",
|
|
||||||
"synced",
|
|
||||||
"deleted"
|
|
||||||
],
|
|
||||||
"style": {
|
|
||||||
"new": "info",
|
|
||||||
"changed": "warning",
|
|
||||||
"synced": "success",
|
|
||||||
"deleted": "danger"
|
|
||||||
},
|
|
||||||
"default": "new",
|
|
||||||
"isCustom": true,
|
|
||||||
"tooltip": true
|
|
||||||
},
|
|
||||||
"deleted": {
|
|
||||||
"type": "bool",
|
|
||||||
"default": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"links": {
|
|
||||||
"cAICollection": {
|
|
||||||
"type": "belongsTo",
|
|
||||||
"entity": "CAICollection"
|
|
||||||
},
|
|
||||||
"cDokumente": {
|
|
||||||
"type": "belongsTo",
|
|
||||||
"entity": "CDokumente"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"collection": {
|
|
||||||
"orderBy": "id",
|
|
||||||
"order": "desc"
|
|
||||||
},
|
|
||||||
"indexes": {
|
|
||||||
"cAICollectionId": {
|
|
||||||
"columns": ["cAICollectionId"]
|
|
||||||
},
|
|
||||||
"cDokumenteId": {
|
|
||||||
"columns": ["cDokumenteId"]
|
|
||||||
},
|
|
||||||
"xaifileid": {
|
|
||||||
"columns": ["xaifileid"]
|
|
||||||
},
|
|
||||||
"syncStatus": {
|
|
||||||
"columns": ["syncStatus"]
|
|
||||||
},
|
|
||||||
"uniqueRelation": {
|
|
||||||
"type": "unique",
|
|
||||||
"columns": ["cAICollectionId", "cDokumenteId", "deleted"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"table": "c_a_i_knowledge_dokumente",
|
||||||
"fields": {
|
"fields": {
|
||||||
"id": {
|
"id": {
|
||||||
"type": "id",
|
"type": "id",
|
||||||
@@ -6,58 +7,58 @@
|
|||||||
"autoincrement": true
|
"autoincrement": true
|
||||||
},
|
},
|
||||||
"cAIKnowledge": {
|
"cAIKnowledge": {
|
||||||
"type": "link"
|
"type": "link",
|
||||||
|
"entity": "CAIKnowledge"
|
||||||
},
|
},
|
||||||
"cAIKnowledgeId": {
|
"cAIKnowledgeId": {
|
||||||
"type": "varchar",
|
"type": "varchar",
|
||||||
"len": 17,
|
"len": 17,
|
||||||
"index": true
|
"index": true
|
||||||
},
|
},
|
||||||
|
"cAIKnowledgeName": {
|
||||||
|
"type": "varchar",
|
||||||
|
"notStorable": true,
|
||||||
|
"relation": "cAIKnowledge",
|
||||||
|
"foreign": "name"
|
||||||
|
},
|
||||||
"cDokumente": {
|
"cDokumente": {
|
||||||
"type": "link"
|
"type": "link",
|
||||||
|
"entity": "CDokumente"
|
||||||
},
|
},
|
||||||
"cDokumenteId": {
|
"cDokumenteId": {
|
||||||
"type": "varchar",
|
"type": "varchar",
|
||||||
"len": 17,
|
"len": 17,
|
||||||
"index": true
|
"index": true
|
||||||
},
|
},
|
||||||
|
"cDokumenteName": {
|
||||||
|
"type": "varchar",
|
||||||
|
"notStorable": true,
|
||||||
|
"relation": "cDokumente",
|
||||||
|
"foreign": "name"
|
||||||
|
},
|
||||||
"aiDocumentId": {
|
"aiDocumentId": {
|
||||||
"type": "varchar",
|
"type": "varchar",
|
||||||
"len": 255,
|
"len": 255,
|
||||||
"isCustom": true,
|
|
||||||
"tooltip": true
|
"tooltip": true
|
||||||
},
|
},
|
||||||
"syncstatus": {
|
"syncstatus": {
|
||||||
"type": "enum",
|
"type": "enum",
|
||||||
"required": false,
|
"options": ["new", "unclean", "synced", "failed", "unsupported"],
|
||||||
"options": [
|
"default": "new",
|
||||||
"new",
|
|
||||||
"unclean",
|
|
||||||
"synced",
|
|
||||||
"failed",
|
|
||||||
"unsupported"
|
|
||||||
],
|
|
||||||
"style": {
|
"style": {
|
||||||
"new": "info",
|
"new": "primary",
|
||||||
"unclean": "warning",
|
"unclean": "warning",
|
||||||
"synced": "success",
|
"synced": "success",
|
||||||
"failed": "danger",
|
"failed": "danger",
|
||||||
"unsupported": "default"
|
"unsupported": "default"
|
||||||
},
|
}
|
||||||
"default": "new",
|
|
||||||
"isCustom": true,
|
|
||||||
"tooltip": true
|
|
||||||
},
|
},
|
||||||
"lastSync": {
|
"lastSync": {
|
||||||
"type": "datetime",
|
"type": "datetime"
|
||||||
"required": false,
|
|
||||||
"isCustom": true,
|
|
||||||
"tooltip": true
|
|
||||||
},
|
},
|
||||||
"syncedHash": {
|
"syncedHash": {
|
||||||
"type": "varchar",
|
"type": "varchar",
|
||||||
"len": 64,
|
"len": 64,
|
||||||
"isCustom": true,
|
|
||||||
"tooltip": true
|
"tooltip": true
|
||||||
},
|
},
|
||||||
"deleted": {
|
"deleted": {
|
||||||
@@ -68,30 +69,17 @@
|
|||||||
"links": {
|
"links": {
|
||||||
"cAIKnowledge": {
|
"cAIKnowledge": {
|
||||||
"type": "belongsTo",
|
"type": "belongsTo",
|
||||||
"entity": "CAIKnowledge"
|
"entity": "CAIKnowledge",
|
||||||
|
"foreign": "dokumentes"
|
||||||
},
|
},
|
||||||
"cDokumente": {
|
"cDokumente": {
|
||||||
"type": "belongsTo",
|
"type": "belongsTo",
|
||||||
"entity": "CDokumente"
|
"entity": "CDokumente",
|
||||||
|
"foreign": "aIKnowledges"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"collection": {
|
"collection": {
|
||||||
"orderBy": "id",
|
"orderBy": "id",
|
||||||
"order": "desc"
|
"order": "asc"
|
||||||
},
|
|
||||||
"indexes": {
|
|
||||||
"cAIKnowledgeId": {
|
|
||||||
"columns": ["cAIKnowledgeId"]
|
|
||||||
},
|
|
||||||
"cDokumenteId": {
|
|
||||||
"columns": ["cDokumenteId"]
|
|
||||||
},
|
|
||||||
"syncstatus": {
|
|
||||||
"columns": ["syncstatus"]
|
|
||||||
},
|
|
||||||
"uniqueRelation": {
|
|
||||||
"type": "unique",
|
|
||||||
"columns": ["cAIKnowledgeId", "cDokumenteId", "deleted"]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -45,13 +45,6 @@
|
|||||||
"isCustom": true,
|
"isCustom": true,
|
||||||
"audited": true
|
"audited": true
|
||||||
},
|
},
|
||||||
"ydocumentuuid": {
|
|
||||||
"type": "varchar",
|
|
||||||
"maxLength": 100,
|
|
||||||
"readOnlyAfterCreate": true,
|
|
||||||
"options": [],
|
|
||||||
"isCustom": true
|
|
||||||
},
|
|
||||||
"preview": {
|
"preview": {
|
||||||
"type": "image",
|
"type": "image",
|
||||||
"previewSize": "medium",
|
"previewSize": "medium",
|
||||||
@@ -59,80 +52,67 @@
|
|||||||
"readOnlyAfterCreate": false,
|
"readOnlyAfterCreate": false,
|
||||||
"isCustom": true
|
"isCustom": true
|
||||||
},
|
},
|
||||||
"md5sum": {
|
"blake3hash": {
|
||||||
"type": "varchar",
|
|
||||||
"maxLength": 32,
|
|
||||||
"copyToClipboard": true,
|
|
||||||
"readOnlyAfterCreate": true,
|
|
||||||
"options": [],
|
|
||||||
"isCustom": true
|
|
||||||
},
|
|
||||||
"sha256": {
|
|
||||||
"type": "varchar",
|
"type": "varchar",
|
||||||
"maxLength": 64,
|
"maxLength": 64,
|
||||||
"readOnlyAfterCreate": true,
|
"copyToClipboard": true,
|
||||||
|
"readOnlyAfterCreate": false,
|
||||||
"options": [],
|
"options": [],
|
||||||
"isCustom": true,
|
"isCustom": true,
|
||||||
"copyToClipboard": true
|
"tooltip": true
|
||||||
},
|
},
|
||||||
"puls": {
|
"puls": {
|
||||||
"type": "link",
|
"type": "link",
|
||||||
"entity": "CPuls",
|
"entity": "CPuls",
|
||||||
"isCustom": true
|
"isCustom": true
|
||||||
},
|
},
|
||||||
"fileStatus": {
|
|
||||||
"type": "enum",
|
|
||||||
"required": false,
|
|
||||||
"options": [
|
|
||||||
"new",
|
|
||||||
"changed",
|
|
||||||
"synced"
|
|
||||||
],
|
|
||||||
"style": {
|
|
||||||
"new": "info",
|
|
||||||
"changed": "warning",
|
|
||||||
"synced": "success"
|
|
||||||
},
|
|
||||||
"default": "new",
|
|
||||||
"readOnly": false,
|
|
||||||
"tooltip": true,
|
|
||||||
"isCustom": true
|
|
||||||
},
|
|
||||||
"advowareAktenHnr": {
|
"advowareAktenHnr": {
|
||||||
"type": "int",
|
"type": "int",
|
||||||
"notStorable": true,
|
"notStorable": true,
|
||||||
"utility": true,
|
"utility": true,
|
||||||
"layoutAvailabilityList": ["listForAdvowareAkten"]
|
"layoutAvailabilityList": [
|
||||||
|
"listForAdvowareAkten"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"advowareAktenSyncstatus": {
|
"advowareAktenSyncstatus": {
|
||||||
"type": "varchar",
|
"type": "varchar",
|
||||||
"notStorable": true,
|
"notStorable": true,
|
||||||
"utility": true,
|
"utility": true,
|
||||||
"layoutAvailabilityList": ["listForAdvowareAkten"]
|
"layoutAvailabilityList": [
|
||||||
|
"listForAdvowareAkten"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"advowareAktenLastSync": {
|
"advowareAktenLastSync": {
|
||||||
"type": "datetime",
|
"type": "datetime",
|
||||||
"notStorable": true,
|
"notStorable": true,
|
||||||
"utility": true,
|
"utility": true,
|
||||||
"layoutAvailabilityList": ["listForAdvowareAkten"]
|
"layoutAvailabilityList": [
|
||||||
|
"listForAdvowareAkten"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"aiKnowledgeAiDocumentId": {
|
"aiKnowledgeAiDocumentId": {
|
||||||
"type": "varchar",
|
"type": "varchar",
|
||||||
"notStorable": true,
|
"notStorable": true,
|
||||||
"utility": true,
|
"utility": true,
|
||||||
"layoutAvailabilityList": ["listForAIKnowledge"]
|
"layoutAvailabilityList": [
|
||||||
|
"listForAIKnowledge"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"aiKnowledgeSyncstatus": {
|
"aiKnowledgeSyncstatus": {
|
||||||
"type": "varchar",
|
"type": "varchar",
|
||||||
"notStorable": true,
|
"notStorable": true,
|
||||||
"utility": true,
|
"utility": true,
|
||||||
"layoutAvailabilityList": ["listForAIKnowledge"]
|
"layoutAvailabilityList": [
|
||||||
|
"listForAIKnowledge"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"aiKnowledgeLastSync": {
|
"aiKnowledgeLastSync": {
|
||||||
"type": "datetime",
|
"type": "datetime",
|
||||||
"notStorable": true,
|
"notStorable": true,
|
||||||
"utility": true,
|
"utility": true,
|
||||||
"layoutAvailabilityList": ["listForAIKnowledge"]
|
"layoutAvailabilityList": [
|
||||||
|
"listForAIKnowledge"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"links": {
|
"links": {
|
||||||
@@ -298,14 +278,9 @@
|
|||||||
"id"
|
"id"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"md5sum": {
|
"blake3hash": {
|
||||||
"columns": [
|
"columns": [
|
||||||
"md5sum"
|
"blake3hash"
|
||||||
]
|
|
||||||
},
|
|
||||||
"sha256": {
|
|
||||||
"columns": [
|
|
||||||
"sha256"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"beforeSaveScript": "// Automatische x.AI Sync-Status Verwaltung\n\n// Fall 1: xaiId wurde gelöscht (war vorher vorhanden, jetzt leer)\nif (\n attribute\\fetched('xaiId') != null &&\n xaiId == null\n) {\n xaiSyncStatus = 'no_sync';\n}\n// Fall 2: xaiId wird neu gesetzt (war vorher leer, jetzt gefüllt)\nelse if (\n attribute\\fetched('xaiId') == null &&\n xaiId != null\n) {\n xaiSyncStatus = 'pending_sync';\n}\n// Fall 3: Dokument hat xaiId und relevante Felder haben sich geändert\nelse if (\n xaiId != null &&\n xaiSyncStatus != 'no_sync' &&\n (\n attribute\\isChanged('name') ||\n attribute\\isChanged('description') ||\n attribute\\isChanged('dokumentId') ||\n attribute\\isChanged('md5sum') ||\n attribute\\isChanged('sha256')\n )\n) {\n xaiSyncStatus = 'unclean';\n}\n// Fall 4: Bei neuem Dokument MIT xaiId → pending_sync\nelse if (\n entity\\isNew() &&\n xaiId != null\n) {\n xaiSyncStatus = 'pending_sync';\n}\n// Fall 5: Bei neuem Dokument OHNE xaiId → no_sync\nelse if (\n entity\\isNew() &&\n xaiId == null\n) {\n xaiSyncStatus = 'no_sync';\n}\n\n// Automatische Advoware Sync-Status Verwaltung\n\n// Fall 1: aktennr wurde gelöscht (war vorher vorhanden, jetzt leer)\nif (\n attribute\\fetched('aktennr') != null &&\n aktennr == null\n) {\n syncStatus = 'no_sync';\n}\n// Fall 2: aktennr wird neu gesetzt (war vorher leer, jetzt gefüllt)\nelse if (\n attribute\\fetched('aktennr') == null &&\n aktennr != null\n) {\n syncStatus = 'pending_sync';\n}\n// Fall 3: Dokument hat aktennr und relevante Felder haben sich geändert\nelse if (\n aktennr != null &&\n syncStatus != 'no_sync' &&\n (\n attribute\\isChanged('name') ||\n attribute\\isChanged('description') ||\n attribute\\isChanged('dokumentId') ||\n attribute\\isChanged('md5sum') ||\n attribute\\isChanged('sha256')\n )\n) {\n syncStatus = 'unclean';\n}\n// Fall 4: Bei neuem Dokument MIT aktennr → pending_sync\nelse if (\n entity\\isNew() &&\n aktennr != null\n) {\n syncStatus = 'pending_sync';\n}\n// Fall 5: Bei neuem Dokument OHNE aktennr → no_sync\nelse if (\n entity\\isNew() &&\n aktennr == null\n) {\n syncStatus = 'no_sync';\n}"
|
"beforeSaveScript": "// Automatische x.AI Sync-Status Verwaltung\n\n// Fall 1: xaiId wurde gelöscht (war vorher vorhanden, jetzt leer)\nif (\n attribute\\fetched('xaiId') != null &&\n xaiId == null\n) {\n xaiSyncStatus = 'no_sync';\n}\n// Fall 2: xaiId wird neu gesetzt (war vorher leer, jetzt gefüllt)\nelse if (\n attribute\\fetched('xaiId') == null &&\n xaiId != null\n) {\n xaiSyncStatus = 'pending_sync';\n}\n// Fall 3: Dokument hat xaiId und relevante Felder haben sich geändert\nelse if (\n xaiId != null &&\n xaiSyncStatus != 'no_sync' &&\n (\n attribute\\isChanged('name') ||\n attribute\\isChanged('description') ||\n attribute\\isChanged('dokumentId') ||\n attribute\\isChanged('blake3hash')\n )\n) {\n xaiSyncStatus = 'unclean';\n}\n// Fall 4: Bei neuem Dokument MIT xaiId → pending_sync\nelse if (\n entity\\isNew() &&\n xaiId != null\n) {\n xaiSyncStatus = 'pending_sync';\n}\n// Fall 5: Bei neuem Dokument OHNE xaiId → no_sync\nelse if (\n entity\\isNew() &&\n xaiId == null\n) {\n xaiSyncStatus = 'no_sync';\n}\n\n// Automatische Advoware Sync-Status Verwaltung\n\n// Fall 1: aktennr wurde gelöscht (war vorher vorhanden, jetzt leer)\nif (\n attribute\\fetched('aktennr') != null &&\n aktennr == null\n) {\n syncStatus = 'no_sync';\n}\n// Fall 2: aktennr wird neu gesetzt (war vorher leer, jetzt gefüllt)\nelse if (\n attribute\\fetched('aktennr') == null &&\n aktennr != null\n) {\n syncStatus = 'pending_sync';\n}\n// Fall 3: Dokument hat aktennr und relevante Felder haben sich geändert\nelse if (\n aktennr != null &&\n syncStatus != 'no_sync' &&\n (\n attribute\\isChanged('name') ||\n attribute\\isChanged('description') ||\n attribute\\isChanged('dokumentId') ||\n attribute\\isChanged('blake3hash')\n )\n) {\n syncStatus = 'unclean';\n}\n// Fall 4: Bei neuem Dokument MIT aktennr → pending_sync\nelse if (\n entity\\isNew() &&\n aktennr != null\n) {\n syncStatus = 'pending_sync';\n}\n// Fall 5: Bei neuem Dokument OHNE aktennr → no_sync\nelse if (\n entity\\isNew() &&\n aktennr == null\n) {\n syncStatus = 'no_sync';\n}"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"entity": true,
|
|
||||||
"type": "Base",
|
|
||||||
"module": "Custom",
|
|
||||||
"object": true,
|
|
||||||
"isCustom": true,
|
|
||||||
"tab": false,
|
|
||||||
"acl": true,
|
|
||||||
"disabled": false
|
|
||||||
}
|
|
||||||
@@ -1,10 +1,11 @@
|
|||||||
{
|
{
|
||||||
"entity": true,
|
"entity": true,
|
||||||
"type": "Base",
|
"object": false,
|
||||||
"module": "Custom",
|
"layouts": false,
|
||||||
"object": true,
|
|
||||||
"isCustom": true,
|
|
||||||
"tab": false,
|
"tab": false,
|
||||||
"acl": true,
|
"acl": true,
|
||||||
"disabled": false
|
"customizable": false,
|
||||||
|
"type": "Base",
|
||||||
|
"module": "Custom",
|
||||||
|
"isCustom": true
|
||||||
}
|
}
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
"notifications": true,
|
"notifications": true,
|
||||||
"stream": true,
|
"stream": true,
|
||||||
"disabled": false,
|
"disabled": false,
|
||||||
"type": "BasePlus",
|
"type": "Base",
|
||||||
"module": "Custom",
|
"module": "Custom",
|
||||||
"object": true,
|
"object": true,
|
||||||
"isCustom": true,
|
"isCustom": true,
|
||||||
|
|||||||
17
custom/Espo/Custom/Resources/routes.json
Normal file
17
custom/Espo/Custom/Resources/routes.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"route": "/JunctionData/CAIKnowledge/:knowledgeId/dokumentes",
|
||||||
|
"method": "get",
|
||||||
|
"actionClassName": "Espo\\Custom\\Api\\JunctionData\\GetDokumentes"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"route": "/JunctionData/CAIKnowledge/:knowledgeId/dokumentes/:documentId",
|
||||||
|
"method": "put",
|
||||||
|
"actionClassName": "Espo\\Custom\\Api\\JunctionData\\UpdateJunction"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"route": "/JunctionData/CAIKnowledge/:knowledgeId/dokumentes/:documentId",
|
||||||
|
"method": "post",
|
||||||
|
"actionClassName": "Espo\\Custom\\Api\\JunctionData\\LinkDokument"
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
<?php
|
|
||||||
namespace Espo\Custom\Services;
|
|
||||||
|
|
||||||
use Espo\Services\Record;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Junction Service: CAICollection ↔ CDokumente
|
|
||||||
*
|
|
||||||
* Handles business logic for the junction table.
|
|
||||||
*/
|
|
||||||
class CAICollectionCDokumente extends Record
|
|
||||||
{
|
|
||||||
// Standard CRUD logic inherited from Record service
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
<?php
|
|
||||||
namespace Espo\Custom\Services;
|
|
||||||
|
|
||||||
use Espo\Services\Record;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Junction Service: CAIKnowledge ↔ CDokumente
|
|
||||||
*
|
|
||||||
* Handles business logic for the junction table.
|
|
||||||
*/
|
|
||||||
class CAIKnowledgeCDokumente extends Record
|
|
||||||
{
|
|
||||||
// Standard CRUD logic inherited from Record service
|
|
||||||
}
|
|
||||||
87
custom/scripts/install_blake3.sh
Executable file
87
custom/scripts/install_blake3.sh
Executable file
@@ -0,0 +1,87 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Blake3 PHP Extension Installation Script
|
||||||
|
# Für EspoCRM Docker Container
|
||||||
|
|
||||||
|
set -e # Beende bei Fehler
|
||||||
|
|
||||||
|
echo "========================================="
|
||||||
|
echo "Blake3 PHP Extension Installation"
|
||||||
|
echo "========================================="
|
||||||
|
|
||||||
|
# Schritt 1: Build-Tools installieren
|
||||||
|
echo ""
|
||||||
|
echo "Schritt 1: Installiere Build-Tools..."
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y \
|
||||||
|
git \
|
||||||
|
build-essential \
|
||||||
|
autoconf \
|
||||||
|
automake \
|
||||||
|
libtool \
|
||||||
|
pkg-config \
|
||||||
|
curl \
|
||||||
|
libcurl4-openssl-dev
|
||||||
|
|
||||||
|
# PHP-Dev ist bereits im Image vorhanden
|
||||||
|
echo "PHP Development headers: $(php-config --version)"
|
||||||
|
|
||||||
|
# Schritt 2: Blake3 C-Bibliothek klonen
|
||||||
|
echo ""
|
||||||
|
echo "Schritt 2: Lade Blake3 C-Bibliothek..."
|
||||||
|
cd /tmp
|
||||||
|
rm -rf BLAKE3 php-blake3
|
||||||
|
git clone https://github.com/BLAKE3-team/BLAKE3.git
|
||||||
|
cd BLAKE3/c
|
||||||
|
gcc -shared -O3 -o libblake3.so blake3.c blake3_dispatch.c blake3_portable.c blake3_sse2_x86-64_unix.S blake3_sse41_x86-64_unix.S blake3_avx2_x86-64_unix.S blake3_avx512_x86-64_unix.S -fPIC
|
||||||
|
cp libblake3.so /usr/local/lib/
|
||||||
|
ldconfig
|
||||||
|
|
||||||
|
# Schritt 3: PHP Blake3 Extension klonen und kompilieren
|
||||||
|
echo ""
|
||||||
|
echo "Schritt 3: Kompiliere PHP Blake3 Extension..."
|
||||||
|
cd /tmp
|
||||||
|
git clone https://github.com/cypherbits/php-blake3.git
|
||||||
|
cd php-blake3
|
||||||
|
|
||||||
|
phpize
|
||||||
|
./configure
|
||||||
|
make
|
||||||
|
make install
|
||||||
|
|
||||||
|
# Schritt 4: Extension aktivieren
|
||||||
|
echo ""
|
||||||
|
echo "Schritt 4: Aktiviere Blake3 Extension..."
|
||||||
|
PHP_INI_DIR=$(php -i | grep "Scan this dir for additional .ini files" | cut -d'>' -f2 | xargs)
|
||||||
|
if [ -z "$PHP_INI_DIR" ]; then
|
||||||
|
PHP_INI_DIR="/usr/local/etc/php/conf.d"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "extension=blake3.so" > ${PHP_INI_DIR}/99-blake3.ini
|
||||||
|
|
||||||
|
# Schritt 5: Verifizierung
|
||||||
|
echo ""
|
||||||
|
echo "Schritt 5: Verifiziere Installation..."
|
||||||
|
php -m | grep -i blake3
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "✅ Blake3 Extension erfolgreich installiert!"
|
||||||
|
php -r "echo 'Test Hash: ' . hash('blake3', 'test') . PHP_EOL;"
|
||||||
|
else
|
||||||
|
echo "❌ Blake3 Extension nicht geladen!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
echo ""
|
||||||
|
echo "Schritt 6: Aufräumen..."
|
||||||
|
cd /
|
||||||
|
rm -rf /tmp/BLAKE3 /tmp/php-blake3
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "========================================="
|
||||||
|
echo "✅ Installation abgeschlossen!"
|
||||||
|
echo "========================================="
|
||||||
|
echo ""
|
||||||
|
echo "Nächste Schritte:"
|
||||||
|
echo "1. Starte PHP-FPM neu: service php8.4-fpm restart || pkill -USR2 php-fpm"
|
||||||
|
echo "2. Überprüfe: php -m | grep blake3"
|
||||||
|
echo "3. Teste: php -r \"echo hash('blake3', 'test');\""
|
||||||
@@ -360,7 +360,7 @@ return [
|
|||||||
0 => 'youtube.com',
|
0 => 'youtube.com',
|
||||||
1 => 'google.com'
|
1 => 'google.com'
|
||||||
],
|
],
|
||||||
'microtime' => 1773262547.930204,
|
'microtime' => 1773351315.93688,
|
||||||
'siteUrl' => 'https://crm.bitbylaw.com',
|
'siteUrl' => 'https://crm.bitbylaw.com',
|
||||||
'fullTextSearchMinLength' => 4,
|
'fullTextSearchMinLength' => 4,
|
||||||
'webSocketUrl' => 'ws://api.bitbylaw.com:5000/espocrm/ws',
|
'webSocketUrl' => 'ws://api.bitbylaw.com:5000/espocrm/ws',
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
return [
|
return [
|
||||||
'cacheTimestamp' => 1773262548,
|
'cacheTimestamp' => 1773351316,
|
||||||
'microtimeState' => 1773262548.062426,
|
'microtimeState' => 1773351316.064287,
|
||||||
'currencyRates' => [
|
'currencyRates' => [
|
||||||
'EUR' => 1.0
|
'EUR' => 1.0
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user