Alfresco and php
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2013 07:14 AM
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2013 09:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2013 04:57 AM
Notice: Undefined index: argv in C:\xampp\htdocs\Ma-Ali\alfresco.php on line 46
Notice: Undefined index: argv in C:\xampp\htdocs\Ma-Ali\alfresco.php on line 47
Notice: Undefined index: argv in C:\xampp\htdocs\Ma-Ali\alfresco.php on line 48
Notice: Undefined index: argv in C:\xampp\htdocs\Ma-Ali\alfresco.php on line 49
Notice: Undefined index: argv in C:\xampp\htdocs\Ma-Ali\alfresco.php on line 50
———————————————————————————-
here are the line
$repo_url = $_SERVER["argv"][1];
$repo_username = $_SERVER["argv"][2];
$repo_password = $_SERVER["argv"][3];
$repo_folder = $_SERVER["argv"][4];
$repo_new_folder = $_SERVER["argv"][5];
===================================================
error from php wrapper
Fatal error: Uncaught exception 'CmisRuntimeException' in C:\xampp\htdocs\Ma-Ali\cmis_repository_wrapper.php:114 Stack trace: #0 C:\xampp\htdocs\Ma-Ali\cmis_repository_wrapper.php(139): CMISRepositoryWrapper->convertStatusCode(0, false) #1 C:\xampp\htdocs\Ma-Ali\cmis_repository_wrapper.php(126): CMISRepositoryWrapper->doGet(NULL) #2 C:\xampp\htdocs\Ma-Ali\cmis_repository_wrapper.php(85): CMISRepositoryWrapper->connect(NULL, NULL, NULL, NULL) #3 C:\xampp\htdocs\Ma-Ali\cmis_repository_wrapper.php(659): CMISRepositoryWrapper->__construct(NULL, NULL, NULL, NULL, Array) #4 C:\xampp\htdocs\Ma-Ali\alfresco.php(52): CMISService->__construct(NULL, NULL, NULL) #5 {main} thrown in C:\xampp\htdocs\Ma-Ali\cmis_repository_wrapper.php on line 114
————————————————————————————–
line in php wrapper
function convertStatusCode($code, $message)
{
switch ($code) {
case HTTP_BAD_REQUEST:
return new CmisInvalidArgumentException($message, $code);
case HTTP_NOT_FOUND:
return new CmisObjectNotFoundException($message, $code);
case HTTP_FORBIDDEN:
return new CmisPermissionDeniedException($message, $code);
case HTTP_METHOD_NOT_ALLOWED:
return new CmisNotSupportedException($message, $code);
case HTTP_CONFLICT:
return new CmisConstraintException($message, $code);
default:
here=====>> return new CmisRuntimeException($message, $code);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2013 05:45 AM
php5 {the-script-name}.php {url-to-server} {username} {password} {a-folder-name} {a-new-folder-to-create}
{url-to-server} will likely be http://localhost:8080/alfresco/service/api/cmis clearly this depends on your installation
{username} well, start with admin until you get things working then you can make it a "normal" user but stay away from any script that will delete things whilst running as admin - just for your own safety.
{password} self explanatory
{a-folder-name} Create a test folder in the root of your repository - say mytestfolder. Send this
{a-new-folder-name} Send one you want to create e.g mynewfolder
Run it and you should get a new folder called mynewfolder within mytestfolder.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2013 07:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2013 01:09 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2013 08:13 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2017 02:13 AM
Hi
Did you manage to get a solution to this issue? I'm facing the same problem with Drupal 7.5.3 and Alfresco Community 5.2.
Any help would be greatly appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2013 10:46 PM
ini_set('display_errors', '1');error_reporting(0);include("config.php");require_once ('cmis_repository_wrapper.php');$repo_url = URL;$repo_username = USERNAME;$repo_password = PASSWORD;//Check cmis service connect or nottry{ $client = new CMISService($repo_url, $repo_username, $repo_password);}catch (Exception $ec) { echo "Cmis connection issue"; die;}$sysstartdate = mktime(0,0,0,6,1,2012); // start 1st June$today = strtotime(date("Y-m-d"));$ltthan = $sysstartdate;try{ do { $gtthan = $ltthan; $ltthan = strtotime(date("Y-m-d",$gtthan)." +1 month"); $qstring = "select * from fgdt:adocumenttype where cmis:creationDate >= TIMESTAMP '" . date("Y-m-d", $gtthan) ."T00:00:00.000+00:00' and cmis:creationDate < TIMESTAMP '". date("Y-m-d", $ltthan) . "T00:00:00.000+00:00'"; $objs = $client->query($qstring); try{ foreach ($objs->objectList as $obj) { //!!! YOUR CODE TO DO THINGS WITH THE METADATA HERE } }catch (Exception $e2) { //echo "Caught exception: ".$e2->getMessage()."\n"; } } while ($ltthan < $today);}catch (Exception $e1) { echo "Caught exception: ".$e1->getMessage()."\n"; die;}
Note that the extract is in a loop and does the query month by month. This is because Lucene has a 1000 item results set limit which is silent, so you have to frame your query in such a way as to be sure you will not get more than 1000 items returned or you have to change the limit which is done via Alfresco configuration.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2013 03:41 AM
