mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
swf transformer (installed swf tool requied), minor refactor of thumbnail service, thumbnailRegistry created (smallImage and webpreview thumbnail types added), start of thumbnail JS API (extensions to ScriptNode) and POST URL to create thumbnails
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@9259 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -29,6 +29,7 @@ import java.util.LinkedHashSet;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.model.Repository;
|
||||
import org.alfresco.repo.search.impl.lucene.LuceneQueryParser;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.repository.ContentReader;
|
||||
@@ -64,6 +65,9 @@ public final class Search extends BaseScopableProcessorExtension
|
||||
|
||||
/** Default store reference */
|
||||
private StoreRef storeRef;
|
||||
|
||||
/** Repository helper */
|
||||
private Repository repository;
|
||||
|
||||
/**
|
||||
* Set the default store reference
|
||||
@@ -84,6 +88,16 @@ public final class Search extends BaseScopableProcessorExtension
|
||||
{
|
||||
this.services = services;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the repository helper
|
||||
*
|
||||
* @param repository the repository helper
|
||||
*/
|
||||
public void setRepositoryHelper(Repository repository)
|
||||
{
|
||||
this.repository = repository;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find a single Node by the Node reference
|
||||
@@ -118,6 +132,40 @@ public final class Search extends BaseScopableProcessorExtension
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to convert a Web Script Request URL to a Node Ref
|
||||
*
|
||||
* 1) Node - {store_type}/{store_id}/{node_id}
|
||||
*
|
||||
* Resolve to node via its Node Reference.
|
||||
*
|
||||
* 2) Path - {store_type}/{store_id}/{path}
|
||||
*
|
||||
* Resolve to node via its display path.
|
||||
*
|
||||
* 3) AVM Path - {store_id}/{path}
|
||||
*
|
||||
* Resolve to AVM node via its display path
|
||||
*
|
||||
* 4) QName - {store_type}/{store_id}/{child_qname_path}
|
||||
*
|
||||
* Resolve to node via its child qname path.
|
||||
*
|
||||
* @param referenceType one of node, path, avmpath or qname
|
||||
* @param reference array of reference segments (as described above for each reference type)
|
||||
* @return ScriptNode the script node
|
||||
*/
|
||||
public ScriptNode findNode(String referenceType, String[] reference)
|
||||
{
|
||||
ScriptNode result = null;
|
||||
NodeRef nodeRef = this.repository.findNodeRef(referenceType, reference);
|
||||
if (nodeRef != null)
|
||||
{
|
||||
result = new ScriptNode(nodeRef, this.services, getScope());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute a XPath search
|
||||
*
|
||||
|
Reference in New Issue
Block a user