[greenstone-users] Re: UnknownPlug & PDF filename

From Katherine Don
DateMon, 25 Sep 2006 11:33:50 +1200
Subject [greenstone-users] Re: UnknownPlug & PDF filename
In-Reply-To (20060922065757-77402-qmail-web8912-mail-in-yahoo-com)
Hi Sharad,

Sorry about that. Yes, you also have to change

$doc_obj->add_metadata ($section, $assoc_field, $file);
(in the same function as before).

Change $file to "doc.pdf".

Cheers,
Katherine

Sharad Jadhav wrote:
> Hi Katherine,
>
> Thanks a lot for your reply. I have modified the
> UnknownPlug.pm file and now all files are saved as
> doc.pdf. When I opened the doc.xml file in archives
> directory I still find following info
>
> <Metadata name="unknown_file">COMMUNICATION
> SKILLS.pdf</Metadata>
>
> <Metadata name="srclink"><a
> href="/gsdl/collect/[collection]/index/assoc/[assocfilepath]/[unknown_file]"></Metadata>
>
>
> This is making the links for the file as original
> filename and not for doc.pdf and hence the HTTP 404 -
> File not found error is displayed.
>
> What are the changes I have to make to resolve the
> problem?
>
> Thanks once again,
>
> Regards,
>
> Sharad
>
>
>
> --- Katherine Don <kjdon@cs.waikato.ac.nz> wrote:
>
>
>>Hi Sharad
>>
>>You can do it if you modify the plugin.
>>
>>In greenstone/perllib/plugins/UnknownPlug.pm, look
>>for the line like
>>$doc_obj->associate_file($filename, $file,
>>$mime_type, $section);
>>in function associate_unknown_file
>>
>>THe first argument to associate file ($filename) is
>>the full path to the
>>existing file, the second argument ($file) is the
>>file name for the
>>copied file.
>>If you change $file to "doc.pdf" then the files will
>>be saved as doc.pdf
>> instead of their original filename.
>>
>>This will apply to all files and all collections
>>though. I suggest you
>>put a copy of PDFPlug.pm into the collection that
>>you want this
>>behaviour
>>(collect/collname/perllib/plugins/PDFPlug.pm).
>>Then modify the collection one, rather than the main
>>one.
>>When you rebuild the collection, it should use the
>>collection version in
>>preference to the main version.
>>
>>Regards,
>>Katherine
>>
>>Sharad Jadhav wrote:
>>
>>>Hi,
>>>
>>>I am using UnknownPlug for processing secured PDf
>>>documents (as these cannot be converted by
>>
>>PDFPlug).
>>
>>>If we use PDFPlug to process the PDF files, the
>>
>>final
>>
>>>processed pdf file name is always doc.pdf, incase
>>
>>of
>>
>>>UnknownPlug, original file names are preserved
>>
>>such as
>>
>>>abcd.pdf or xyz.pdf, I wish to have final filename
>>
>>as
>>
>>>doc.pdf when I use UnknownPlug.
>>>
>>>UnknownPlug -file_format PDF -mime_type
>>>application/PDF -process_extension pdf -srcicon
>>>iconpdf
>>>
>>>Is this possible with UnknownPlug?
>>>
>>>Regards,
>>>
>>>Sharad
>>>
>>>
>>>
>>>
>>>
>>
> __________________________________________________________
>
>>>Yahoo! India Answers: Share what you know. Learn
>>
>>something new
>>
>>>http://in.answers.yahoo.com/
>>>
>>>_______________________________________________
>>>greenstone-devel mailing list
>>>greenstone-devel@list.scms.waikato.ac.nz
>>>
>>
> https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-devel
>
>>>
>
>
>
>
> __________________________________________________________
> Yahoo! India Answers: Share what you know. Learn something new
> http://in.answers.yahoo.com/
>
>