OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Router - change/truncate pathname for uploads

Are you responsible for making OMP work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, michael, asmecher

Forum rules
What to do if you have a technical problem with OMP:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OMP Discussion subforum; if you have a development question, try the OMP Development subforum.

Router - change/truncate pathname for uploads

Postby rootl » Tue Apr 30, 2013 6:37 am

Hello,
We need to remove the $$$call$$$ string and anything else that is appended to the file name of uploaded submission files. We would like to have more control over rewriting the pathnames to these files. We are very familiar with htaccess and mod_rewrite but would like to know of anything special to be done in the PKPComponentRouter.inc.php and any other corresponding scripts (ie CatalogEntryTabHandler.js) Please let us know what can be done. Thank you very much.
rootl
 
Posts: 62
Joined: Wed Feb 20, 2013 7:17 am

Re: Router - change/truncate pathname for uploads

Postby asmecher » Tue Apr 30, 2013 7:44 am

Hi rootl,

That would be a substantial change to the router code. Could you describe what you'd like to accomplish? Maybe I can suggest another way of achieving it.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8869
Joined: Wed Aug 10, 2005 12:56 pm

Re: Router - change/truncate pathname for uploads

Postby calibre » Tue Apr 30, 2013 8:00 am

We don't want the filename to be rewritten and have extra strings before it. A friendlier URL or "permalink," if possible.

Basically, for example, instead of:

http://ourlibrarysitename/omp/index.php ... fda5363db4

We would like http://ourlibrarysitename/omp/index.php ... ge-or-file

Thanks.
calibre
 
Posts: 7
Joined: Thu Mar 14, 2013 11:52 am

Re: Router - change/truncate pathname for uploads

Postby asmecher » Tue Apr 30, 2013 8:36 am

Hi calibre,

Are you looking specifically for a way to do this with cover images, or other types of files as well?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8869
Joined: Wed Aug 10, 2005 12:56 pm

Re: Router - change/truncate pathname for uploads

Postby calibre » Wed May 01, 2013 8:29 am

We are looking to do do this with all files - pdfs, images, documents - everything.

We do not want to have any # or $ appended to the filenames themselves either.

Also, is there a way to rename the press names with the actual name of the Press, instead of 1, 2, 3 ? Thanks. I can submit this question separately if needed.
calibre
 
Posts: 7
Joined: Thu Mar 14, 2013 11:52 am

Re: Router - change/truncate pathname for uploads

Postby asmecher » Wed May 01, 2013 9:21 am

Hi calibre,

It sounds like what you're looking for is permalinks to those pieces of content in order to link to them from outside OMP. The $$$call$$$ URLs are not intended for that purpose, as you've seen. The quickest way to get permalinks of the sort you're looking for is probably to add a few small pieces of resolver code, which would live at URLs of the sort you're looking for and respond with HTTP redirects to the current URLs that OMP uses. That would be relatively easy to add and wouldn't involve restructing OMP's router code or moving around pieces of existing content. However, it would take some PHP skill to do it.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8869
Joined: Wed Aug 10, 2005 12:56 pm


Return to OMP Technical Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron