Changeset 4044


Ignore:
Timestamp:
11/19/13 08:42:31 (11 years ago)
Author:
twagoo
Message:
  • Added security db structure
  • Fixed issues with included servlet-api jars (through grizzly test)
Location:
DASISH/t5.6/backend/annotator-backend/branches/annotator-backend-0.2
Files:
2 edited
1 copied

Legend:

Unmodified
Added
Removed
  • DASISH/t5.6/backend/annotator-backend/branches/annotator-backend-0.2/pom.xml

    r4033 r4044  
    164164            <artifactId>jersey-test-framework-grizzly2</artifactId>
    165165            <version>${jersey.version}</version>
     166            <scope>test</scope>
    166167        </dependency>
    167168        <dependency>
     
    250251            <version>${slf4j.version}</version>
    251252        </dependency>
    252        
    253253        <dependency>
    254254            <groupId>javax.servlet</groupId>
     
    257257            <scope>provided</scope>
    258258        </dependency>
    259        
    260259    </dependencies>
    261260    <properties>
     
    323322                                        <!-- this file will create the database structure -->
    324323                                        <srcFile>src/main/sql/schema.hsql/DashishAnnotatorCreate.sql</srcFile>
     324                                        <srcFile>src/main/sql/schema.hsql/security.sql</srcFile>
    325325                                        <!-- this file will insert some test data -->
    326                                         <srcFile>src/main/sql/data/TestData.sql</srcFile>
     326                                        <!--<srcFile>src/main/sql/data/TestData.sql</srcFile>-->
    327327                                    </srcFiles>
    328328                                    <skip>${skipCreateDb}</skip>
  • DASISH/t5.6/backend/annotator-backend/branches/annotator-backend-0.2/src/main/resources/web/context.xml

    r3730 r4044  
    3838        removeAbandonedTimeout="10"
    3939        logAbandoned="true" />
     40     <Resource
     41        name="jdbc/DASISHSecurity"
     42        auth="Container"
     43        type="javax.sql.DataSource"
     44        driverClassName="org.hsqldb.jdbcDriver"
     45        url="${jdbcUrl}"
     46        username="${jdbcUsername}"
     47        password="${jdbcPassword}"
     48        maxActive="10"
     49        maxIdle="5"
     50        maxWait="4000"
     51        removeAbandoned="false"
     52        removeAbandonedTimeout="10"
     53        logAbandoned="true" />
    4054      <Parameter name="eu.dasish.annotation.backend.schemaLocation"
    4155             value="http://www.dasish.eu/ns/addit https://svn.clarin.eu/DASISH/t5.6/schema/trunk/annotator-schema/src/main/resources/DASISH-schema.xsd"/>
  • DASISH/t5.6/backend/annotator-backend/branches/annotator-backend-0.2/src/main/sql/schema.hsql/security.sql

    r4039 r4044  
    2525-- Started on 2013-06-14 14:36:28 CEST
    2626
    27 CREATE TABLE principal (
    28     principal_id SERIAL UNIQUE NOT NULL,
    29     external_id text UNIQUE NOT NULL,
    30     remote_id text UNIQUE NOT NULL,
    31     principal_name text,
    32     e_mail text
    33 );
     27create table users(
     28      username varchar_ignorecase(50) not null primary key,
     29      password varchar_ignorecase(50) not null,
     30      enabled boolean not null);
    3431
    35 CREATE TABLE notebook (
    36     notebook_id SERIAL UNIQUE NOT NULL,
    37     external_id text UNIQUE NOT NULL,
    38     time_stamp timestamp with time zone default now(),
    39     title text,
    40     owner_id integer NOT NULL
    41 );
    42 
    43 
    44 CREATE TABLE annotation (
    45     annotation_id SERIAL UNIQUE NOT NULL,
    46     external_id text UNIQUE NOT NULL,
    47     time_stamp timestamp with time zone default now(),
    48     owner_id integer REFERENCES principal(principal_id),
    49     headline text,
    50     body_text text,
    51     body_mimetype text,
    52     is_xml BOOLEAN
    53 );
    54 
    55 
    56 
    57 CREATE TABLE target (
    58     target_id SERIAL UNIQUE NOT NULL,
    59     external_id text UNIQUE NOT NULL,
    60     time_stamp timestamp with time zone default now(),
    61     link_uri text,
    62     version text,
    63     fragment_descriptor text
    64 );
    65 
    66 CREATE TABLE cached_representation (
    67     cached_representation_id SERIAL UNIQUE NOT NULL,
    68     external_id text UNIQUE NOT NULL,
    69     mime_type text,
    70     tool text,
    71     type_ text,
    72     file_ blob
    73 );
    74 
    75 
    76 
    77 CREATE TABLE permission_ (
    78   permission_mode text UNIQUE NOT NULL
    79 );
    80 
    81 -----------------------------------------------------------------------
    82 --------------------- JOINT TABLES ------------------------------------
    83 
    84 CREATE TABLE annotations_targets (
    85    annotation_id integer REFERENCES annotation(annotation_id), -- defining a foreign key: there must be a uniquely defined row in "annotation", that is defined by "annotation_id"
    86    target_id integer REFERENCES target(target_id),
    87    unique(annotation_id, target_id)
    88 );
    89 
    90 
    91 
    92 CREATE TABLE notebooks_annotations (
    93     notebook_id integer REFERENCES notebook(notebook_id),
    94     annotation_id integer REFERENCES annotation(annotation_id),
    95     unique(notebook_id, annotation_id)
    96 );
    97 
    98 CREATE TABLE targets_cached_representations (
    99     target_id integer REFERENCES target(target_id),
    100     cached_representation_id integer REFERENCES cached_representation(cached_representation_id),
    101     fragment_descriptor_in_cached text,
    102     unique(target_id, cached_representation_id)
    103 );
    104 
    105 
    106 
    107 
    108 CREATE TABLE annotations_principals_permissions (
    109 annotation_id integer REFERENCES annotation(annotation_id),
    110 principal_id integer REFERENCES principal(principal_id),
    111 permission_  text REFERENCES permission_(permission_mode),
    112 unique(annotation_id, principal_id)
    113 );
    114 
     32create table authorities (
     33      username varchar_ignorecase(50) not null,
     34      authority varchar_ignorecase(50) not null,
     35      constraint fk_authorities_users foreign key(username) references users(username));
     36      create unique index ix_auth_username on authorities (username,authority);
Note: See TracChangeset for help on using the changeset viewer.