1. Go to this page and download the library: Download codebar-ag/laravel-docuware library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
codebar-ag / laravel-docuware example snippets
use CodebarAg\DocuWare\Connectors\DocuWareConnector;
use CodebarAg\DocuWare\DTO\Config\ConfigWithCredentials;
$connector = new DocuWareConnector(
configuration: new ConfigWithCredentials(
username: 'username',
password: 'password',
)
);
use CodebarAg\DocuWare\Connectors\DocuWareConnector;
use CodebarAg\DocuWare\DTO\Config\ConfigWithCredentialsTrustedUser;
$connector = new DocuWareConnector(
configuration: new ConfigWithCredentialsTrustedUser(
username: 'username',
password: 'password',
impersonatedUsername: 'impersonatedUsername',
)
);
use CodebarAg\DocuWare\Requests\General\Organization\GetOrganization;
$organizations = $this->connector->send(new GetOrganization())->dto();
use CodebarAg\DocuWare\Requests\General\Organization\GetAllFileCabinetsAndDocumentTrays;
$cabinetsAndTrays = $this->connector->send(new GetAllFileCabinetsAndDocumentTrays())->dto();
use CodebarAg\DocuWare\Requests\General\UserManagement\GetUsers\GetUsers;
$users = $this->connector->send(new GetUsers())->dto();
use CodebarAg\DocuWare\Requests\General\UserManagement\GetUsers\GetUserById;
$user = $this->connector->send(new GetUserById($userId))->dto();
use CodebarAg\DocuWare\Requests\General\UserManagement\GetUsers\GetUsersOfARole;
$users = $this->connector->send(new GetUsersOfARole($roleId))->dto();
use CodebarAg\DocuWare\Requests\General\UserManagement\GetUsers\GetUsersOfAGroup;
$users = $this->connector->send(new GetUsersOfAGroup($groupId))->dto();
use CodebarAg\DocuWare\Requests\General\UserManagement\CreateUpdateUsers\CreateUser;
$user = $connector->send(new CreateUser(new User(
name: $timestamp.' - Test User',
dbName: $timestamp,
email: $timestamp.'[email protected]',
password: 'TESTPASSWORD',
)))->dto();
use CodebarAg\DocuWare\Requests\FileCabinets\General\GetFileCabinetInformation;
$fileCabinet = $connector->send(new GetFileCabinetInformation($fileCabinetId))->dto();
use CodebarAg\DocuWare\Requests\FileCabinets\General\GetTotalNumberOfDocuments;
$count = $connector->send(new GetTotalNumberOfDocuments(
$fileCabinetId,
$dialogId
))->dto();
use CodebarAg\DocuWare\Requests\FileCabinets\Dialogs\GetAllDialogs;
$dialogs = $connector->send(new GetAllDialogs($fileCabinetId))->dto();
use CodebarAg\DocuWare\Requests\FileCabinets\Dialogs\GetASpecificDialog;
$dialog = $connector->send(new GetASpecificDialog($fileCabinetId, $dialogId))->dto();
use CodebarAg\DocuWare\Enums\DialogType;
use CodebarAg\DocuWare\Requests\FileCabinets\Dialogs\GetDialogsOfASpecificType;
$dialogs = $connector->send(new GetDialogsOfASpecificType($fileCabinetId, DialogType::SEARCH))->dto();
use CodebarAg\DocuWare\Requests\FileCabinets\Search\GetASpecificDocumentFromAFileCabinet;
$document = $connector->send(new GetASpecificDocumentFromAFileCabinet(
$fileCabinetId,
$documentId
))->dto();
use CodebarAg\DocuWare\Requests\FileCabinets\Search\GetDocumentsFromAFileCabinet;
$documents = $connector->send(new GetDocumentsFromAFileCabinet(
$fileCabinetId
))->dto();
use CodebarAg\DocuWare\Requests\Documents\ApplicationProperties\GetApplicationProperties;
$properties = $connector->send(new GetApplicationProperties(
$fileCabinetId,
$document->id,
))->dto();
use CodebarAg\DocuWare\Requests\Documents\Sections\GetAllSectionsFromADocument;
$sections = $connector->send(new GetAllSectionsFromADocument(
$fileCabinetId,
$documentId
))->dto();
use CodebarAg\DocuWare\Requests\Documents\Sections\GetASpecificSection;
$section = $connector->send(new GetASpecificSection(
$fileCabinetId,
$sectionsId
))->dto();
use CodebarAg\DocuWare\Requests\Documents\Sections\DeleteSection;
$deleted = $connector->send(new DeleteSection(
$fileCabinetId,
$sectionId
))->dto();
use CodebarAg\DocuWare\Requests\Documents\Sections\GetTextshot;
$deleted = $connector->send(new GetTextshot(
$fileCabinetId,
$sectionId
))->dto();
use CodebarAg\DocuWare\Requests\Documents\Download\DownloadDocument;
$contents = $connector->send(new DownloadDocument(
$fileCabinetId,
$documentId
))->dto();
use CodebarAg\DocuWare\Requests\Documents\Download\DownloadSection;
$contents = $connector->send(new DownloadSection(
$fileCabinetId,
$sectionId
))->dto();
use CodebarAg\DocuWare\Requests\Documents\Download\DownloadThumbnail;
$contents = $connector->send(new DownloadThumbnail(
$fileCabinetId,
$sectionId
))->dto();
use CodebarAg\DocuWare\Requests\Workflow\GetDocumentWorkflowHistory;
$history = $this->connector->send(new GetDocumentWorkflowHistory(
$fileCabinetId,
$documentId
))->dto();
use CodebarAg\DocuWare\Requests\Workflow\GetDocumentWorkflowHistorySteps;
$historySteps = $this->connector->send(new GetDocumentWorkflowHistorySteps(
$workflowId,
$historyId,
))->dto();
namespace App\Connectors;
use CodebarAg\DocuWare\Connectors\DocuWareConnector;
use CodebarAg\DocuWare\DTO\Config\ConfigWithCredentials;
class YourOwnDocuWareConnector extends DocuWareConnector
{
public function __construct() {
$configuration = new ConfigWithCredentials(
username: 'username',
password: 'password',
);
parent::__construct($configuration);
}
}
use App\Connectors\YourOwnDocuWareConnector;
use CodebarAg\DocuWare\DTO\Config\ConfigWithCredentials;
$connector = new YourOwnDocuWareConnector();
$connector = new DocuWareConnector();
$response = $connector->send(new GetDocumentRequest($fileCabinetId, $documentId));
$response->isCached(); // false
// Next time the request is sent
$response = $connector->send(new GetDocumentRequest($fileCabinetId, $documentId));
$response->isCached(); // true
$connector = new DocuWareConnector();
$request = new GetDocumentRequest($fileCabinetId, $documentId);
$request->invalidateCache();
$response = $connector->send($request);
$connector = new DocuWareConnector();
$request = new GetDocumentRequest($fileCabinetId, $documentId);
$request->disableCaching();
$response = $connector->send($request);
use CodebarAg\DocuWare\Events\DocuWareResponseLog;
// Log each response from the DocuWare REST API.
DocuWareResponseLog::class => [
//
],
return [
/*
|--------------------------------------------------------------------------
| Cache driver
|--------------------------------------------------------------------------
| You may like to define a different cache driver than the default Laravel cache driver.
|
*/
'cache_driver' => env('DOCUWARE_CACHE_DRIVER', env('CACHE_DRIVER', 'file')),
/*
|--------------------------------------------------------------------------
| Requests timeout
|--------------------------------------------------------------------------
| This variable is optional and only used if you want to set the request timeout manually.
|
*/
'timeout' => env('DOCUWARE_TIMEOUT', 15),
/*
|--------------------------------------------------------------------------
| DocuWare Credentials
|--------------------------------------------------------------------------
|
| Before you can communicate with the DocuWare REST-API it is necessary
| to enter your credentials. You should specify a url containing the
| scheme and hostname. In addition add your username and password.
|
*/
'credentials' => [
'url' => env('DOCUWARE_URL'),
'username' => env('DOCUWARE_USERNAME'),
'password' => env('DOCUWARE_PASSWORD'),
],
/*
|--------------------------------------------------------------------------
| Passphrase
|--------------------------------------------------------------------------
|
| In order to create encrypted URLs we need a passphrase. This enables a
| secure exchange of DocuWare URLs without anyone being able to modify
| your query strings. You can find it in the organization settings.
|
*/
'passphrase' => env('DOCUWARE_PASSPHRASE'),
/*
|--------------------------------------------------------------------------
| Configurations
|--------------------------------------------------------------------------
|
*/
'configurations' => [
'search' => [
'operation' => 'And',
/*
* Force Refresh
* Determine if result list is retrieved from the cache when ForceRefresh is set
* to false (default) or always a new one is executed when ForceRefresh is set to true.
*/
'force_refresh' => true,
'
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.