# Copyright (c) 2011 bivio Software, Inc. All Rights Reserved. # # Visit http://www.bivio.biz for more info. # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; If not, you may get a copy from: # http://www.opensource.org/licenses/lgpl-license.html # # $Id: RealmFolderFileList.pm,v 2.1 2011/03/23 19:18:20 moeller Exp $ package Bivio::Biz::Model::RealmFolderFileList; use strict; use Bivio::Base 'Model.RealmFileTreeList'; our($VERSION) = sprintf('%d.%02d', q$Revision: 2.1 $ =~ /\d+/g); sub PAGE_SIZE { return 200; } sub get_folder_path { my($self) = @_; return $self->new_other('RealmFile')->load({ realm_file_id => $self->internal_root_parent_node_id, })->get('path'); } sub internal_initialize { my($self) = @_; my($ii) = $self->merge_initialize_info($self->SUPER::internal_initialize, { parent_id => 'RealmFile.folder_id', other => [ ['RealmFile.is_folder', [0]], ], }); delete($ii->{other_query_keys}); return $ii; } sub internal_prepare_statement { my($self, $stmt) = @_; $self->new_other('RealmFileList')->prepare_statement_for_access_mode($stmt, b_use('Type.DocletFileName')); return shift->SUPER::internal_prepare_statement(@_); } sub internal_root_parent_node_id { my($self) = @_; return $self->get_query->get('parent_id'); } 1;