diff --git a/app/Http/Controllers/Frontend/SitelinkController.php b/app/Http/Controllers/Frontend/SitelinkController.php index 27c6823..0655510 100644 --- a/app/Http/Controllers/Frontend/SitelinkController.php +++ b/app/Http/Controllers/Frontend/SitelinkController.php @@ -16,7 +16,9 @@ class SitelinkController extends Controller ->where('server_state', 'LIKE', "%" . $serverState . "%"); $select - ->select(DB::raw('YEAR(server_date_published) as published_date')) + // ->select(DB::raw('EXTRACT(YEAR FROM server_date_published) as published_date')) + // ->select(DB::raw("DATE_PART('year', server_date_published) as published_date")) + ->select(DB::raw("YEAR(server_date_published) AS published_date")) ->distinct(true); $this->years = $select->pluck('published_date'); diff --git a/app/Http/Controllers/Oai/RequestController.php b/app/Http/Controllers/Oai/RequestController.php index 7533ce6..1a56d38 100644 --- a/app/Http/Controllers/Oai/RequestController.php +++ b/app/Http/Controllers/Oai/RequestController.php @@ -148,7 +148,7 @@ class RequestController extends Controller $repositoryName = "RDR - Data Research Repository"; $repIdentifier = "rdr.gba.ac.at"; $sampleIdentifier = "oai:" . $repIdentifier . ":27";//$this->_configuration->getSampleIdentifier(); - $earliestDateFromDb = Dataset::earliestPublicationDate(); + $earliestDateFromDb = Dataset::earliestPublicationDate()->get('server_date_published'); // set parameters for oai-pmh.xslt $this->_proc->setParameter('', 'email', $email); diff --git a/app/Models/Dataset.php b/app/Models/Dataset.php index 901a684..08c2486 100644 --- a/app/Models/Dataset.php +++ b/app/Models/Dataset.php @@ -258,11 +258,12 @@ class Dataset extends Model if (!$column) { $column = self::PUBLISHED_AT; } - return $query->whereNotNull('server_date_published') + return $query->select('server_date_published') + ->where('server_date_published', '<>', null) ->where('server_state', 'published') ->orderBy('server_date_published', 'asc') - ->first() - ->server_date_published; + ->first(); + //->server_date_published; } public function setServerState($targetType) diff --git a/config/database.php b/config/database.php index aaf5c68..8d9b3db 100755 --- a/config/database.php +++ b/config/database.php @@ -51,6 +51,19 @@ return [ 'database' => storage_path().'/database.db', 'prefix' => '', ], + + 'pgsql' => [ + 'driver' => 'pgsql', + 'host' => env('DB_HOST', 'pgsql'), + 'port' => env('DB_PORT', '5432'), + 'database' => env('DB_DATABASE', 'repository'), + 'username' => env('DB_USERNAME', 'opus4admin'), + 'password' => env('DB_PASSWORD', 'opus4admin007'), + 'charset' => 'utf8', + 'prefix' => '', + 'schema' => 'public', + 'sslmode' => 'prefer', + ], 'sqlsrv' => [ diff --git a/config/entrust.php b/config/entrust.php index 98b4e15..b103523 100644 --- a/config/entrust.php +++ b/config/entrust.php @@ -29,7 +29,7 @@ return [ | This is the roles table used by Entrust to save roles to the database. | */ - 'roles_table' => 'user_roles', //'roles', + 'roles_table' => 'roles', //'roles', /* |-------------------------------------------------------------------------- diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php deleted file mode 100755 index ef22e6b..0000000 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ /dev/null @@ -1,36 +0,0 @@ -increments('id'); - $table->string('name'); - $table->string('email')->unique(); - $table->string('password', 60); - $table->rememberToken(); - $table->nullableTimestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('users'); - } - -} diff --git a/database/migrations/2014_10_12_100000_create_password_resets_table.php b/database/migrations/2014_10_12_100000_create_password_resets_table.php deleted file mode 100755 index 679df38..0000000 --- a/database/migrations/2014_10_12_100000_create_password_resets_table.php +++ /dev/null @@ -1,33 +0,0 @@ -string('email')->index(); - $table->string('token')->index(); - $table->timestamp('created_at'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('password_resets'); - } - -} diff --git a/database/migrations/2015_06_09_041120_create_categories_table.php b/database/migrations/2015_06_09_041120_create_categories_table.php deleted file mode 100755 index 46713ae..0000000 --- a/database/migrations/2015_06_09_041120_create_categories_table.php +++ /dev/null @@ -1,33 +0,0 @@ -increments('id'); - $table->string('category'); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('categories'); - } - -} diff --git a/database/migrations/2015_06_09_041145_create_shelves_table.php b/database/migrations/2015_06_09_041145_create_shelves_table.php deleted file mode 100755 index 146ddb4..0000000 --- a/database/migrations/2015_06_09_041145_create_shelves_table.php +++ /dev/null @@ -1,33 +0,0 @@ -increments('id'); - $table->string('shelf'); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('shelves'); - } - -} diff --git a/database/migrations/2015_06_09_041219_create_periodes_table.php b/database/migrations/2015_06_09_041219_create_periodes_table.php deleted file mode 100755 index 4b61960..0000000 --- a/database/migrations/2015_06_09_041219_create_periodes_table.php +++ /dev/null @@ -1,33 +0,0 @@ -increments('id'); - $table->integer('days'); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('periodes'); - } - -} diff --git a/database/migrations/2015_06_18_030231_create_lac.php b/database/migrations/2015_06_18_030231_create_lac.php deleted file mode 100755 index b8fed81..0000000 --- a/database/migrations/2015_06_18_030231_create_lac.php +++ /dev/null @@ -1,39 +0,0 @@ -increments('id'); - $table->string('name'); - $table->timestamps(); - }); - - Schema::create('role_user', function(Blueprint $table){ - $table->unsignedInteger('user_id'); - $table->unsignedInteger('role_id'); - $table->primary(['user_id', 'role_id']); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('roles'); - Schema::drop('role_user'); - } - -} diff --git a/database/migrations/2017_06_01_100607_create_transactions_table.php b/database/migrations/2017_06_01_100607_create_transactions_table.php deleted file mode 100644 index b34f6fc..0000000 --- a/database/migrations/2017_06_01_100607_create_transactions_table.php +++ /dev/null @@ -1,46 +0,0 @@ -increments('id'); - $table->integer('student_id')->unsigned(); - $table->foreign('student_id')->references('id')->on('students'); - $table->integer('book_id')->unsigned(); - $table->foreign('book_id')->references('id')->on('books'); - $table->integer('borrowed_at'); - $table->integer('returned_at')->default('0'); - $table->integer('fines')->default('0'); - $table->boolean('status')->default('0'); - $table->timestamps(); - }); - // Schema::table('transactions', function($table) { - // $table->foreign('student_id')->references('id')->on('students'); - // }); - // Schema::table('transactions', function($table) { - // $table->foreign('book_id')->references('id')->on('books'); - // }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('transactions'); - } - -} diff --git a/database/migrations/2017_06_01_104359_create_books_table.php b/database/migrations/2017_06_01_104359_create_books_table.php deleted file mode 100644 index 2cf6ed7..0000000 --- a/database/migrations/2017_06_01_104359_create_books_table.php +++ /dev/null @@ -1,41 +0,0 @@ -increments('id'); - $table->string('title'); - $table->string('author'); - $table->integer('year'); - $table->integer('stock'); - $table->integer('category_id')->unsigned(); - $table->foreign('category_id')->references('id')->on('categories'); - $table->integer('shelf_id')->unsigned(); - $table->foreign('shelf_id')->references('id')->on('shelves'); - $table->integer('year_id')->default('0'); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('books'); - } - -} diff --git a/database/migrations/2017_07_05_091036_create_collections_table.php b/database/migrations/2017_07_05_091036_create_collections_table.php deleted file mode 100644 index 4a3b923..0000000 --- a/database/migrations/2017_07_05_091036_create_collections_table.php +++ /dev/null @@ -1,36 +0,0 @@ -increments('id'); - $table->string('number', 255)->nullable(); - $table->string('name', 255)->nullable(); - $table->string('oai_subset', 255)->nullable(); - $table->integer('parent_id')->unsigned()->nullable(); - $table->foreign('parent_id')->references('id')->on('collections')->onDelete('cascade'); - $table->boolean('visible')->default('1'); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('collections'); - } -} diff --git a/database/migrations/2017_07_05_133454_create_link_documents_collections.php b/database/migrations/2017_07_05_133454_create_link_documents_collections.php deleted file mode 100644 index 2fb00ba..0000000 --- a/database/migrations/2017_07_05_133454_create_link_documents_collections.php +++ /dev/null @@ -1,43 +0,0 @@ -increments('id'); - - $table->unsignedInteger('collection_id')->nullable()->index(); - $table->foreign('collection_id') - ->references('id')->on('collections') - ->onDelete('set null'); - //->onDelete('cascade'); - - $table->unsignedInteger('document_id')->nullable()->index(); - $table->foreign('document_id') - ->references('id')->on('documents') - ->onDelete('set null'); - //->onDelete('cascade'); - - $table->primary(['collection_id', 'document_id']); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('link_documents_collections'); - } -} diff --git a/database/migrations/2018_02_22_134500_create_persons_table.php b/database/migrations/2018_02_22_134500_create_persons_table.php deleted file mode 100644 index 55825d0..0000000 --- a/database/migrations/2018_02_22_134500_create_persons_table.php +++ /dev/null @@ -1,59 +0,0 @@ -increments('id'); - - $table->string('name'); - $table->integer('registered_at'); - $table->boolean('status')->default('1'); - - $table->timestamps(); - }); - - Schema::create('link_documents_persons', function (Blueprint $table) { - // $table->increments('id'); - - $table->unsignedInteger('person_id')->index('ix_fk_link_documents_persons_persons'); - $table->foreign('person_id', 'fk_link_documents_persons_persons') - ->references('id')->on('persons') - ->onDelete('no action')->onUpdate('no action');//detach the relation via code - - $table->unsignedInteger('document_id')->index('ix_fk_link_persons_documents_documents'); - $table->foreign('document_id','fk_link_persons_documents_documents') - ->references('id')->on('documents') - ->onDelete('cascade')->onUpdate('cascade'); - - $table - ->enum('role', ['advisor', 'author', 'contributor', 'editor', 'referee', 'other', 'translator', 'submitter']) - ->default('author'); - - $table->primary(['person_id', 'document_id', 'role']); - - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('persons'); - Schema::drop('link_persons_documents'); - } - -} diff --git a/database/migrations/2018_06_25_135711_create_permission_tables.php b/database/migrations/2018_06_25_135711_create_permission_tables.php deleted file mode 100644 index 1224914..0000000 --- a/database/migrations/2018_06_25_135711_create_permission_tables.php +++ /dev/null @@ -1,91 +0,0 @@ -increments('id'); - $table->string('name'); - $table->string('guard_name'); - $table->timestamps(); - }); - - Schema::create($tableNames['roles'], function (Blueprint $table) { - $table->increments('id'); - $table->string('name'); - $table->string('guard_name'); - $table->timestamps(); - }); - - Schema::create($tableNames['model_has_permissions'], function (Blueprint $table) use ($tableNames) { - $table->unsignedInteger('permission_id'); - $table->morphs('model'); - - $table->foreign('permission_id') - ->references('id') - ->on($tableNames['permissions']) - ->onDelete('cascade'); - - $table->primary(['permission_id', 'model_id', 'model_type'], 'model_has_permissions_permission_model_type_primary'); - }); - - Schema::create($tableNames['model_has_roles'], function (Blueprint $table) use ($tableNames) { - $table->unsignedInteger('role_id'); - $table->morphs('model'); - - $table->foreign('role_id') - ->references('id') - ->on($tableNames['roles']) - ->onDelete('cascade'); - - $table->primary(['role_id', 'model_id', 'model_type']); - }); - - Schema::create($tableNames['role_has_permissions'], function (Blueprint $table) use ($tableNames) { - $table->unsignedInteger('permission_id'); - $table->unsignedInteger('role_id'); - - $table->foreign('permission_id') - ->references('id') - ->on($tableNames['permissions']) - ->onDelete('cascade'); - - $table->foreign('role_id') - ->references('id') - ->on($tableNames['roles']) - ->onDelete('cascade'); - - $table->primary(['permission_id', 'role_id']); - - app('cache')->forget('spatie.permission.cache'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - $tableNames = config('permission.table_names'); - - Schema::drop($tableNames['role_has_permissions']); - Schema::drop($tableNames['model_has_roles']); - Schema::drop($tableNames['model_has_permissions']); - Schema::drop($tableNames['roles']); - Schema::drop($tableNames['permissions']); - } -} diff --git a/database/migrations/2019_08_28_070144_create_accounts_table.php b/database/migrations/2019_08_28_070144_create_accounts_table.php new file mode 100644 index 0000000..d013cc2 --- /dev/null +++ b/database/migrations/2019_08_28_070144_create_accounts_table.php @@ -0,0 +1,37 @@ +increments('id'); + $table->string('login', 20); + $table->string('password', 60); + $table->string('email')->unique(); + $table->string('first_name', 255)->nullable(); + $table->string('last_name', 255)->nullable(); + $table->rememberToken(); + $table->nullableTimestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('accounts'); + } +} diff --git a/database/migrations/2019_08_28_074630_create_roles_table.php b/database/migrations/2019_08_28_074630_create_roles_table.php new file mode 100644 index 0000000..28234ea --- /dev/null +++ b/database/migrations/2019_08_28_074630_create_roles_table.php @@ -0,0 +1,79 @@ +increments('id'); + $table->string('name', 255); + $table->string('display_name', 255)->nullable(); + $table->string('description', 255)->nullable(); + $table->nullableTimestamps(); + }); + + // Create table for associating roles to accounts (Many-to-Many) + Schema::create('link_accounts_roles', function (Blueprint $table) { + $table->unsignedInteger('account_id')->unsigned(); + $table->unsignedInteger('role_id')->unsigned(); + + $table->foreign('account_id') + ->references('id')->on('accounts') + ->onDelete('cascade')->onUpdate('cascade'); + $table->foreign('role_id') + ->references('id')->on('roles') + ->onDelete('cascade')->onUpdate('cascade'); + + $table->primary(['account_id', 'role_id']); + }); + + // Create table for storing permissions + Schema::create('permissions', function (Blueprint $table) { + $table->increments('id'); + $table->string('name')->unique(); + $table->string('display_name', 100); + $table->string('description', 255)->nullable(); + $table->timestamps(); + }); + + // Create table for associating permissions to roles (Many-to-Many) + Schema::create('role_has_permissions', function (Blueprint $table) { + $table->integer('permission_id')->unsigned(); + $table->integer('role_id')->unsigned(); + + $table->foreign('permission_id')->references('id')->on('permissions') + ->onUpdate('cascade')->onDelete('cascade'); + $table->foreign('role_id')->references('id')->on('roles') + ->onUpdate('cascade')->onDelete('cascade'); + + $table->primary(['permission_id', 'role_id']); + }); + + DB::commit(); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('role_has_permissions'); + Schema::dropIfExists('permissions'); + Schema::dropIfExists('link_accounts_roles'); + Schema::dropIfExists('roles'); + } +} diff --git a/database/migrations/2017_07_05_124312_create_documents_table.php b/database/migrations/2019_08_28_083531_create_projects_table.php similarity index 54% rename from database/migrations/2017_07_05_124312_create_documents_table.php rename to database/migrations/2019_08_28_083531_create_projects_table.php index 0e0eb71..543ca45 100644 --- a/database/migrations/2017_07_05_124312_create_documents_table.php +++ b/database/migrations/2019_08_28_083531_create_projects_table.php @@ -1,9 +1,10 @@ increments('id'); - $table->string('publication_state', 100)->default('draft');; - $table->boolean('belongs_to_bibliography')->default('0'); + $table->string('label', 10); + $table->string('name', 255); + $table->string('description', 255)->nullable(); $table->timestamps(); }); } @@ -27,6 +29,6 @@ class CreateDocumentsTable extends Migration */ public function down() { - Schema::drop('documents'); + Schema::dropIfExists('projects'); } } diff --git a/database/migrations/2019_08_28_083836_create_documents_table.php b/database/migrations/2019_08_28_083836_create_documents_table.php new file mode 100644 index 0000000..c4b34e3 --- /dev/null +++ b/database/migrations/2019_08_28_083836_create_documents_table.php @@ -0,0 +1,56 @@ +increments('id'); + $table->string('contributing_corporation', 50)->nullable(); + $table->string('creating_corporation', 50); + $table->dateTime('embargo_date'); + $table->integer('project_id')->unsigned()->nullable(); + $table->foreign('project_id')->references('id')->on('projects'); + $table->enum( + 'type', + ['analysisdata', 'interpreteddata', 'measurementdata', 'models', 'rawdata', 'supplementarydata', 'mixedtype'] + ); + $table->string('language', 10); + $table->enum( + 'server_state', + ['deleted', 'inprogress', 'published', 'released', 'editor_accepted', 'approved', 'rejected_reviewer', 'rejected_editor', 'reviewed'] + )->default('inprogress'); + $table->boolean('belongs_to_bibliography')->default(0); + $table->dateTime('created_at'); + $table->dateTime('server_date_modified'); + $table->dateTime('server_date_published')->nullable(); + $table->integer('account_id')->unsigned()->nullable(); + $table->integer('editor_id')->unsigned()->nullable(); + $table->integer('reviewer_id')->unsigned()->nullable(); + $table->string('preferred_reviewer', 25)->nullable(); + $table->string('preferred_reviewer_email', 50)->nullable(); + $table->string('reject_editor_note', 255)->nullable(); + $table->string('reject_reviewer_note', 255)->nullable(); + $table->boolean('reviewer_note_visible')->default(false); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('documents'); + } +} diff --git a/database/migrations/2019_08_28_094055_create_persons_table.php b/database/migrations/2019_08_28_094055_create_persons_table.php new file mode 100644 index 0000000..ba3269c --- /dev/null +++ b/database/migrations/2019_08_28_094055_create_persons_table.php @@ -0,0 +1,59 @@ +increments('id'); + + $table->string('name'); + $table->integer('registered_at'); + $table->boolean('status')->default(1); + + $table->timestamps(); + }); + + Schema::create('link_documents_persons', function (Blueprint $table) { + // $table->increments('id'); + + $table->unsignedInteger('person_id')->index('ix_fk_link_documents_persons_persons'); + $table->foreign('person_id', 'fk_link_documents_persons_persons') + ->references('id')->on('persons') + ->onDelete('no action')->onUpdate('no action'); //detach the relation via code + + $table->unsignedInteger('document_id')->index('ix_fk_link_persons_documents_documents'); + $table->foreign('document_id', 'fk_link_persons_documents_documents') + ->references('id')->on('documents') + ->onDelete('cascade')->onUpdate('cascade'); + + $table + ->enum('role', ['author', 'contributor', 'other']) + ->default('other'); + $table->tinyInteger('sort_order'); + $table->boolean('allow_email_contact')->default(0); + $table->primary(['person_id', 'document_id', 'role']); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('link_documents_persons'); + Schema::dropIfExists('persons'); + + } +} diff --git a/database/migrations/2019_08_28_105907_create_licences_table.php b/database/migrations/2019_08_28_105907_create_licences_table.php new file mode 100644 index 0000000..e406053 --- /dev/null +++ b/database/migrations/2019_08_28_105907_create_licences_table.php @@ -0,0 +1,62 @@ +increments('id'); + $table->boolean('active')->default(true); + $table->string('comment_internal', 4000)->nullable(); + $table->string('desc_markup', 4000)->nullable(); + $table->string('desc_text', 4000)->nullable(); + $table->string('language', 3)->nullable(); + $table->string('link_licence', 200); + $table->string('link_logo', 200)->nullable(); + $table->string('link_sign', 200)->nullable(); + $table->string('mime_type', 30)->nullable(); + $table->string('name_long', 100); + $table->boolean('pod_allowed')->default(false); + $table->tinyInteger('sort_order'); + }); + + Schema::create('link_documents_licences', function (Blueprint $table) { + // $table->increments('id'); + + $table->unsignedInteger('licence_id')->index(); + $table->foreign('licence_id') + ->references('id')->on('document_licences') + ->onDelete('no action')->onUpdate('no action'); //detach the relation via code + + $table->unsignedInteger('document_id')->index(); + $table->foreign('document_id') + ->references('id')->on('documents') + ->onDelete('cascade')->onUpdate('cascade'); + + $table + ->enum('role', ['author', 'contributor', 'other']) + ->default('other'); + $table->primary(['licence_id', 'document_id']); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('link_documents_licences'); + Schema::dropIfExists('document_licences'); + } +} diff --git a/database/migrations/2019_08_28_121520_create_collections_table.php b/database/migrations/2019_08_28_121520_create_collections_table.php new file mode 100644 index 0000000..253dd5f --- /dev/null +++ b/database/migrations/2019_08_28_121520_create_collections_table.php @@ -0,0 +1,58 @@ +increments('id'); + $table->string('number', 255)->nullable(); + $table->string('name', 255)->nullable(); + $table->string('oai_subset', 255)->nullable(); + $table->integer('parent_id')->unsigned()->nullable(); + $table->foreign('parent_id') + ->references('id')->on('collections') + ->onUpdate('cascade')->onDelete('cascade'); + $table->boolean('visible')->default(1); + $table->boolean('visible_publish')->default(1); + $table->timestamps(); + }); + + Schema::create('link_documents_collections', function (Blueprint $table) { + // $table->increments('id'); + + $table->unsignedInteger('collection_id')->index(); + $table->foreign('collection_id') + ->references('id')->on('collections') + ->onDelete('cascade')->onUpdate('cascade'); //detach the relation via code + + $table->unsignedInteger('document_id')->index(); + $table->foreign('document_id') + ->references('id')->on('documents') + ->onDelete('cascade')->onUpdate('cascade'); + + $table->primary(['collection_id', 'document_id']); + }); + } + + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('link_documents_collections'); + Schema::dropIfExists('collections'); + } +} diff --git a/database/migrations/2019_08_28_160330_create_pages_table.php b/database/migrations/2019_08_28_160330_create_pages_table.php new file mode 100644 index 0000000..e1144d7 --- /dev/null +++ b/database/migrations/2019_08_28_160330_create_pages_table.php @@ -0,0 +1,54 @@ +increments('id'); + //$table->string('title', 191); + $table->string('page_slug', 191)->unique(); + //$table->text('description')->nullable(); + $table->string('cannonical_link', 191)->nullable(); + $table->string('seo_title', 191)->nullable(); + $table->string('seo_keyword', 191)->nullable(); + $table->text('seo_description')->nullable(); + $table->boolean('status')->default(true); + $table->integer('created_by'); + $table->integer('updated_by')->nullable(); + $table->dateTime('created_at')->unsigned(); + $table->dateTime('updated_at')->unsigned()->nullable(); + }); + + Schema::create('page_translations', function (Blueprint $table) { + $table->increments('id'); + $table->integer('page_id')->unsigned(); + $table->unique(['page_id','locale']); + $table->foreign('page_id')->references('id')->on('pages')->onDelete('cascade'); + + $table->string('locale')->index(); + $table->string('title'); + $table->text('description'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('page_translations'); + Schema::dropIfExists('pages'); + } +} diff --git a/database/migrations/2019_08_29_075029_create_dataset_titles_table.php b/database/migrations/2019_08_29_075029_create_dataset_titles_table.php new file mode 100644 index 0000000..b728b62 --- /dev/null +++ b/database/migrations/2019_08_29_075029_create_dataset_titles_table.php @@ -0,0 +1,37 @@ +increments('id'); + $table->integer('document_id')->unsigned(); + + $table->foreign('document_id')->references('id')->on('documents') + ->onUpdate('cascade')->onDelete('cascade'); + + $table->text('value'); + $table->string('language', 3); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('dataset_titles'); + } +} diff --git a/database/migrations/2019_08_29_075729_create_dataset_abstracts_table.php b/database/migrations/2019_08_29_075729_create_dataset_abstracts_table.php new file mode 100644 index 0000000..5f9dbfa --- /dev/null +++ b/database/migrations/2019_08_29_075729_create_dataset_abstracts_table.php @@ -0,0 +1,37 @@ +increments('id'); + $table->integer('document_id')->unsigned(); + + $table->foreign('document_id')->references('id')->on('documents') + ->onUpdate('cascade')->onDelete('cascade'); + + $table->text('value'); + $table->string('language', 3); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('dataset_abstracts'); + } +} diff --git a/database/migrations/2019_08_29_090936_create_languages_table.php b/database/migrations/2019_08_29_090936_create_languages_table.php new file mode 100644 index 0000000..2a24d03 --- /dev/null +++ b/database/migrations/2019_08_29_090936_create_languages_table.php @@ -0,0 +1,37 @@ +increments('id'); + $table->string('part2_b', 3); + $table->string('part2_t', 3); + $table->string('part1', 2); + $table->string('scope', 20); + $table->string('type', 20); + $table->string('ref_name', 150); + $table->boolean('active')->default(true); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('languages'); + } +} diff --git a/database/migrations/2019_08_29_115137_create_document_xml_cache_table.php b/database/migrations/2019_08_29_115137_create_document_xml_cache_table.php new file mode 100644 index 0000000..17165b4 --- /dev/null +++ b/database/migrations/2019_08_29_115137_create_document_xml_cache_table.php @@ -0,0 +1,33 @@ +integer('id')->primary(); + $table->integer('xml_version'); + $table->string('server_date_modified', 50)->nullable(); + $table->string('xml_data')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('document_xml_cache'); + } +} diff --git a/database/migrations/pages/2018_09_05_134425_create_pages_table.php b/database/migrations/pages/2018_09_05_134425_create_pages_table.php deleted file mode 100644 index 1ee1795..0000000 --- a/database/migrations/pages/2018_09_05_134425_create_pages_table.php +++ /dev/null @@ -1,41 +0,0 @@ -increments('id'); - $table->string('title', 191); - $table->string('page_slug', 191)->unique(); - $table->text('description', 65535)->nullable(); - $table->string('cannonical_link', 191)->nullable(); - $table->string('seo_title', 191)->nullable(); - $table->string('seo_keyword', 191)->nullable(); - $table->text('seo_description', 65535)->nullable(); - $table->boolean('status')->default(1); - $table->integer('created_by')->unsigned(); - $table->integer('updated_by')->unsigned()->nullable(); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('pages'); - } -} diff --git a/database/migrations/test/2018_02_19_120518_create_categories_table.php b/database/migrations/test/2018_02_19_120518_create_categories_table.php deleted file mode 100644 index a6d4d1d..0000000 --- a/database/migrations/test/2018_02_19_120518_create_categories_table.php +++ /dev/null @@ -1,32 +0,0 @@ -increments('id'); - $table->string('category'); - $table->timestamps(); - - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('categories'); - } -} diff --git a/database/migrations/test/2018_02_20_134555_create_books_table.php b/database/migrations/test/2018_02_20_134555_create_books_table.php deleted file mode 100644 index 658be25..0000000 --- a/database/migrations/test/2018_02_20_134555_create_books_table.php +++ /dev/null @@ -1,39 +0,0 @@ -increments('id'); - $table->string('title'); - $table->string('author'); - $table->integer('year'); - $table->integer('stock'); - $table->integer('category_id')->unsigned(); - $table->foreign('category_id')->references('id')->on('categories'); - //$table->integer('shelf_id')->unsigned(); - //$table->foreign('shelf_id');//->references('id')->on('shelves'); - $table->integer('year_id')->default('0'); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('books'); - } -} diff --git a/database/migrations/test/2018_02_20_135411_create_documents_table.php b/database/migrations/test/2018_02_20_135411_create_documents_table.php deleted file mode 100644 index 1576715..0000000 --- a/database/migrations/test/2018_02_20_135411_create_documents_table.php +++ /dev/null @@ -1,33 +0,0 @@ -increments('id'); - $table->string('type', 100); - $table->string('publication_state', 100)->default('draft'); - $table->boolean('belongs_to_bibliography')->default('0'); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('documents'); - } -} diff --git a/database/migrations/translation/2018_09_13_075552_create_page_translations_table.php b/database/migrations/translation/2018_09_13_075552_create_page_translations_table.php deleted file mode 100644 index fc528f5..0000000 --- a/database/migrations/translation/2018_09_13_075552_create_page_translations_table.php +++ /dev/null @@ -1,38 +0,0 @@ -increments('id'); - $table->integer('page_id')->unsigned(); - $table->string('locale')->index(); - - $table->string('title'); - $table->text('description'); - - $table->unique(['page_id','locale']); - $table->foreign('page_id')->references('id')->on('pages')->onDelete('cascade'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('page_translations'); - } -} diff --git a/database/seeds/AccountsSeeder.php b/database/seeds/AccountsSeeder.php new file mode 100644 index 0000000..30f3610 --- /dev/null +++ b/database/seeds/AccountsSeeder.php @@ -0,0 +1,48 @@ +delete(); + + // User::create([ + // 'name' => str_random(10), + // 'email' => 'foo@gmail.com', + // 'password' => bcrypt('secret') + // ]); + DB::table('accounts')->insert([ + [ + 'login' => "admin", + 'email' => "repository" . '@geologie.ac.at', + 'password' => bcrypt('admin007'), + 'created_at' => Carbon::now(), + ], + [ + 'login' => "Submitty", + 'email' => "submitter@geologie.ac.at", + 'password' => bcrypt('rdr007'), + 'created_at' => Carbon::now(), + ], + [ + 'login' => "Eddy", + 'email' => "editor@geologie.ac.at", + 'password' => bcrypt('rdr007'), + 'created_at' => Carbon::now(), + ], + [ + 'login' => "Review", + 'email' => "review@geologie.ac.at", + 'password' => bcrypt('rdr007'), + 'created_at' => Carbon::now(), + ], + ]); + } +} diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php index bacdbd3..d21468e 100755 --- a/database/seeds/DatabaseSeeder.php +++ b/database/seeds/DatabaseSeeder.php @@ -1,6 +1,7 @@ bcrypt('secret'), // ]); - $this->call('StudentTableSeeder'); - $this->call('CategoryTableSeeder'); - $this->call('ShelfTableSeeder'); - $this->call('BookTableSeeder'); - $this->call('PeriodeTableSeeder'); - $this->call('UserTableSeeder'); - $this->call('CollectionTableSeeder'); - $this->call('DocumentTableSeeder'); + + // $this->call('CategoryTableSeeder'); + // $this->call('BookTableSeeder'); + // $this->call('PeriodeTableSeeder'); + $this->call('AccountsTableSeeder'); + $this->call('RolesTableSeeder'); + $this->call('LicencesTableSeeder'); + $this->call('LanguagesTableSeeder'); + $this->call('PagesTableSeeder'); $this->command->info('User table seeded!'); } } -class UserTableSeeder extends Seeder -{ - public function run() - { - // DB::table('users')->delete(); - // User::create([ - // 'name' => str_random(10), - // 'email' => 'foo@gmail.com', - // 'password' => bcrypt('secret') - // ]); - DB::table('users')->insert([ - [ - 'name' => "user1", - 'email' => "user1" . '@gmail.com', - 'password' => bcrypt('secret'), - ], - [ - 'name' => "admin", - 'email' => 'arno.kaimbacher@hotmail.de', - 'password' => bcrypt('admin007'), - ], - ]); - } -} class PeriodeTableSeeder extends Seeder { @@ -71,8 +49,7 @@ class PeriodeTableSeeder extends Seeder DB::table('periodes')->insert([ 'id' => '1', 'days' => '100', - 'created_at' => '2015-06-09 02:59:49', - 'updated_at' => '2015-06-10 08:14:27', + ]); } } @@ -117,151 +94,6 @@ class CategoryTableSeeder extends Seeder } } -class BookTableSeeder extends Seeder -{ - public function run() - { - // DB::table('users')->delete(); - - // User::create([ - // 'name' => str_random(10), - // 'email' => 'foo@gmail.com', - // 'password' => bcrypt('secret') - // ]); - DB::table('books')->insert([ - [ - // 'id' => '1', - 'title' => 'Laravel 5', - 'author' => 'Arno Kaimbacher', - 'year' => '2017', - 'stock' => '9', - 'category_id' => '4', - 'shelf_id' => '1', - 'created_at' => '2015-06-09 00:17:51', - 'updated_at' => '2015-06-09 01:01:36', - 'year_id' => '0', - ], - [ - // 'id' => '2', - 'title' => 'Angular.Js', - 'author' => 'Mark Zuckerberg', - 'year' => '2014', - 'stock' => '5', - 'category_id' => '4', - 'shelf_id' => '3', - 'created_at' => '2015-06-09 00:17:51', - 'updated_at' => '2015-06-09 01:01:36', - 'year_id' => '0', - ], - [ - // 'id' => '3', - 'title' => 'OOP with PHP', - 'author' => 'Richard Stallman', - 'year' => '1999', - 'stock' => '7', - 'category_id' => '1', - 'shelf_id' => '2', - 'created_at' => '2015-06-09 00:17:51', - 'updated_at' => '2015-06-09 01:01:36', - 'year_id' => '0', - ], - ]); - } -} - -class ShelfTableSeeder extends Seeder -{ - public function run() - { - DB::table('shelves')->insert([ - [ - 'id' => '1', - 'shelf' => 'A', - 'created_at' => '2015-06-09 00:17:51', - 'updated_at' => '2015-06-09 01:01:36', - ], - [ - 'id' => '2', - 'shelf' => 'B', - 'created_at' => '2015-06-09 00:17:51', - 'updated_at' => '2015-06-09 01:01:36', - ], - [ - 'id' => '3', - 'shelf' => 'C', - 'created_at' => '2015-06-09 00:17:51', - 'updated_at' => '2015-06-09 01:01:36', - ], - [ - 'id' => '4', - 'shelf' => 'D', - 'created_at' => '2015-06-09 00:17:51', - 'updated_at' => '2015-06-09 01:01:36', - ], - [ - 'id' => '5', - 'shelf' => 'E', - 'created_at' => '2015-06-09 00:17:51', - 'updated_at' => '2015-06-09 01:01:36', - ], - ]); - } -} - -class StudentTableSeeder extends Seeder -{ - public function run() - { - DB::table('students')->insert([ - [ - 'id' => '1', - 'name' => 'Arno Kaimbacher', - 'registered_at' => '1432080000', - 'borrow' => '1', - 'status' => '1', - 'created_at' => '2015-06-09 00:17:51', - 'updated_at' => '2015-06-09 01:01:36', - ], - [ - 'id' => '2', - 'name' => 'Chelsea Islan', - 'registered_at' => '1433948676', - 'borrow' => '1', - 'status' => '1', - 'created_at' => '2015-06-09 00:17:51', - 'updated_at' => '2015-06-09 01:01:36', - ], - [ - 'id' => '3', - 'name' => 'John Mayer', - 'registered_at' => '1434734048', - 'borrow' => '0', - 'status' => '1', - 'created_at' => '2015-06-09 00:17:51', - 'updated_at' => '2015-06-09 01:01:36', - ], - [ - 'id' => '4', - 'name' => 'Emma Watson', - 'registered_at' => '1434734067', - 'borrow' => '1', - 'status' => '1', - 'created_at' => '2015-06-09 00:17:51', - 'updated_at' => '2015-06-09 01:01:36', - ], - [ - 'id' => '5', - 'name' => 'Scarlet Johansson', - 'registered_at' => '1434734082', - 'borrow' => '0', - 'status' => '1', - 'created_at' => '2015-06-09 00:17:51', - 'updated_at' => '2015-06-09 01:01:36', - ], - ]); - } -} - class CollectionTableSeeder extends Seeder { public function run() diff --git a/database/seeds/LanguagesTableSeeder.php b/database/seeds/LanguagesTableSeeder.php new file mode 100644 index 0000000..9aba142 --- /dev/null +++ b/database/seeds/LanguagesTableSeeder.php @@ -0,0 +1,78 @@ +delete(); + + // User::create([ + // 'name' => str_random(10), + // 'email' => 'foo@gmail.com', + // 'password' => bcrypt('secret') + // ]); + DB::table('languages')->insert([ + [ + 'part2_b' => 'ger', + 'part2_t' => 'deu', + 'part1' => 'de', + 'scope' => 'I', + 'type' => 'L', + 'ref_name' => 'German', + 'active' =>true, + ], + [ + 'part2_b' => 'eng', + 'part2_t' => 'eng', + 'part1' => 'en', + 'scope' => 'I', + 'type' => 'L', + 'ref_name' => 'English', + 'active' =>true, + ], + [ + 'part2_b' => 'ita', + 'part2_t' => 'ita', + 'part1' => 'it', + 'scope' => 'I', + 'type' => 'L', + 'ref_name' => 'Italian', + 'active' =>true, + ], + [ + 'part2_b' => 'fre', + 'part2_t' => 'fra', + 'part1' => 'fr', + 'scope' => 'I', + 'type' => 'L', + 'ref_name' => 'French', + 'active' =>true, + ], + [ + 'part2_b' => 'rus', + 'part2_t' => 'rus', + 'part1' => 'ru', + 'scope' => 'I', + 'type' => 'L', + 'ref_name' => 'Russian', + 'active' =>false, + ], + [ + 'part2_b' => 'spa', + 'part2_t' => 'spa', + 'part1' => 'es', + 'scope' => 'I', + 'type' => 'L', + 'ref_name' => 'Spanish', + 'active' =>false, + ], + ]); + } +} diff --git a/database/seeds/LicencesTableSeeder.php b/database/seeds/LicencesTableSeeder.php new file mode 100644 index 0000000..f46a0a2 --- /dev/null +++ b/database/seeds/LicencesTableSeeder.php @@ -0,0 +1,99 @@ +delete(); + + // User::create([ + // 'name' => str_random(10), + // 'email' => 'foo@gmail.com', + // 'password' => bcrypt('secret') + // ]); + DB::table('document_licences')->insert([ + [ + 'active' => true, + 'comment_internal' => "Lediglich die Namensnennung ist zwingend.", + 'desc_markup' => '

Dieser Inhalt is unter einer Creative Commons License lizenziert.

', + 'desc_text' => "Diese Lizenz erlaubt anderen, Ihr Werk/Ihren Inhalt zu verbreiten, zu remixen, zu verbessern und darauf aufzubauen, auch kommerziell, solange Sie als Urheber des Originals genannt werden. Dies ist die freieste CC-Lizenz, empfohlen für maximale Verbreitung und Nutzung des lizenzierten Materials.", + 'language' => 'de', + 'link_licence' => 'https://creativecommons.org/licenses/by/3.0/de/deed.de', + 'link_logo' => 'https://i.creativecommons.org/l/by/3.0/de/88x31.png', + 'mime_type' => 'text/html', + 'name_long' => 'Creative Commons - Namensnennung', + 'pod_allowed' => true, + 'sort_order' => 1, + ], + + [ + 'active' => true, + 'comment_internal' => "Namensnennung-BearbeitungUnterGleichenBedingungen\r\n\r\nIn Einschränkung zur CC-BY-Lizenz muss hier bei der Weiterverabeitung die Lizenz beibehalten werden.", + 'desc_markup' => '

Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.

', + 'desc_text' => "Diese Lizenz erlaubt es anderen, Ihr Werk/Ihren Inhalt zu verbreiten, zu remixen, zu verbessern und darauf aufzubauen, auch kommerziell, solange Sie als Urheber des Originals genannt werden und die auf Ihrem Werk/Inhalt basierenden neuen Werke unter denselben Bedingungen veröffentlicht werden. Diese Lizenz wird oft mit \"Copyleft\"-Lizenzen im Bereich freier und Open Source Software verglichen. Alle neuen Werke/Inhalte, die auf Ihrem aufbauen, werden unter derselben Lizenz stehen, also auch kommerziell nutzbar sein. Dies ist die Lizenz, die auch von der Wikipedia eingesetzt wird, empfohlen für Material, für das eine Einbindung von Wikipedia-Material oder anderen so lizenzierten Inhalten sinnvoll sein kann.", + 'language' => 'de', + 'link_licence' => 'https://creativecommons.org/licenses/by-sa/3.0/de/deed.de', + 'link_logo' => 'https://i.creativecommons.org/l/by-sa/3.0/de/88x31.png', + 'mime_type' => 'text/html', + 'name_long' => 'Creative Commons - Namensnennung - Weitergabe unter gleichen Bedingungen', + 'pod_allowed' => true, + 'sort_order' => 2, + ], + [ + 'active' => true, + 'comment_internal' => null, + 'desc_markup' => '

Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.

', + 'desc_text' => "Diese Lizenz erlaubt es anderen, Ihr Werk/Ihren Inhalt zu verbreiten, zu remixen, zu verbessern und darauf aufzubauen, allerdings nur nicht-kommerziell und solange Sie als Urheber des Originals genannt werden und die auf Ihrem Werk/Inhalt basierenden neuen Werke unter denselben Bedingungen veröffentlicht werden.", + 'language' => 'de', + 'link_licence' => 'https://creativecommons.org/licenses/by-nc-sa/3.0/de', + 'link_logo' => 'https://i.creativecommons.org/l/by-nc-sa/3.0/de/88x31.png', + 'mime_type' => 'text/html', + 'name_long' => 'Creative Commons - Namensnennung - Keine kommerzielle Nutzung-Weitergabe unter gleichen Bedingungen', + 'pod_allowed' => true, + 'sort_order' => 3, + ], + [ + 'active' => true, + 'comment_internal' => null, + 'desc_markup' => '

Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.

Creative Commons - Namensnennung - Nicht kommerziell

', + 'desc_text' => "Diese Lizenz erlaubt es anderen, Ihr Werk/Ihren Inhalt zu verbreiten, zu remixen, zu verbessern und darauf aufzubauen, allerdings nur nicht-kommerziell. Und obwohl auch bei den auf Ihrem Werk/Inhalt basierenden neuen Werken Ihr Name mit genannt werden muss und sie nur nicht-kommerziell verwendet werden dürfen, müssen diese neuen Werke nicht unter denselben Bedingungen lizenziert werden.", + 'language' => 'de', + 'link_licence' => 'https://creativecommons.org/licenses/by-nc/3.0/de/deed.de', + 'link_logo' => 'https://i.creativecommons.org/l/by-nc/3.0/de/88x31.png', + 'mime_type' => 'text/html', + 'name_long' => 'Creative Commons - Namensnennung - Nicht kommerziell', + 'pod_allowed' => true, + 'sort_order' => 4, + ], + [ + 'active' => true, + 'comment_internal' => "Wie cc_by_nc_nd, aber kommerzielle Nutzung erlaubt.", + 'desc_markup' => 'Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.', + 'desc_text' => "Diese Lizenz erlaubt anderen die Weiterverbreitung Ihres Werkes/Inhaltes, kommerziell wie nicht-kommerziell, solange dies ohne Veränderungen und vollständig geschieht und Sie als Urheber genannt werden.", + 'language' => 'de', + 'link_licence' => 'https://creativecommons.org/licenses/by-nd/3.0/de/', + 'link_logo' => 'https://i.creativecommons.org/l/by-nd/3.0/de/88x31.png', + 'mime_type' => 'text/html', + 'name_long' => 'Creative Commons - Namensnennung - Keine Bearbeitung', + 'pod_allowed' => true, + 'sort_order' => 5, + ], + [ + 'active' => true, + 'comment_internal' => "Namensnennung-NichtKommerziell-KeineBearbeitung\r\n\r\nDritte können die Arbeit elektronisch auf beliebigen Servern anbieten oder gedruckte Kopien erstellen (aber: mit Namensnennung, \r\nnicht-kommerziell und keine Veränderung).", + 'desc_markup' => 'Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.', + 'desc_text' => "Dies ist die restriktivste der sechs Kernlizenzen. Sie erlaubt lediglich Download und Weiterverteilung des Werkes/Inhaltes unter Nennung Ihres Namens, jedoch keinerlei Bearbeitung oder kommerzielle Nutzung.", + 'language' => 'de', + 'link_licence' => 'https://creativecommons.org/licenses/by-nc-nd/3.0/de/deed.de', + 'link_logo' => 'https://i.creativecommons.org/l/by-nc-nd/3.0/de/88x31.png', + 'mime_type' => 'text/html', + 'name_long' => 'Creative Commons - Namensnennung - Nicht kommerziell - Keine Bearbeitung', + 'pod_allowed' => true, + 'sort_order' => 6, + ], + ]); + } +} diff --git a/database/seeds/PagesTableSeeder.php b/database/seeds/PagesTableSeeder.php index f0e1ef3..2005424 100644 --- a/database/seeds/PagesTableSeeder.php +++ b/database/seeds/PagesTableSeeder.php @@ -1,15 +1,12 @@ sentence; - - $this->disableForeignKeys(); - // $this->truncate('pages'); - $page = [ + DB::table('pages')->insert([ [ - 'title' => 'Terms and conditions', + // 1 + //'title' => 'Terms and conditions', 'page_slug' => 'terms-and-conditions', - 'description' => $faker->text($maxNbChars = 255), - 'status' => '1', - 'created_by' => '1', + // 'description' => $faker->text($maxNbChars = 255), + 'seo_title' => 'Terms and Conditions', + 'seo_keyword' => 'GBA, repository, terms and conditions', + 'seo_description' => 'Terms and Conditions', + 'status' => '1', + 'created_by' => 1, + 'updated_by' => 1, 'created_at' => Carbon::now(), 'updated_at' => Carbon::now(), ], - ]; - DB::table('pages')->insert($page); - - $this->enableForeignKeys(); + [ + // 2 + //'title' => 'imprint', + 'page_slug' => 'imprint', + // 'description' => $faker->text($maxNbChars = 255), + 'seo_title' => 'Impressum', + 'seo_keyword' => 'GBA, repository, imprint', + 'seo_description' => 'Imprint', + 'status' => '1', + 'created_by' => 1, + 'updated_by' => 1, + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + // 3 + //'title' => 'Terms and conditions', + 'page_slug' => 'about', + // 'description' => $faker->text($maxNbChars = 255), + 'seo_title' => 'About', + 'seo_keyword' => 'GBA, repository, about', + 'seo_description' => 'About', + 'status' => '1', + 'created_by' => 1, + 'updated_by' => 1, + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + // 4 + //'title' => 'Terms and conditions', + 'page_slug' => 'home-welcome', + // 'description' => $faker->text($maxNbChars = 255), + 'seo_title' => 'About', + 'seo_keyword' => 'GBA, repository, about', + 'seo_description' => 'About', + 'status' => '1', + 'created_by' => 1, + 'updated_by' => 1, + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + ]); + + DB::table('page_translations')->insert([ + [ + 'page_id' => 1, //terms and conditions + 'locale' => 'de', + 'title' => 'Geschäftsbedingungen', + 'description' => '

1.        Open Access und FAIR Erklärung

iwas große Fokus liegt beim GBA-RDR beim Erlangen eines hohen Grades an die Zugänglichkeit und nachhaltige Verfügbarkeit für alle interessierten Nutzer. Dadurch soll eine verantwortungsvolle Weiterverwertung sowie Weiterentwicklung der Daten ermöglicht werden. Ebenfalls wird von Seitens des GBA-RDRs großen Wert auf das Ermöglichen von der Weiterverwendung von den publizierten Forschungsdaten gelegt. Dies wird durch das Einhalten der Prinzipien von Open Access und FAIR erlangt.

Unter Open Access wird der kostenfreie sowie öffentliche Zugang zu den im RDR archivierten Datenpublikationen verstanden.

Das Prinzip FAIR[1], welches ein Akronym für Findability (Auffindbarkeit), Accessibility (Zugänglichkeit), Interoperability (Kompatibilität), und Reusability (Wiederverwendbarkeit) ist, unterstützt eine nachhaltige wissenschaftliche Datenpflege sowie –verwaltung. Erst durch die garantierte Auffindbarkeit, volle Zugänglichkeit zu den Daten, gewährleistete Kompatibilität mit anderen Datenbeständen so wie die wissenschaftliche Wiederverwendbarkeit, erhält die Datenpublikation einen großen Wert.

Das GBA-RDR behält sich vor, bei Einzelfällen und begründet Datenpublikationen nur eingeschränkt zur Verfügung zu stellen oder/und mit einem Embargo zu belegen. Grundsätzlich sollen die Nutzer die publizierten Daten uneingeschränkt lesen, kopieren, drucken und je nach vergebener Lizenz verarbeiten sowie verteilen können. Dabei verpflichtet sich der Nutzer ausnahmslos die Daten zu zitieren. Die Urheberrechte der Autorenschaft werden dabei nicht berührt.

 

2.        Leitlinie

 

3.        Rechte und Pflichten

Die im GBA-RDR veröffentlichten Informationen und Metadaten unterliegen grundsätzlich den Open-Access-Bedingungen, wenn nicht anders angegeben. Die publizierten Datensets unterliegen einem definierten Zugriffs- sowie Nutzungsrecht welche in den Metadaten eindeutig beschrieben sind.

 

Zugriffsrecht

Es wird zwischen uneingeschränkten und eingeschränkten Zugriffsrecht unterschieden. Während bei dem uneingeschränkten Zugriffsrecht voller Zugriff auf die Daten und den dazugehörigen Informationen besteht, so kann ein eingeschränktes Zugriffsrecht auf bestimmte oder unbestimmte Zeit sowie auf alle oder nur auf Teile der Daten bestehen. Die detaillierte Zugriffsrechtsbestimmung sowie die Dauer einer Zugriffsbeschränkung sind in den Metadaten vermerkt. Grundsätzlich wird ein uneingeschränktes Zugriffsrecht vergeben. Unter bestimmten Voraussetzungen jedoch kann diese eingeschränkt sein.


 

Nutzungsrecht

Durch die Vergabe von Creative Commons Lizenzen werden jeder Datenpublikation mit definierten Nutzungsrechte ausgestattet. Die dabei verwendete Lizenz wird verpflichtend mit den zur Datenpublikation gehörenden Metadaten bereitgestellt.

 


Urheberrecht

Die Urheberrechte der auf dem GBA-RDR Server veröffentlichten Dokumenten liegen ausnahmslos bei den jeweiligen Autoren.

Der Urheber räumt jedoch durch die Publikation der Daten ein grundsätzliches Zugriffs- sowie Nutzungsrecht ein, welches mit der Datenpublikation geklärt und in den Metadaten verankert ist. Zusätzlich stimmt der Urheber zu, dass die Metadaten des Dokuments unentgeltlich anderen öffentlich einsehbaren Datenbanken zur Verfügung gestellt werden und somit an der Forschungsdateninfrastruktur teilnimmt.

Mit der Publikation sowie der Archivierung der Daten und allen dazugehörigen Dokumenten im GBA-RDR erklärt der Urheber keine Rechte Dritter verletzt zu haben. Der Urheber verpflichtet sich vor dem Einreichen der Daten und allen dazugehörigen Dokumenten, alle darin involvierten Miturheber, Co-Autoren und Drittmittelgeber in Kenntnis zu setzen. Wenn die zu veröffentlichenden Daten auf Fremddaten aufbauen oder diese ergänzen, so ist der Urheber der aktuellen Daten und den dazugehörigen Dokumenten verpflichtet die Rec

', + ], + [ + 'page_id' => 1, //terms and conditions + 'locale' => 'en', + 'title' => 'Terms and Conditions', + 'description' => '

english text for terms and conditions

', + ], + [ + 'page_id' => 2, //imprint + 'locale' => 'de', + 'title' => 'Impressum', + 'description' => '

Für den Inhalt verantwortlich: hfjklög

Geologische Bundesanstaltdsfsdf

Neulinggasse 38, 1030 Wien

» office@geologie.ac.at

 

Telefon: +43-1-7125674

Fax: +43-1-7125674-56

 

Technische Umsetzung und Betreuung

Geologische Bundesanstalt

Abteilung Geoinformation und Abteilung IT & GIS

Neulinggasse 38, 1030 Wien

» repository@geologie.ac.at

 

Bei technischen Problemen steht Ihnen das RDR-Team, erreichbar unter repository@geologie.ac.at, zur Seite.

 

Hinweise und Haftungsausschluss

Eine Haftung oder Garantie für Aktualität, Richtigkeit und Vollständigkeit der zur Verfügung gestellten Informationen und Daten ist ausgeschlossen.

Dieser Hinweis gilt auch für alle anderen Website, auf die durch Hyperlinks verwiesen wird. Die Geologische Bundesanstalt ist für den Inhalt von Websites, die mittels einer solchen Verbindung erreicht werden, nicht verantwortlich.

 

Bildernachweis

### Muss dann direkt auf der RDR Webpage ausgefüllt werden sobald diese existiert ###

 

', + ], + [ + 'page_id' => 2, //imprint + 'locale' => 'en', + 'title' => 'Imprint', + 'description' => '

english text for imprint

', + ], + [ + 'page_id' => 3, //about + 'locale' => 'de', + 'title' => 'Über uns', + 'description' => '

RDR (Research Data Repository) ist ein interdisziplinäres digitales Datenarchiv zur Archivierung und Publikation von Forschungsdaten aus abgeschlossenen wissenschaftlichen Studien und Projekten.

RDR focuses on disciplines who do not have a tradition of data sharing thus ensuring better availability, sustainable preservation and (independent) publication capacity of their research data.

', + ], + [ + 'page_id' => 3, //about + 'locale' => 'en', + 'title' => 'About Us', + 'description' => '

english text for about us

', + ], + [ + 'page_id' => 4, //home-welcome + 'locale' => 'de', + 'title' => 'Data Research Repository', + 'description' => '
+

Die Bibliothek bietet allen Angehörigen der Hochschule – Lehrenden + und Studierenden – die Möglichkeit, elektronisch erzeugte, qualifizierte + Dokumente über ihr Online-Publikations-System kostenlos zu + veröffentlichen. Die Texte stehen nach ihrer Veröffentlichung weltweit + im Internet zur Verfügung und werden von der Bibliothek dauerhaft + archiviert. Die Dokumente sind über Bibliothekskataloge und über die + Suchmaschinen des WWW erschlossen und zugänglich.

+

Wenn Sie nach Texten der Hochschule suchen wollen, wählen Sie bitte + das Menü "Suchen"; dort stehen Ihnen verschiedene Recherchemöglichkeiten + zur Verfügung. Wollen Sie ein Dokument publizieren, wählen Sie bitte das + Menü "Veröffentlichen"; mit wenigen Schritten können Sie dort Ihr + Dokument an den Hochschulschriftenserver übertragen.

+
', + ], + [ + 'page_id' => 4, //home-welcome + 'locale' => 'en', + 'title' => 'Data Research Repository', + 'description' => '
+

Theee library offers to publish electronically generated and qualified documents on its online publication system. + This service is for university members only and free of charge. After publication, + the texts are available worldwide on the Internet and will be archived permanently by the library. + The documents are indexed and made accessible in library catalogues and Web search engines.

+
', + ], + ]); } } diff --git a/database/seeds/RolesTableSeeder.php b/database/seeds/RolesTableSeeder.php new file mode 100644 index 0000000..c1d6469 --- /dev/null +++ b/database/seeds/RolesTableSeeder.php @@ -0,0 +1,230 @@ +insert([ + [ + 'name' => 'administrator', + 'display_name' => 'admin', + 'description' => 'User has access to all system functionality', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + 'name' => 'submitter', + 'display_name' => 'submit', + 'description' => 'submitting datasets', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + 'name' => 'editor', + 'display_name' => 'edit', + 'description' => 'Editor checks metadata', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + 'name' => 'reviewer', + 'display_name' => 'review', + 'description' => 'reviewer checks dataset', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + + ]); + + DB::table('link_accounts_roles')->insert([ + [ + 'account_id' => '1', //admin + 'role_id' => '1', //administrator role + ], + [ + 'account_id' => '2', //Submitty + 'role_id' => '2', //submitter role + ], + [ + 'account_id' => '3', //Eddy + 'role_id' => '3', //editor role + ], + [ + 'account_id' => '3', //Review + 'role_id' => '4', //reviewer role + ], + ]); + + DB::table('permissions')->insert([ + [ + // 1 + 'name' => 'settings', + 'display_name' => 'Manage Settings', + 'description' => 'allow role to manage system settings', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + // 2 + 'name' => 'page', + 'display_name' => 'cms pages', + 'description' => 'allow role to add and edit cms pages like about site', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + // 3 + 'name' => 'dataset-list', + 'display_name' => 'list submitter datasets', + 'description' => 'allow submitter role to list all datasets', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + // 4 + 'name' => 'dataset-submit', + 'display_name' => 'submit datasets', + 'description' => 'allow submitter role to create/submit datasets', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + // 5 + 'name' => 'dataset-editor-list', + 'display_name' => 'list released, editor_accepted and rejected_reviewer datasets', + 'description' => 'allow editor role to see all released. editor_accepted and rejected_reviewer datasets', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + // 6 + 'name' => 'dataset-receive', + 'display_name' => 'receive released datasets', + 'description' => 'allow editor to accept/receive released datasets', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + // 7 + 'name' => 'dataset-editor-update', + 'display_name' => 'update received/accepted datasets', + 'description' => 'allow editor to update received/accepted datasets', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + // 8 + 'name' => 'dataset-approve', + 'display_name' => 'approve datasets', + 'description' => 'allow editor role to approve datasets', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + // 9 + 'name' => 'dataset-publish', + 'display_name' => 'publish datasets', + 'description' => 'allow editor role to publish datasets', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + // 10 + 'name' => 'dataset-editor-reject', + 'display_name' => 'reject datasets', + 'description' => 'allow editor role to reject datasets to submitter', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + // 11 + 'name' => 'dataset-review-list', + 'display_name' => 'list approved datasets', + 'description' => 'allow review role to see all approved datasets from reviewer', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + // 12 + 'name' => 'dataset-review', + 'display_name' => 'review datasets', + 'description' => 'allow reviewer role to review datasets', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + // 13 + 'name' => 'dataset-review-reject', + 'display_name' => 'reject datasets', + 'description' => 'allow reviewer role to reject datasets to editor', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + ]); + + DB::table('role_has_permissions')->insert([ + [ + 'permission_id' => '1', //permission 'settings' + 'role_id' => '1', //administrator role + ], + [ + 'permission_id' => '2', //permission 'page' + 'role_id' => '1', //administrator role + ], + [ + 'permission_id' => '3', //permission 'dataset-list' + 'role_id' => '2', //submitter role + ], + [ + 'permission_id' => '4', //permission 'dataset-submit' + 'role_id' => '2', //submitter role + ], + [ + 'permission_id' => '5', //permission 'dataset-editor-list' + 'role_id' => '3', //editor role + ], + [ + 'permission_id' => '6', //permission 'dataset-receive' + 'role_id' => '3', //editor role + ], + [ + 'permission_id' => '7', //permission 'dataset-editor-update' + 'role_id' => '3', //editor role + ], + [ + 'permission_id' => '8', //permission 'dataset-approve' + 'role_id' => '3', //editor role + ], + [ + 'permission_id' => '9', //permission 'dataset-publish' + 'role_id' => '3', //editor role + ], + [ + 'permission_id' => '10', //permission 'dataset-editor-reject' + 'role_id' => '3', //editor role + ], + [ + 'permission_id' => '11', //permission 'dataset-review-list' + 'role_id' => '4', //reviewer role + ], + [ + 'permission_id' => '12', //permission 'dataset-review' + 'role_id' => '4', //reviewer role + ], + [ + 'permission_id' => '13', //permission 'dataset-review-reject' + 'role_id' => '4', //reviewer role + ], + ]); + } +}