You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@roller.apache.org by "Emmanouil Batsis (Manos)" <ma...@abiss.gr> on 2010/04/26 11:20:43 UTC

Structure of uploads.dir/mediafiles.storage.dir? (was: Re: Error in Media File view)

Is the structure of these dirs documented anywhere? Is it just the blog 
name and what the blog user creates after that? I need to patch the 
Media File stuff for my upgrade to work - my previous 4.0 installation 
had created no directories for the blogs as no images had actually been 
uploaded and not errors appear in the admin pages.

MAnos

Emmanouil Batsis (Manos) wrote:
> Dave wrote:
>> On Wed, Apr 14, 2010 at 11:03 AM, Emmanouil Batsis (Manos)
>> <ma...@abiss.gr> wrote:
>>> Using the trunk, I tried clicking 'Media Files' and got the following
>>> exception in the logs. Is there any chance the blog-specific media
>>> directories need to be created if they don't exist? Do i need to 
>>> patch this
>>> or is there anything else going on? Ideas welcome!
>>
>>> java.lang.NullPointerException
>>>        at
>>> org.apache.roller.weblogger.ui.struts2.editor.MediaFileView.execute(MediaFileView.java:185) 
>>>
>>
>> Here's some context for that NullPointerException:
>>
>>             MediaFileDirectory directory;
>>             if (StringUtils.isNotEmpty(this.directoryId)) {
>>                 directory = 
>> manager.getMediaFileDirectory(this.directoryId);
>>             } else if (StringUtils.isNotEmpty(this.directoryPath)) {
>>                 directory =
>> manager.getMediaFileDirectoryByPath(getActionWeblog(),
>> this.directoryPath);
>>             } else {
>>                 directory =
>> manager.getMediaFileRootDirectory(getActionWeblog());
>>             }
>>             this.directoryId = directory.getId();  // this is line 185
>>
>> It appears that, perhaps, you don't have a media file root directory
>> for your weblog and therefore directory is null. Can you tell some
>> more about your install? Was it an upgrade or a fresh install?
> 
> 
> An upgrade, but the previous installation had no blog dirs (in 
> uploads.dir) for the new version to upgrade towards the media files 
> directory. I think all images where hosted in a remote server, so 
> perhaps directories where never created?
> 


-- 
Manos Batsis, Chief Technologist
          __    _
   ____ _/ /_  (_)_________ ____ ______
  / __ `/ __ \/ / ___/ ___// __ `/ ___/
/ /_/ / /_/ / (__  |__  )/ /_/ / /
\__,_/_.___/_/____/____(_)__, /_/
                         /____/
http://www.Abiss.gr
19, Kalvou Street,
14231, Nea Ionia,
Athens, Greece

Tel: +30 211-1027-900
Fax: +30 211-1027-999

http://gr.linkedin.com/in/manosbatsis


Re: Structure of uploads.dir/mediafiles.storage.dir? (was: Re: Error in Media File view)

Posted by Dave <sn...@gmail.com>.
Hi Manos,

The structure is simple: mediafile directory contains subdirectory for
each weblog (named with weblog handle) and each subdirectory contains
files (named with a GUID value).

If you define both an old updates directory (i.e. uploads.dir) and a
new mediafiles directory (i.e. mediafiles.storage.dir), then Roller
will attempt to migrate your data from old to new. When Roller is done
it will place a migration-status.properties file in the old uploads
directory to indicate that it has been successfully migrated.

- Dave

PS. see JPAMediaFileManagerImpl.java for the code described above.



On Mon, Apr 26, 2010 at 5:20 AM, Emmanouil Batsis (Manos)
<ma...@abiss.gr> wrote:
>
> Is the structure of these dirs documented anywhere? Is it just the blog name
> and what the blog user creates after that? I need to patch the Media File
> stuff for my upgrade to work - my previous 4.0 installation had created no
> directories for the blogs as no images had actually been uploaded and not
> errors appear in the admin pages.
>
> MAnos
>
> Emmanouil Batsis (Manos) wrote:
>>
>> Dave wrote:
>>>
>>> On Wed, Apr 14, 2010 at 11:03 AM, Emmanouil Batsis (Manos)
>>> <ma...@abiss.gr> wrote:
>>>>
>>>> Using the trunk, I tried clicking 'Media Files' and got the following
>>>> exception in the logs. Is there any chance the blog-specific media
>>>> directories need to be created if they don't exist? Do i need to patch
>>>> this
>>>> or is there anything else going on? Ideas welcome!
>>>
>>>> java.lang.NullPointerException
>>>>       at
>>>>
>>>> org.apache.roller.weblogger.ui.struts2.editor.MediaFileView.execute(MediaFileView.java:185)
>>>
>>> Here's some context for that NullPointerException:
>>>
>>>            MediaFileDirectory directory;
>>>            if (StringUtils.isNotEmpty(this.directoryId)) {
>>>                directory =
>>> manager.getMediaFileDirectory(this.directoryId);
>>>            } else if (StringUtils.isNotEmpty(this.directoryPath)) {
>>>                directory =
>>> manager.getMediaFileDirectoryByPath(getActionWeblog(),
>>> this.directoryPath);
>>>            } else {
>>>                directory =
>>> manager.getMediaFileRootDirectory(getActionWeblog());
>>>            }
>>>            this.directoryId = directory.getId();  // this is line 185
>>>
>>> It appears that, perhaps, you don't have a media file root directory
>>> for your weblog and therefore directory is null. Can you tell some
>>> more about your install? Was it an upgrade or a fresh install?
>>
>>
>> An upgrade, but the previous installation had no blog dirs (in
>> uploads.dir) for the new version to upgrade towards the media files
>> directory. I think all images where hosted in a remote server, so perhaps
>> directories where never created?
>>
>
>
> --
> Manos Batsis, Chief Technologist
>         __    _
>  ____ _/ /_  (_)_________ ____ ______
>  / __ `/ __ \/ / ___/ ___// __ `/ ___/
> / /_/ / /_/ / (__  |__  )/ /_/ / /
> \__,_/_.___/_/____/____(_)__, /_/
>                        /____/
> http://www.Abiss.gr
> 19, Kalvou Street,
> 14231, Nea Ionia,
> Athens, Greece
>
> Tel: +30 211-1027-900
> Fax: +30 211-1027-999
>
> http://gr.linkedin.com/in/manosbatsis
>
>