Sorting alfresco search by node path - alfresco

Is it possible to sort search results from alfresco by the path of the node?
I know there is the PATH field, but that is a multi-valued attribute which SOLR is unable to sort on.
I know it would be possible to capture the path of the node in a custom attribute and sort on that, however there are many scenarios this would be unable to capture (e.g. if a parent folder name is changed for a locked node) so would prefer an alfresco field if it is possible
This is on alfresco version 6.1 with SOLR 6

Related

Search for files in Alfresco based on the content model properties using Rest API

I'm trying to implement searching of files in Alfresco based on the properties of the content model of the document.
I found this ReST API:
GET /alfresco/s/slingshot/search?term={term?}&tag={tag?}&site={site?}&container={container?}&sort={sort?}&query={query?}&repo={repo?}
But I'm not sure how to pass the property name of the document in the query parameter.
For ex:
My docuemt content model is: dc:InvoiceModel
Property name is: dc:doctype.
So, I want to pass the dc:doctype as query parameter as Sales Invoice for example to fetch all the documents of the type Sales Invoice. The documents are inside a folder in the documentLibrary
I tried doing this:
http://localhost:8080/alfresco/s/slingshot/search?container=documentLibrary/newfolder&sort=dc:dc:doc...false&repo=true&startIndex=0&query={"dc:doctype":"Sales Invoice","datatype":"d:text"}
But I'm getting zero records found. Could you please help me do this.
Alfresco Version:
Alfresco Share v5.1.f
(r125711-b6, Aikau 1.0.63, Spring Surf 5.1.f, Spring WebScripts 6.5, Freemarker 2.3.20-alfresco-patched, Rhino 1.7R4-alfresco-patched, Yui 2.9.0-alfresco-20141223)
Alfresco Community v5.1.0
(r127059-b7) schema 10001
Thank you all!
be careful: slingshot is not a public API (but in 5.1 you don't have a public search API). In 5.2 you should use the Alfresco Content Services REST API
In this SO question you should already find you answer: Passing multiple search arguments to Alfresco slingshot search Webscript
some remarks:
container: could be one of the site container types like documentLibrary but only makes sense together with a site
query: (defaults to Alfresco FTS) should look like dc\:doctype:"Sales Invoice" but should be url encoded. You could also add a PATH query as shown in the answer above

Add an existing node as a translation to another node

I am migrating contents from a multilingual website. I'm using Feed modules to import all the nodes so, in the end, I have multiple nodes that are in English and multiple nodes that are in French. Then, i wrote a DRUSH command where I have a CSV file that contains URL Alias of both slug of English and French. I can then process that info and get the node ID of both related Node.
But I just can't see how I can't tell drupal to attach an existing node (FR) as a translation of another node (EN). Does anyone has ever wanted to do something similar?
Thanks!

Searching in Alfresco in all tenants

Is it possible to search files, folders in Alfresco in all existing tenants? For example: I am admin user in the tenantA and would like find files in all other tenants.
I don't think its possible to search files or folders in all existing alfresco tenants.As far as I know tenants are designed for hiding visibility of document from one to another tenants.That is the main purpose for which tenant were introduced.
So that single alfresco instance can be used for more than one organization,without knowing that another user is also using same instance for document management.
You can find more about tenant on below link.
https://wiki.alfresco.com/wiki/Multi-Tenancy

where do I set the default node path in drupal

I set somewhere, that all new nodes should be published under 'reports' (domain.com/reports/node)
Where can I change this?
There are two possible answers. If you asked exactly what you have asked then you have added a path alias to node under admin/build/path. Or if instead of node/1 you see reports/node/1 then you have pathauto installed and you create a strange pattern reports/node/[nid].
Oh and there is a third one, that you have created a View for all nodes. This question requires clarification -- core only has a listing for promoted nodes not all nodes. Do you have Views installed? Do you have pathauto installed? What happens exactly?
The existing answer mentions the excellent module Pathauto here. From the project description:
The Pathauto module automatically generates path aliases for various kinds of content (nodes, categories, users) without requiring the user to manually specify the path alias. This allows you to get aliases like /category/my-node-title.html instead of /node/123. The aliases are based upon a "pattern" system which the administrator can control.
Pathauto allows for all kinds of control over Drupal paths for sane URLs and better search visibility. In your case defaults could be set for /reports and special cases could be made for other content or content types.

How to store Blobs in Drupal?

I want to store PDF and Image files in Drupal. By default Drupal seems to store binary/uploaded files into the filesystem. I want to to be able to store files so that - I can have workflows, metadata, IP information and URL aliases?
Update, am still stuck at how to create URL aliases for files on the file system. Drupal only seems to allow creating URL aliases to node content.
The simplest solution for Drupal is to use the Upload module, which is in core. The upload module allows you attach files to nodes. As you note, they are stored in the filesystem.
If you want to get more complex, you can build your own content types through the web interface by using the CCK family of modules (such as the filefield module or the imagefield module). Your files are still stored on the filesystem.
You could use CCK to create the metadata field you want.
You could use the workflow or rules modules to implement workflow.
IP information is recorded automatically by Drupal's logging module (either the database logging module, which logs to the database, or the syslog module, which logs to syslog).
URL aliases for nodes are available in core Drupal by enabling the path module (or download the pathauto module for automatic creation of aliases).
I tried Drupal's Upload module, FileField as well as uploading files using FCKEditor - I prefer the last one - it is closer to my specific scenario.
Creating an alias to the file will likely require some custom code.
It's not possible to simply create an alias using the Administer > Site building > URL aliases screen. I tried inserting a record with
insert into url_alias (src, dst) values ('sites/default/files/ChipotleArt.JPG', 'here-is-the-file.jpg');
That still didn't work. So, you will really likely need to write some custom code.

Resources