cancel
Showing results for 
Search instead for 
Did you mean: 

Renaming or creating a copy with other name

fcastell
Champ in-the-making
Champ in-the-making
I’m trying to rename or create a copy with a new name of pdf  files based on part of it content.
My cheeepooo scanner at least creates searchable pdf, but it names it scan1.pdf scan2.pdf ….
What I’m trying to do is once the file is copied into alfresco search for a keyword inside of it
and based on it renaming the file or create a new file with the new name.

Example :

SearchStringinfile(‘subway’)=true   then rename to food-expense-todaydate.todaytime.pdf
Where “SearchStringinfile(‘subway’)” is ANY method to do it. Like a content rule.

Thanks in advance
3 REPLIES 3

fcastell
Champ in-the-making
Champ in-the-making
Anyone?

  got ANY Idea?

invictus9
Champ in-the-making
Champ in-the-making
I presume that you start with a list of such keywords?

You can create a script in the Javascript programming language that can be run when a file is placed in a folder. Check the Alfresco wiki for more information about creating such scripts.

You can have the script invoke the full text search services to search the content of the file. You would constrain the search by including the full path to the containing folder, so that only files in the local folder were to be searched. Then, match the search results against the current file. Each keyword would be done as a separate search.

Alternatively, if you were working with text files, you could look inside the content of each file using a pattern to pick off the list of keywords.

The advantage to the full text search services is that they understand all of the document formats that Alfresco supports, and can be reconfigured to support international character sets, and rules of languages other than English.

fcastell
Champ in-the-making
Champ in-the-making
Thanks.  i'll look into that