You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by teddy kossoko <ko...@yahoo.fr> on 2015/03/10 09:34:11 UTC

Contribution Apache CMIS PHP

        Hello, my name is KOSSOKO Teddy and I live in France. I am student incomputer science in sandwich course in a research lab named INRA. For my sandwichcourse, I used the CMIS version 1.8.1 PHP library to communicate with theAlfresco file manager, to upload files, delete them, or read them from a webinterface. I met some problems I solved by modifying the code of the library inthe file Cmis_Service.php. The initial code is in green. These changes are listed below:         $hash_values['title'] = preg_replace("/[^A-Za-z0-9\s.&;\-!+=_']/", '', htmlentities($objectName, null, mb_internal_encoding()));        //$hash_values['title']= preg_replace("/[^A-Za-z0-9\s.&;\ ]/", '',htmlentities($objectName));        Parameters have been added to the htmlentities in order to have the rightencoding of filesAnd to keep the correct name of the folder or file, the regular expressionalso has been amended, the - (hyphen) and other characters supported by windowshave been added in order to avoid their deletion in file or folder names.          $varmap["path"] =urlencode($path);        //$varmap["path"]= path;        We have added the urlencode because when the request is made to retrieve afile, If the file contains a space or characters which are not interpretable bythe browserIt is necessary to encode it. For to some browsers and also starting encoding, a space can be encode by %20. In our test, it was encoded by + for example with the urlencode.         I do not know if these changes can be taken into account in order to makeCMIS PHP fairly generic to treat any format of files, any encoding, withoutchanges to the names of the files or folders. Yours sincerely.   

Re: Contribution Apache CMIS PHP

Posted by Richard Mcknight <ri...@alfresco.com>.
Good Morning Teddy,

Sorry for the delay. Thanks for the contribution ‹ I will review and add
it in the next couple of days.

Rich
Richard McKnight

Principal Technical Consultant -- Americas
Mobile: +1 908 247 0756
Skype: rmknightstar
 <http://www.alfresco.com/>
 <http://www.alfresco.com/>  <http://twitter.com/alfresco>
<http://www.facebook.com/alfrescosoftware>  <http://blogs.alfresco.com/>
<http://www.linkedin.com/company/alfresco>
<http://www.youtube.com/alfresco101>




On 3/10/15, 4:34 AM, "teddy kossoko" <ko...@yahoo.fr> wrote:

>        Hello, my name is KOSSOKO Teddy and I live in France. I am
>student incomputer science in sandwich course in a research lab named
>INRA. For my sandwichcourse, I used the CMIS version 1.8.1 PHP library to
>communicate with theAlfresco file manager, to upload files, delete them,
>or read them from a webinterface. I met some problems I solved by
>modifying the code of the library inthe file Cmis_Service.php. The
>initial code is in green. These changes are listed below:
>$hash_values['title'] = preg_replace("/[^A-Za-z0-9\s.&;\-!+=_']/", '',
>htmlentities($objectName, null, mb_internal_encoding()));
>//$hash_values['title']= preg_replace("/[^A-Za-z0-9\s.&;\ ]/",
>'',htmlentities($objectName));        Parameters have been added to the
>htmlentities in order to have the rightencoding of filesAnd to keep the
>correct name of the folder or file, the regular expressionalso has been
>amended, the - (hyphen) and other characters supported by windowshave
>been added in order to avoid their deletion in file or folder names.
>    $varmap["path"] =urlencode($path);        //$varmap["path"]= path;
>    We have added the urlencode because when the request is made to
>retrieve afile, If the file contains a space or characters which are not
>interpretable bythe browserIt is necessary to encode it. For to some
>browsers and also starting encoding, a space can be encode by %20. In our
>test, it was encoded by + for example with the urlencode.         I do
>not know if these changes can be taken into account in order to makeCMIS
>PHP fairly generic to treat any format of files, any encoding,
>withoutchanges to the names of the files or folders. Yours sincerely.