- added nearly all migration files

- added nearly all database seed files
This commit is contained in:
Arno Kaimbacher 2019-08-29 16:58:35 +02:00
parent 489546ef6e
commit 7641c1dfdf
40 changed files with 1168 additions and 915 deletions

View File

@ -16,7 +16,9 @@ class SitelinkController extends Controller
->where('server_state', 'LIKE', "%" . $serverState . "%"); ->where('server_state', 'LIKE', "%" . $serverState . "%");
$select $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); ->distinct(true);
$this->years = $select->pluck('published_date'); $this->years = $select->pluck('published_date');

View File

@ -148,7 +148,7 @@ class RequestController extends Controller
$repositoryName = "RDR - Data Research Repository"; $repositoryName = "RDR - Data Research Repository";
$repIdentifier = "rdr.gba.ac.at"; $repIdentifier = "rdr.gba.ac.at";
$sampleIdentifier = "oai:" . $repIdentifier . ":27";//$this->_configuration->getSampleIdentifier(); $sampleIdentifier = "oai:" . $repIdentifier . ":27";//$this->_configuration->getSampleIdentifier();
$earliestDateFromDb = Dataset::earliestPublicationDate(); $earliestDateFromDb = Dataset::earliestPublicationDate()->get('server_date_published');
// set parameters for oai-pmh.xslt // set parameters for oai-pmh.xslt
$this->_proc->setParameter('', 'email', $email); $this->_proc->setParameter('', 'email', $email);

View File

@ -258,11 +258,12 @@ class Dataset extends Model
if (!$column) { if (!$column) {
$column = self::PUBLISHED_AT; $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') ->where('server_state', 'published')
->orderBy('server_date_published', 'asc') ->orderBy('server_date_published', 'asc')
->first() ->first();
->server_date_published; //->server_date_published;
} }
public function setServerState($targetType) public function setServerState($targetType)

View File

@ -51,6 +51,19 @@ return [
'database' => storage_path().'/database.db', 'database' => storage_path().'/database.db',
'prefix' => '', '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' => [ 'sqlsrv' => [

View File

@ -29,7 +29,7 @@ return [
| This is the roles table used by Entrust to save roles to the database. | This is the roles table used by Entrust to save roles to the database.
| |
*/ */
'roles_table' => 'user_roles', //'roles', 'roles_table' => 'roles', //'roles',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

View File

@ -1,36 +0,0 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function(Blueprint $table)
{
$table->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');
}
}

View File

@ -1,33 +0,0 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePasswordResetsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('password_resets', function(Blueprint $table)
{
$table->string('email')->index();
$table->string('token')->index();
$table->timestamp('created_at');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('password_resets');
}
}

View File

@ -1,33 +0,0 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCategoriesTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('categories', function(Blueprint $table)
{
$table->increments('id');
$table->string('category');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('categories');
}
}

View File

@ -1,33 +0,0 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateShelvesTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('shelves', function(Blueprint $table)
{
$table->increments('id');
$table->string('shelf');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('shelves');
}
}

View File

@ -1,33 +0,0 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePeriodesTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('periodes', function(Blueprint $table)
{
$table->increments('id');
$table->integer('days');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('periodes');
}
}

View File

@ -1,39 +0,0 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateLac extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('roles', function (Blueprint $table) {
$table->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');
}
}

View File

@ -1,46 +0,0 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTransactionsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('transactions', function(Blueprint $table)
{
$table->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');
}
}

View File

@ -1,41 +0,0 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateBooksTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('books', function(Blueprint $table)
{
$table->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');
}
}

View File

@ -1,36 +0,0 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCollectionsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('collections', function (Blueprint $table) {
$table->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');
}
}

View File

@ -1,43 +0,0 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateLinkDocumentsCollections extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('link_documents_collections', function (Blueprint $table) {
// $table->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');
}
}

View File

@ -1,59 +0,0 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateStudentsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('persons', function(Blueprint $table)
{
$table->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');
}
}

View File

@ -1,91 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePermissionTables extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$tableNames = config('permission.table_names');
Schema::create($tableNames['permissions'], function (Blueprint $table) {
$table->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']);
}
}

View File

@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAccountsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('accounts', function (Blueprint $table) {
$table->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');
}
}

View File

@ -0,0 +1,79 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateRolesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
DB::beginTransaction();
// Create table for storing roles
Schema::create('roles', function (Blueprint $table) {
$table->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');
}
}

View File

@ -1,9 +1,10 @@
<?php <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateDocumentsTable extends Migration class CreateProjectsTable extends Migration
{ {
/** /**
* Run the migrations. * Run the migrations.
@ -12,10 +13,11 @@ class CreateDocumentsTable extends Migration
*/ */
public function up() public function up()
{ {
Schema::create('documents', function (Blueprint $table) { Schema::create('projects', function (Blueprint $table) {
$table->increments('id'); $table->increments('id');
$table->string('publication_state', 100)->default('draft');; $table->string('label', 10);
$table->boolean('belongs_to_bibliography')->default('0'); $table->string('name', 255);
$table->string('description', 255)->nullable();
$table->timestamps(); $table->timestamps();
}); });
} }
@ -27,6 +29,6 @@ class CreateDocumentsTable extends Migration
*/ */
public function down() public function down()
{ {
Schema::drop('documents'); Schema::dropIfExists('projects');
} }
} }

View File

@ -0,0 +1,56 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateDocumentsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('documents', function (Blueprint $table) {
$table->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');
}
}

View File

@ -0,0 +1,59 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePersonsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('persons', function (Blueprint $table) {
$table->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');
}
}

View File

@ -0,0 +1,62 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateLicencesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('document_licences', function (Blueprint $table) {
$table->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');
}
}

View File

@ -0,0 +1,58 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCollectionsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('collections', function (Blueprint $table) {
$table->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');
}
}

View File

@ -0,0 +1,54 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePagesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('pages', function (Blueprint $table) {
$table->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');
}
}

View File

@ -0,0 +1,37 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateDatasetTitlesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('dataset_titles', function (Blueprint $table) {
$table->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');
}
}

View File

@ -0,0 +1,37 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateDatasetAbstractsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('dataset_abstracts', function (Blueprint $table) {
$table->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');
}
}

View File

@ -0,0 +1,37 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateLanguagesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('languages', function (Blueprint $table) {
$table->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');
}
}

View File

@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateDocumentXmlCacheTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('document_xml_cache', function (Blueprint $table) {
$table->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');
}
}

View File

@ -1,41 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePagesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('pages', function (Blueprint $table) {
$table->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');
}
}

View File

@ -1,32 +0,0 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCategoriesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('categories', function (Blueprint $table) {
$table->increments('id');
$table->string('category');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('categories');
}
}

View File

@ -1,39 +0,0 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateBooksTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('books', function (Blueprint $table) {
$table->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');
}
}

View File

@ -1,33 +0,0 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateDocumentsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('documents', function (Blueprint $table) {
$table->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');
}
}

View File

@ -1,38 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePageTranslationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('page_translations', function (Blueprint $table) {
$table->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');
}
}

View File

@ -0,0 +1,48 @@
<?php
use Carbon\Carbon;
use Database\DisableForeignKeys;
use Database\TruncateTable;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Faker\Factory as Faker;
class AccountsTableSeeder extends Seeder
{
public function run()
{
// DB::table('users')->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(),
],
]);
}
}

View File

@ -1,6 +1,7 @@
<?php <?php
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
use Carbon\Carbon;
class DatabaseSeeder extends Seeder class DatabaseSeeder extends Seeder
{ {
@ -19,43 +20,20 @@ class DatabaseSeeder extends Seeder
// 'password' => bcrypt('secret'), // 'password' => bcrypt('secret'),
// ]); // ]);
$this->call('StudentTableSeeder');
$this->call('CategoryTableSeeder'); // $this->call('CategoryTableSeeder');
$this->call('ShelfTableSeeder'); // $this->call('BookTableSeeder');
$this->call('BookTableSeeder'); // $this->call('PeriodeTableSeeder');
$this->call('PeriodeTableSeeder'); $this->call('AccountsTableSeeder');
$this->call('UserTableSeeder'); $this->call('RolesTableSeeder');
$this->call('CollectionTableSeeder'); $this->call('LicencesTableSeeder');
$this->call('DocumentTableSeeder'); $this->call('LanguagesTableSeeder');
$this->call('PagesTableSeeder');
$this->command->info('User table seeded!'); $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 class PeriodeTableSeeder extends Seeder
{ {
@ -71,8 +49,7 @@ class PeriodeTableSeeder extends Seeder
DB::table('periodes')->insert([ DB::table('periodes')->insert([
'id' => '1', 'id' => '1',
'days' => '100', '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 class CollectionTableSeeder extends Seeder
{ {
public function run() public function run()

View File

@ -0,0 +1,78 @@
<?php
use Carbon\Carbon;
use Database\DisableForeignKeys;
use Database\TruncateTable;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Faker\Factory as Faker;
class LanguagesTableSeeder extends Seeder
{
public function run()
{
// DB::table('users')->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,
],
]);
}
}

View File

@ -0,0 +1,99 @@
<?php
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class LicencesTableSeeder extends Seeder
{
public function run()
{
// DB::table('users')->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' => '<p><strong>Dieser Inhalt </strong>is unter einer <a href="\">Creative Commons License</a> lizenziert.</p>',
'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' => '<p>Dieser Inhalt ist unter einer <a href="\">Creative Commons-Lizenz</a> lizenziert.</p>',
'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' => '<p>Dieser Inhalt ist unter einer <a href="\">Creative Commons-Lizenz</a> lizenziert.</p>',
'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' => '<h2>Dieser <i>Inhalt </i>ist unter einer <a href="https://creativecommons.org/licenses/by-nc/3.0/de/deed.de"><strong>Creative Commons-Lizenz</strong></a> lizenziert.</h2><h3>Creative Commons - Namensnennung - Nicht kommerziell</h3>',
'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 <a rel="\"license\"" href="\"https://creativecommons.org/licenses/by-nd/3.0/de/\"">Creative Commons-Lizenz</a> lizenziert.<!--/Creative Commons License--><!-- <rdf:RDF xmlns=\"http://web.resource.org/cc/\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\">\r\n <Work rdf:about=\"\">\r\n <license rdf:resource=\"https://creativecommons.org/licenses/by-nd/3.0/de/\" ></license>\r\n </Work>\r\n <License rdf:about=\"https://creativecommons.org/licenses/by-nd/3.0/de/\"><permits rdf:resource=\"http://web.resource.org/cc/Reproduction\"></permits><permits rdf:resource=\"http://web.resource.org/cc/Distribution\"></permits><requires rdf:resource=\"http://web.resource.org/cc/Notice\"></requires><requires rdf:resource=\"http://web.resource.org/cc/Attribution\"></requires></License></rdf:RDF> -->',
'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' => '<!-- Creative Commons-Lizenzvertrag -->Dieser Inhalt ist unter einer <a rel="\"license\"" href="\"https://creativecommons.org/licenses/by-nc-nd/3.0/de/\"">Creative Commons-Lizenz</a> lizenziert.<!--\r\n\r\n<rdf:RDF xmlns=\"http://web.resource.org/cc/\"\r\n xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\r\n xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\r\n<Work rdf:about=\"\">\r\n <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/Text\" ></dc:type>\r\n <license rdf:resource=\"https://creativecommons.org/licenses/by-nc-nd/3.0/de/\" ></license>\r\n</Work>\r\n\r\n<License rdf:about=\"https://creativecommons.org/licenses/by-nc-nd/3.0/de/\">\r\n <permits rdf:resource=\"http://web.resource.org/cc/Reproduction\" ></permits>\r\n <permits rdf:resource=\"http://web.resource.org/cc/Distribution\" ></permits>\r\n <requires rdf:resource=\"http://web.resource.org/cc/Notice\" ></requires>\r\n <requires rdf:resource=\"http://web.resource.org/cc/Attribution\" ></requires>\r\n <prohibits rdf:resource=\"http://web.resource.org/cc/CommercialUse\" ></prohibits>\r\n</License>\r\n\r\n</rdf:RDF>\r\n\r\n-->',
'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,
],
]);
}
}

View File

@ -1,15 +1,12 @@
<?php <?php
use Carbon\Carbon; use Carbon\Carbon;
use Database\DisableForeignKeys; // use Database\DisableForeignKeys;
use Database\TruncateTable;
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Faker\Factory as Faker;
class PagesTableSeeder extends Seeder class PagesTableSeeder extends Seeder
{ {
use DisableForeignKeys;
/** /**
* Run the database seeds. * Run the database seeds.
* *
@ -17,24 +14,132 @@ class PagesTableSeeder extends Seeder
*/ */
public function run() public function run()
{ {
$faker = Faker::create(); DB::table('pages')->insert([
$title = $faker->sentence;
$this->disableForeignKeys();
// $this->truncate('pages');
$page = [
[ [
'title' => 'Terms and conditions', // 1
//'title' => 'Terms and conditions',
'page_slug' => 'terms-and-conditions', 'page_slug' => 'terms-and-conditions',
'description' => $faker->text($maxNbChars = 255), // 'description' => $faker->text($maxNbChars = 255),
'status' => '1', 'seo_title' => 'Terms and Conditions',
'created_by' => '1', 'seo_keyword' => 'GBA, repository, terms and conditions',
'seo_description' => 'Terms and Conditions',
'status' => '1',
'created_by' => 1,
'updated_by' => 1,
'created_at' => Carbon::now(), 'created_at' => Carbon::now(),
'updated_at' => Carbon::now(), 'updated_at' => Carbon::now(),
], ],
]; [
DB::table('pages')->insert($page); // 2
//'title' => 'imprint',
$this->enableForeignKeys(); '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' => '<h2>1.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Open Access und FAIR Erklärung</h2><p>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 <strong>verantwortungsvolle </strong>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.</p><p>Unter Open Access wird der kostenfreie sowie öffentliche Zugang zu den im RDR archivierten Datenpublikationen verstanden.</p><p>Das Prinzip FAIR<a href="#_ftn1">[1]</a>, welches ein Akronym für <i>Findability</i> (Auffindbarkeit), <i>Accessibility</i> (Zugänglichkeit), <i>Interoperability</i> (Kompatibilität), und <i>Reusability</i> (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.</p><p>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.</p><p>&nbsp;</p><h2>2.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Leitlinie</h2><ul><li>Ziele</li><li>Anforderungen an die elektronische Publikation</li><li>Urheber- und Nutzungsrechte</li><li>Sacherschließung auf dem Publikationsserver</li><li>Archivierung von Publikationen</li><li>Technische Eigenschaften des Publikationsservers</li><li>Organisatorische Regelungen</li></ul><p>&nbsp;</p><h2>3.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Rechte und Pflichten</h2><p>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.</p><p>&nbsp;</p><p>Zugriffsrecht</p><p>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.</p><p><br>&nbsp;</p><p>Nutzungsrecht</p><p>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.</p><p>&nbsp;</p><p><br>Urheberrecht</p><p>Die Urheberrechte der auf dem GBA-RDR Server veröffentlichten Dokumenten liegen ausnahmslos bei den jeweiligen Autoren.</p><p>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.</p><p>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</p>',
],
[
'page_id' => 1, //terms and conditions
'locale' => 'en',
'title' => 'Terms and Conditions',
'description' => '<h2>english text for terms and conditions</h2>',
],
[
'page_id' => 2, //imprint
'locale' => 'de',
'title' => 'Impressum',
'description' => '<p><strong>Für den Inhalt verantwortlich: hfjklög</strong></p><p>Geologische Bundesanstaltdsfsdf</p><p>Neulinggasse 38, 1030 Wien</p><p>» office@geologie.ac.at</p><p>&nbsp;</p><p>Telefon: +43-1-7125674</p><p>Fax: +43-1-7125674-56</p><p>&nbsp;</p><p>Technische Umsetzung und Betreuung</p><p>Geologische Bundesanstalt</p><p>Abteilung Geoinformation und Abteilung IT &amp; GIS</p><p>Neulinggasse 38, 1030 Wien</p><p>» repository@geologie.ac.at</p><p>&nbsp;</p><p>Bei technischen Problemen steht Ihnen das RDR-Team, erreichbar unter repository@geologie.ac.at, zur Seite.</p><p>&nbsp;</p><p>Hinweise und Haftungsausschluss</p><p>Eine Haftung oder Garantie für Aktualität, Richtigkeit und Vollständigkeit der zur Verfügung gestellten Informationen und Daten ist ausgeschlossen.</p><p>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.</p><p>&nbsp;</p><p>Bildernachweis</p><p>### Muss dann direkt auf der RDR Webpage ausgefüllt werden sobald diese existiert ###</p><p>&nbsp;</p>',
],
[
'page_id' => 2, //imprint
'locale' => 'en',
'title' => 'Imprint',
'description' => '<h2>english text for imprint</h2>',
],
[
'page_id' => 3, //about
'locale' => 'de',
'title' => 'Über uns',
'description' => '<p>RDR (Research Data Repository) ist ein interdisziplinäres digitales Datenarchiv zur Archivierung und Publikation von Forschungsdaten aus abgeschlossenen wissenschaftlichen Studien und Projekten.</p><p>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.</p>',
],
[
'page_id' => 3, //about
'locale' => 'en',
'title' => 'About Us',
'description' => '<h2>english text for about us</h2>',
],
[
'page_id' => 4, //home-welcome
'locale' => 'de',
'title' => 'Data Research Repository',
'description' => '<div>
<p>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.</p>
<p>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.</p>
</div>',
],
[
'page_id' => 4, //home-welcome
'locale' => 'en',
'title' => 'Data Research Repository',
'description' => '<div>
<p>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.</p>
</div>',
],
]);
} }
} }

View File

@ -0,0 +1,230 @@
<?php
use Carbon\Carbon;
use Database\DisableForeignKeys;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class RolesTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('roles')->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
],
]);
}
}