cancel
Showing results for 
Search instead for 
Did you mean: 

I need to associate files after upload

nefurm
Champ in-the-making
Champ in-the-making
Hello, we are working with a TV channel and they have a special association need. After the upload of a HD video they need to generate a LD version of the video and associate it with the HD video. Also they can have pictures and audio files associated with the HD video.
We already create the video metadata "extracter", a custom model that have a stdVideoModel, a HDVideoModel that extends the stdVideoModel and a LDVideoModel that also extends the stdVideoModel. The HDVideoModel have the following associations:

<association name="video:baixa">
   <title>Video de Baixa</title>
   <source>
      <mandatory>false</mandatory>
      <many>false</many>
   </source>
   <target>
      <class>video:baixa</class>
      <mandatory>false</mandatory>
      <many>false</many>
   </target>
</association>
<association name="video:audio">
   <title>Audios</title>
   <source>
      <mandatory>false</mandatory>
      <many>true</many>
   </source>
   <target>
      <class>audio:audio</class>
      <mandatory>false</mandatory>
      <many>true</many>
   </target>
</association>
<association name="video:exif">
   <title>Fotos</title>
   <source>
      <mandatory>false</mandatory>
      <many>true</many>
   </source>
   <target>
      <class>exif:exif</class>
      <mandatory>false</mandatory>
      <many>true</many>
   </target>
</association>

I thought about creating a custom behavior that associate files by file name. In that case, if my video has the name DDMMYYYYSEP.mov, all files with the same name _id.jpg would be associated as pictures and all files with the same name _id.wav or _id.mp3 would be associated as audio. Is that the right path to follow?
5 REPLIES 5

kaynezhang
World-Class Innovator
World-Class Innovator
Why not use rendition service?

nefurm
Champ in-the-making
Champ in-the-making
I believe I could use the rendition service during the transformation from HD to LD, but all the audios and pictures are not inserted synchronously. They can insert 10 pictures today, and another 10 tomorrow. In the studio the two things that can link a picture and a video today are the folder and the name. How should I use the rendition service in that case?

kaynezhang
World-Class Innovator
World-Class Innovator
Yes ,in your case rendition  service is not a good option.
You can alos consider using  rule and action

nefurm
Champ in-the-making
Champ in-the-making
I scratched some rules here, but could not find anything like, if you find this name pattern, associate with that file pattern.

I thought about using this two scripts that are described in the Alfresco Developer Guide Book (2008)
<blockquote>Creating Associations
Now let's switch back to the Java Web Services API and look at a class that creates a related-documents association between two documents.
The high-level steps are essentially the same as in the earlier Java example:
1. Create the references and objects the CML needs.
2. Set up the CML objects.
3. Execute the CML and dump the results.
This class is called com.someco.examples.SomeCoDataRelater. The class is runnable and accepts a source UUID and a target UUID as arguments. You can get them from the output of the SomeCoDataCreator class.</blockquote>
and
<blockquote>Searching for Content
Now that you have some content in the repository, you can test out Alfresco's full-text search engine, Lucene. Content in the repository is synchronously indexed by Lucene when it is created. Query strings use the Lucene query syntax to find content based on full-text content, property values, path, and content type.
Let's review some code that will show several different examples of Alfresco queries using Lucene. The code will:
1. Authenticate to start a session.
2. Get a reference to the node where the search should start.
3. Establish a query object using the Lucene query string.
4. Execute the query and dump the results.</blockquote>
pages 94 to 96
The first one would associate two contents, and the second would search for the contents to associate with
I just dont know if this is the best aproach

kaynezhang
World-Class Innovator
World-Class Innovator
Can't you create a folder and save all the LD, audios and pictures into the folder,then associate this folder(or all nodes under this folder) with the HD node?