PHP Library Examples Wanted ...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2007 09:00 AM
Over the coming weeks I hope to add some example scripts to the Wiki and PHP library to help make the process of understanding the Alfresco PHP API easier.
If you have any examples you'd be willing to share then this will help speed up this process. I'm looking for anything from the very simple (eg: accessing a property value, uploading content, traversing an association) to more complicated scripts, perhaps with elements of UI. The examples can be code snipits or complete scripts.
Any help will be gratefully received and appropriate credit will be given to those scripts that make it into the documentation/library.
Please feel free to post on this thread with your contributions.
Many thanks,
Roy
- Labels:
-
Archive

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2007 09:31 AM
If we could have just a hint here it would help:

http://wiki.alfresco.com/wiki/Enabling_Alfresco_PHP_Server
You might also find it helpful to know that your Wiki (or whatever is indexing behind it)
is configured to consider anything less than four characters a stop-word, which might
tend to make PHP, AMP, API, SDK, JVM, UI, etc. less visible than they deserve to be.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2007 11:17 AM
Sure thing, its on my list to fill out this coming week. I'll let you know when it's done.
Thanks for the tip regarding the Wiki. I'll pass that onto our web master.
Cheers,
Roy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2007 07:31 AM
/** * Get the node for a given path beneath /Company Home * * Example: $alfrescoWrapper->getNodeByPath('/Guest Home/Alfresco_Tutorial.pdf'); * * @param string $path */ public function getNodeByPath($path, $node = null) { $bits = split('/', $path); if ($node == null) { $node = $this->spacesStore->getCompanyHome(); } /* @var $node Node */ foreach ($bits as $bit) { // Skip up until we have the parts after the company home if (empty($bit) || $bit == 'Company Home') { continue; } // Get the node for the current bit. If the current // "bit" doesn't exist, then $children = $node->getChildren(); foreach ($children as $child) { $childNode = $child->getChild(); if ($childNode->cm_name == $bit) { $node = $childNode; // Cheat and skip to the next 'bit' to scan continue 2; } } $node = null; break; } return $node; }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2008 04:22 AM
The only disadvantage I see is that the query is handled by Lucene, and Lucene index content in background.
So, if you have juste created a node near the node you are querying, the query may not return the node, even if it exists !
Why can't we query the repository with classic method "selectNodes" in xpath through the webservice api ?
I know, CMIS will cover this weak …

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2008 06:36 AM
Why you don't use a Lucene query like 'PATH:"/app:company_home/cm:myfolder/cm:myotherfolder"' ?
A lot of the time content is referred to by the name path, which isn't always the same as the PATH stored in lucene for a variety of reasons.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2009 02:50 PM

1.on alfresco wiki Node class contain a public function copy($destinationNode, $associationType, $associationName, $copyChildren=true); but it function is not found
2. i can't understand association why it is used(what is $assiociationType,$associationName parameter ).
3.is php api just for admin user if no how can i get logged users home folder
please help me all
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2009 06:40 PM
Associations are used to link to node objects together. They can have a particular type (eg childAssociations, relatedAssociation) which provides a way of selecting linked nodes along a particular type of association. Associations are also named with a fully qualified name, which helps when identifying a specific association name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2009 01:33 AM
Can you give me some example little code if copy method is found how to use this method because i can't really understand association.
please help me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2011 01:39 PM
You should implement it via RESTFul Services … works fine….
Check out my PHP LIbrary i implemented in there ->
http://forge.alfresco.com/projects/ifresco-phplib/
Code must be like:
$Transport = new RESTTransport($repository,$store,$session);$Transport->CopyTo($DestinationNode->getId(),array($Node->getId()));// Same with ->MoveTo
Why an array with the Target Node? Cuz Copy & Move Restful Services can handle multiple Noderefs.
