Coder Social home page Coder Social logo

php-cmis-client's People

Contributors

della-90 avatar dkd-dobberkau avatar dkd-ebert avatar doan2013 avatar guthy avatar ksjogo avatar marcelto avatar namelesscoder avatar sascha-egerer avatar scanacs-agruhn avatar selion05 avatar terescode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-cmis-client's Issues

Maintain or Abandon this Library

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

async requests

We should investigate how we can use async guzzle requests to parallelise our code.

upgrade to guzzle 6

New TYPO3 and drupal versions require guzzle 6. We are still using guzzle 5 which needs to be upgraded.

UTF-8 characters problem

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:

  • What happens when I create the document with the UTF-8 title property
    selection_029
  • What happens when I create the document with no title and then update it
    selection_028

Feature request: Support for Alfresco aspects

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:

  • Allow to specify aspects during object creation (createDocument, createFolder)
  • Getting aspect properties of objects with additional aspects
  • Allow updating objects aspect properties.

This feature set is already supported by the python cmislib add-on: "cmislib-alfresco-extension"

https://github.com/pcollardez/cmislib-alfresco-extension

Bearer token authentication

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?

Examples with createDocument

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.

Empty reply from server

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

Sort cmis result

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

GuzzleHttp Exception[ParseException]: Unable to parse JSON data

After configure CMIS connection i clicked the Browse link, then site displays "The website encountered an unexpected error. Please try again later". I found the error in recent logs and i enclosed error details which i am facing. Please give a solution for this.
cmis_connection_drupal_8
d8_cmis_issue

Document property `localNamespace` can be null

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): 

Invalid form encoding! for simple query

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.

The website encountered an unexpected error and Ajax internal error in D8 with Alfresco 5

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.
cmis_browser_drupal_8_list
But i faces different issues, i will mentioned below one by one.

  1. If i click any link its throws the Ajax internal error.
    cmis_browser_drupal_8_ajax
  2. If i click create folder or document link its shows one form after clicking the submit button it throws "The website encountered an unexpected error". Error log shows following error.
    cmis_browser_drupal_8_create
    error-details _ drupal 8
  3. Finally in the connection config what value will give for repository id?
    cmis_connection_drupal_8_rep_id

32-bit systems

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.

cmis:name encoding character error

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

Capture d’écran_2020-08-26_17-51-47

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";

PHP 8 compatibility

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)

Release version, guzzle 6

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

Dkd\PhpCmis\Exception\CmisConnectionException: Could not fetch repository info! Response is not a valid JSON.

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

cmis_alfresco_3_4

CMIS_REPOSITORY_ID (?)

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

Extension properties are not properly ignored

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.

Include example of folder listing (has gist)

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.

"invalid form encoding"

Some CMIS servers report an invalid form encoding for some requests. We need to track down these requests and solve this.

real testing

We should add an automated travis test run against a real CMIS repository (alfresco?) (using docker?) additionally to/instead of all that mocking.

Install with composer

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?

Array and string offset access syntax with curly braces is deprecated

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

Doesn't work for laravel > 8

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..

ErrorException in TypeHelperTrait.php line 79

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.

Documents are not indexed

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.