dkd / php-cmis-client Goto Github PK
View Code? Open in Web Editor NEWThis is a PHP CMIS Client implementation based on OpenCMIS
License: Apache License 2.0
This is a PHP CMIS Client implementation based on OpenCMIS
License: Apache License 2.0
Dear PHP CMIS library users/developers,
We are asking ourselves if we should continue to maintain or start to abandon this Library.
It was built for a project many years ago. In the meantime, PHP has evolved, and we see usage mainly in the Drupal Community.
We are unaware of the amount of work needed to upgrade to PHP 8, and we need more funding within our commercial organization.
Is it possible to hand over the code to someone here?
There are 29 forks and 54 stars on GitHub.
Let us know by commenting below.
Many thanks in advance, Olivier
We should investigate how we can use async guzzle requests to parallelise our code.
New TYPO3 and drupal versions require guzzle 6. We are still using guzzle 5 which needs to be upgraded.
Hi,
I am trying to create a document with a UTF-8
string for property cmis:title
(e.g., 新商品情報
).
If I set that property when I create the document through $session->createDocument($properties, ...)
then the uploaded file has a completely wrong title (some non-printable chars).
Instead, if I first create the document with no properties and then perform an update through $document->updateProperties(...)
everything is ok.
Is this problem related to your (or any underlying) library?
Here I attach 2 screenshots:
Hey,
is this planed in the near future?
Cheers
Although adding alfresco aspects (horizontal inheritance vs vertical inheritance) to alfresco objects is not part of CMIS spec, it would be very interesting to support this feature optionally.
The following features would be great to have:
This feature set is already supported by the python cmislib add-on: "cmislib-alfresco-extension"
Is there a way to authenticate in cmis through Bearer token using this lib?
On the first look I thought that it doesn't implemented yet but maybe I can do it using Guzzle and "Authorization" header? Can somebody comment on this?
I would like to see a createDocument example, similar to Apache Chemistry Library PHP.
I wont to specify content_type (for example plain /text) or...createDocument where the content is a string. For example, a plain text with contains "Hello world text".
I only see example where the user, upload a file...
Thanks.
Hello, i fall into this issue: sometimes, inside a try catch of a RequestException the getResponse method returns null. The original exception message is the following
cURL error 52: Empty reply from server (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
would it be a good idea to check for the response object and maybe, as a fall back, returning the first exception message?
thanks
Is it to possible to sort cmis result natively in your php libraries ?
eg: I want to sort result by name or CreationDate and if possible show folder first
Best regard
When using the TYPO3 CMIS FAL integration (https://github.com/dkd/typo3-ext-cmis-fal) sometime an error occurs that a value has been casted from null
to string
.
0 /foo/typo3conf/php-cmis/src/Traits/TypeHelperTrait.php(69): Dkd\PhpCmis\DataObjects\AbstractExtensionData->checkType('string', NULL, false)
1 /foo/typo3conf/php-cmis/src/DataObjects/AbstractTypeDefinition.php(172): Dkd\PhpCmis\DataObjects\AbstractExtensionData->castValueToSimpleType('string', NULL)
2 /foo/typo3conf/php-cmis/vendor/dkd/php-populate/src/PopulateTrait.php(299): Dkd\PhpCmis\DataObjects\AbstractTypeDefinition->setLocalNamespace(NULL)
3 /foo/typo3conf/php-cmis/vendor/dkd/php-populate/src/PopulateTrait.php(145): Dkd\PhpCmis\DataObjects\AbstractExtensionData->setPopulatedProperty('localNamespace', NULL, false)
4 /foo/typo3conf/php-cmis/vendor/dkd/php-populate/src/PopulateTrait.php(63): Dkd\PhpCmis\DataObjects\AbstractExtensionData->populateInternal(Object(Dkd\PhpCmis\DataObjects\DocumentTypeDefinition), Array, false, false)
5 /foo/typo3conf/php-cmis/src/DataObjects/DocumentType.php(46): Dkd\PhpCmis\DataObjects\AbstractExtensionData->populate(Object(Dkd\PhpCmis\DataObjects\DocumentTypeDefinition))
6 /foo/typo3conf/php-cmis/src/ObjectFactory.php(480): Dkd\PhpCmis\DataObjects\DocumentType->__construct(Object(Dkd\PhpCmis\Session), Object(Dkd\PhpCmis\DataObjects\DocumentTypeDefinition))
7 /foo/typo3conf/php-cmis/src/Session.php(1314): Dkd\PhpCmis\ObjectFactory->convertTypeDefinition(Object(Dkd\PhpCmis\DataObjects\DocumentTypeDefinition))
8 /foo/typo3conf/php-cmis/src/Session.php(1098): Dkd\PhpCmis\Session->convertTypeDefinition(Object(Dkd\PhpCmis\DataObjects\DocumentTypeDefinition))
9 /foo/typo3conf/php-cmis/src/ObjectFactory.php(563): Dkd\PhpCmis\Session->getTypeDefinition('cmis:document')
10 /foo/typo3conf/php-cmis/src/ObjectFactory.php(145): Dkd\PhpCmis\ObjectFactory->getTypeFromObjectData(Object(Dkd\PhpCmis\DataObjects\ObjectData))
11 /foo/typo3conf/php-cmis/src/Session.php(926): Dkd\PhpCmis\ObjectFactory->convertObject(Object(Dkd\PhpCmis\DataObjects\ObjectData), Object(Dkd\PhpCmis\OperationContext))
12 /foo/typo3conf/ext/cmis_fal/Classes/Driver/Versioned/AbstractSharedCMISFilesystemDriver.php(342): Dkd\PhpCmis\Session->getObject(Object(Dkd\PhpCmis\DataObjects\ObjectId), Object(Dkd\PhpCmis\OperationContext))
13 /foo/typo3conf/ext/cmis_fal/Classes/Driver/SubAssertionDriver.php(73):
I have an Alfresco 9.0.0 installation and I am simply trying to get all the documents.
$httpInvoker = new \GuzzleHttp\Client(
array(
'defaults' => array(
'auth' => array(
CMIS_BROWSER_USER,
CMIS_BROWSER_PASSWORD
)
)
)
);
$parameters = array(
\Dkd\PhpCmis\SessionParameter::BINDING_TYPE => \Dkd\PhpCmis\Enum\BindingType::BROWSER,
\Dkd\PhpCmis\SessionParameter::BROWSER_URL => CMIS_BROWSER_URL,
\Dkd\PhpCmis\SessionParameter::BROWSER_SUCCINCT => false,
\Dkd\PhpCmis\SessionParameter::HTTP_INVOKER_OBJECT => $httpInvoker,
);
$sessionFactory = new \Dkd\PhpCmis\SessionFactory();
// If no repository id is defined use the first repository
if (CMIS_REPOSITORY_ID === null) {
$repositories = $sessionFactory->getRepositories($parameters);
$parameters[\Dkd\PhpCmis\SessionParameter::REPOSITORY_ID] = $repositories[0]->getId();
} else {
$parameters[\Dkd\PhpCmis\SessionParameter::REPOSITORY_ID] = CMIS_REPOSITORY_ID;
}
$session = $sessionFactory->createSession($parameters);
$result = $session->query('SELECT * FROM cmis:document');
It errored with :
{"exception":"invalidArgument","message":"Invalid form encoding!"}
This is the generated url and it makes a POST on it : /alfresco/api/-default-/public/cmis/versions/1.1/browser?cmisaction=query&statement=SELECT%20%2A%20FROM%20cmis%3Adocument&searchAllVersions=false&includeAllowableActions=true&renditionFilter=cmis%3Anone&skipCount=0&dateTimeFormat=simple&includeRelationships=none&maxItems=100
I found this article https://stackoverrun.com/ru/q/11802324 which says if you are doing POST, you should put the request in the body, not the url.
And indeed, if I do a curl http://mydomain/alfresco/api/-default-/public/cmis/versions/1.1/browser -d 'cmisaction=query&statement=SELECT%20%2A%20FROM%20cmis%3Adocument&searchAllVersions=false&includeAllowableActions=true&renditionFilter=cmis%3Anone&skipCount=0&dateTimeFormat=simple&includeRelationships=none&maxItems=100'
it works great.
Hi, I have tried this module with Drupal 8 and Alfresco 5. After configured my connection i clicked the Browse link, it shows the repository details.
But i faces different issues, i will mentioned below one by one.
Your library has a problem in either 32 bit systems or 32-bit php install on 64-bit systems.
For example Dkd\PhpCmis\Converter\AbstractDataConverter::convertDateTimeValue tells apart integer and string values. Unfortunately in a 32-bit system timestamps with milliseconds are double and throw a CmisRuntimeException.
Equally constraints defined as integer are transformed in double and automatically converted throwing a php notice.
So I was wondering if it could be better to change library in order to address 32-bit systems ot at least add a notice in repository and throw an exception in code addressing the fact that such a library functionality is limited to 64-bit php installs.
I have a problem with charset when upload a document.
eg: if my document name is RéàDME.md
in Alfresco I see Réà dme.md
ps: I rework CreateDocument.php for this test
$cid = $session->createObjectId($document->getId());
echo "Document has been created. Document Id: " . $document->getId() . " Name:" . $session->getObject($cid)->getName() ."\n";
Does this library run on PHP 8.1? Im getting errors which seem to stem from the League\Url library. Any ideas how to get this working pls? Thnx
Deprecated function: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in League\Url\Components\AbstractComponent->__toString() (line 67 of /var/www/html/drupal/vendor/league/url/src/Components/AbstractComponent.php)
Hello,
any plan to release a version with a composer.json updated? afaik the way to install php-cmis-client, with guzzle 6, is to composer require dev-master#1.0.1
Regards
Hi,
Now i am getting this error, while connecting to alfersco 3.4 with drupal 8.2.6 and cmis 2.0
url - http://localhost:8080/alfresco/service/cmis
Alfresco 5.2
Browser binding - will return the data in text/json format
Cmis read that data
Alfresco 3.4
AtomPub or services - will return the data in xml/atom format
Cmis through this error
So cmis latest version will not able to read that format
could you please help me to fix this issue
I would like to represent my folder descendant with jQuery tree in a php page.
What javascript tree recommend for use it with this library?
Thanks.
Hi and sorry for my question :
When i use "ShowRepositoryInfo.php" with define('CMIS_REPOSITORY_ID','369ee689-336c-48fb-96c3-b57ca713cb45'); i have this error :
_Uncaught Dkd\PhpCmis\Exception\CmisObjectNotFoundException: Repository "369ee689-336c-48fb-96c3-b57ca713cb45" not found! in /var/www/html/php-cmis-client/src/Bindings/Browser/RepositoryService.php:89 Stack trace: #0 /var/www/html/php-cmis-client/src/Session.php(152): Dkd\PhpCmis\Bindings\Browser\RepositoryService->getRepositoryInfo('369ee689-336c-4...') #1 /var/www/html/php-cmis-client/src/SessionFactory.php(36): Dkd\PhpCmis\Session->_construct(Array, NULL, NULL, NULL) #2 /var/www/html/php-cmis-client/examples/ShowRepositoryInfo.php(37): Dkd\PhpCmis\SessionFactory->createSession(Array) #3 {main} thrown in /var/www/html/php-cmis-client/src/Bindings/Browser/RepositoryService.php on line 89
After many tests nothing work only the value "null" work.
Your projet is use for my Alfresco CE 5.1.
Many thanks and best regards
Currently when the php-cmis-client is parsing property definitions, if it receives a property in the type definition that it does not recognize, this causes an exception to be thrown. I noticed this when using php-cmis with a Filenet server that has the "isHidden" extension enabled. Here is a sample of the data returned from the browser binding.
"IndexationId": {
"id": "IndexationId",
"localName": "IndexationId",
"displayName": "Indexation Id",
"queryName": "IndexationId",
"description": "The object ID of the verity collection an object is stored into, or null for objects that were full text indexed prior to the 4.0 release.",
"propertyType": "id",
"cardinality": "single",
"updatability": "readonly",
"inherited": false,
"required": false,
"queryable": true,
"orderable": true,
"openChoice": false,
"isHidden": "false"
},
When php-cmis tries to parse this in the JSONConverter, it ends up in this code.
array_intersect_key($data, array_fill_keys(JSONConstants::getPropertyTypeKeys(), 1)),
$propertyDefinition->populate(
$data,
[JSONConstants::JSON_PROPERTY_TYPE_RESOLUTION => 'dateTimeResolution']
);
$propertyDefinition->setExtensions($this->convertExtension($data, JSONConstants::getPropertyTypeKeys()));
The pouplate()
code ends up looking for a setter for isHidden
in the determinePropertyAccessFunctionName
method and since it cannot find one it throws an exception instead of ignoring it.
if (empty($accessMethodNames)) {
throw new AccessException(
'No "' . $method . '" method(s) can be determined for property ' . $propertyName,
1422021212
);
}
Section 2.1.1.3 of the CMIS specification says the following about unrecognized repository features.
Clients that don’t understand this information SHOULD ignore it.
Hello, following the suggestion of @NamelessCoder I'm opening this issue because I don't get it the idea of how to listing folder and files
My question was if I should develop another method on the Session Class implementing getChildren of NavigationService but it seems like I'm not getting the idea of how to use the library
Maybe I just need an example of how to list folders and files but I think it will very positive have a more intuitive way to list folder and files.
Thanks in advance.
Hi,
Is it possible to send a custom http header to the requests.
Something like AuthenticationProviders what we have in Java OpenCMIS .
Best Regards,
Saurav
Some CMIS servers report an invalid form encoding for some requests. We need to track down these requests and solve this.
We should add an automated travis test run against a real CMIS repository (alfresco?) (using docker?) additionally to/instead of all that mocking.
Hello,
first of all thanks for this CMIS client.
I'd like to use it an Drupal 8 module and try install with composer:
$ composer require dkd/php-cmis
but it is not able:
Using version ^1.0 for dkd/php-cmis
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.Problem 1
- Can only install one of: guzzlehttp/guzzle[5.3.x-dev, 6.2.1].
- Can only install one of: guzzlehttp/guzzle[6.2.1, 5.3.x-dev].
- Can only install one of: guzzlehttp/guzzle[6.2.x-dev, 5.3.x-dev].
- Can only install one of: guzzlehttp/guzzle[5.3.x-dev, 6.2.1].
- dkd/php-cmis v1.0.0 requires guzzlehttp/guzzle ~5.0 -> satisfiable by guzzlehttp/guzzle[5.3.x-dev].
- Installation request for dkd/php-cmis ^1.0 -> satisfiable by dkd/php-cmis[v1.0.0].
- Installation request for guzzlehttp/guzzle ^6.2.1 -> satisfiable by guzzlehttp/guzzle[6.2.1, 6.2.x-dev].Installation failed, reverting ./composer.json to its original content.
Please let me know what is the right way to install it with composer?
I have an Deprecated with latest version of this library:
Deprecated: Array and string offset access syntax with curly braces is deprecated in /project/vendor/dkd/php-cmis/src/QueryStatement.php on line 478
The website encountered an unexpected error. Please try again later.
RuntimeException: Failed to start the session because headers have already been sent by "/project/vendor/dkd/php-cmis/src/QueryStatement.php" at line 476. in Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start() (line 152 of /project/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php).
I will fix it with the PR
In Laravel version > 9 we have to use guzzlehttp with minimum version : 7.
In the dev-master branch of this project, guzzlehttp is specified for version ^6 .
I have installed the project in local, upadte guzzlehttp version and all seems ok.
We have just to change the guzzlehttp version of composer.json file, and all people who want use this package in laravel project or other will can install it..
I'm getting this error when uploading a document and only for Windows based p.c's when I do this with a Mac or Linux machine then it's ok.
Given value is of type "integer" but a value of type "double" was expected. Value has been casted to the expected type.
In the TypeHelperTrait.php class
trigger_error(
sprintf(
'Given value is of type "%s" but a value of type "%s" was expected.'
. ' Value has been casted to the expected type.',
gettype($value),
$expectedType
),
E_USER_NOTICE
);
My work around for now is to change the trigger_error to a \Log::warning as i feel that it's not really an error but merely a message to display.
Hi,
Thank you for the job done.
I've a technical issue using this cmis client but i don't know how to solve it.
When create a document i've no probelm with php-cmis but documents are not indexed by system.
Is-it normal ? How can i get you more informations about my issue ?
Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.