Outside of the K-Box
inside the K-Box
Drag and drop via Form upload or Resumable Upload Protocol
protected $actions = [
Actions\ExtractFileProperties::class,
Actions\GuessLanguage::class,
Actions\AddToSearch::class,
Actions\GenerateThumbnail::class,
Actions\ElaborateVideo::class,
];
github.com/k-box/k-box/blob/master/app/DocumentsElaboration/Kernel.php
Identify in which language a document is written
186 languages recognized
https://github.com/wooorm/francDelivering video to the browser
We Open Source a command line tool
it uses FFmpeg and Shaka Packager
it is written in Javascript and packaged as a cross platform binary
github.com/OneOffTech/video-processing-cli/defines the data that can be searchable
intermediates between the full text search and the clients/components
connect the metadat of the api with the content of the files configuration
"repositories": [
{
"type": "vcs",
"url": "https://git.klink.asia/main/k-search-client-php.git"
}
],
"k-box/k-search-client-php": "3.0.*",
"php-http/guzzle6-adapter": "^1.1",
"guzzlehttp/guzzle": "~6.2.0",
"ramsey/uuid": "^3.7",
return hash_file( 'sha512', $filePath );
return hash( 'sha512', $content );
use Carbon\Carbon;
use Ramsey\Uuid\Uuid;
use KSearchClient\Client;
use KSearchClient\Model\Data\Data;
use KSearchClient\Model\Data\Author;
use KSearchClient\Model\Data\Uploader;
use KSearchClient\Http\Authentication;
use KSearchClient\Model\Data\Copyright;
use KSearchClient\Model\Data\Properties;
use KSearchClient\Model\Data\CopyrightOwner;
use KSearchClient\Model\Data\CopyrightUsage;
const KSEARCH_URL = 'http://localhost:8181/';
const APP_URL = 'http://localhost:9000/data/';
const THUMBNAILS_URL = 'http://localhost:9000/thumbnails/';
const APP_TOKEN = 'A_MORE_SECURE_TOKEN';
require_once __DIR__ . '/to_data.php';
$client = Client::build(KSEARCH_URL, new Authentication(APP_TOKEN, APP_URL));
$result = $client->add($data, 'Water improved knowledge management');
$hash = KlinkDocumentUtils::generateDocumentHash($file);
$uuid = Uuid::uuid4()->toString();
$data = new Data();
$data->hash = $hash;
$data->type = 'document';
$data->url = APP_URL . $title;
$data->uuid = $uuid;
$author = new Author();
$author->name = 'Alessio';
$author->email = 'alessio@oneofftech.xyz';
$data->authors = [$author];
$uploader = new Uploader();
$uploader->name = 'Alessio';
$uploader->url = APP_URL;
$data->uploader = $uploader;
$data->copyright = new Copyright();
$data->copyright->owner = new CopyrightOwner();
$data->copyright->owner->name = 'Alessio';
$data->copyright->owner->website = APP_URL;
// $data->copyright->owner->email = $copyright_owner->get('email', '');
// $data->copyright->owner->address = $copyright_owner->get('address', '');
$data->copyright->usage = new CopyrightUsage();
$data->copyright->usage->short = 'C';
$data->copyright->usage->name = 'All rights reserved';
// $data->copyright->usage->reference = $usage_license->license;
$data->properties = new Properties();
$data->properties->title = $title;
$data->properties->filename = $title;
$data->properties->mime_type = $mime_type;
$data->properties->language = 'en';
$data->properties->collections = [];
$data->properties->tags = [];
$created_at = Carbon::now();
$updated_at = Carbon::now();
$data->properties->created_at = new DateTime($created_at->format('Y-m-d H:i:s.u'), $created_at->getTimezone());
$data->properties->updated_at = new DateTime($updated_at->format('Y-m-d H:i:s.u'), $updated_at->getTimezone());
$data->properties->size = filesize($file);
$data->properties->abstract = '';
$data->properties->thumbnail = THUMBNAILS_URL . md5($title) . '.png';
Sneak peak on what we are working on