mirror of
https://github.com/sismics/docs.git
synced 2024-11-25 15:17:57 +01:00
#65: Limit vocabulary values to 500 characters
This commit is contained in:
parent
f9c3715d8d
commit
2d858e6e11
@ -31,7 +31,7 @@ public class Vocabulary {
|
|||||||
/**
|
/**
|
||||||
* Vocabulary value.
|
* Vocabulary value.
|
||||||
*/
|
*/
|
||||||
@Column(name = "VOC_VALUE_C", nullable = false, length = 100)
|
@Column(name = "VOC_VALUE_C", nullable = false, length = 500)
|
||||||
private String value;
|
private String value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3,10 +3,10 @@ alter table T_DOCUMENT add column DOC_IDENTIFIER_C varchar(500);
|
|||||||
alter table T_DOCUMENT add column DOC_PUBLISHER_C varchar(500);
|
alter table T_DOCUMENT add column DOC_PUBLISHER_C varchar(500);
|
||||||
alter table T_DOCUMENT add column DOC_FORMAT_C varchar(500);
|
alter table T_DOCUMENT add column DOC_FORMAT_C varchar(500);
|
||||||
alter table T_DOCUMENT add column DOC_SOURCE_C varchar(500);
|
alter table T_DOCUMENT add column DOC_SOURCE_C varchar(500);
|
||||||
alter table T_DOCUMENT add column DOC_TYPE_C varchar(100);
|
alter table T_DOCUMENT add column DOC_TYPE_C varchar(500);
|
||||||
alter table T_DOCUMENT add column DOC_COVERAGE_C varchar(100);
|
alter table T_DOCUMENT add column DOC_COVERAGE_C varchar(500);
|
||||||
alter table T_DOCUMENT add column DOC_RIGHTS_C varchar(100);
|
alter table T_DOCUMENT add column DOC_RIGHTS_C varchar(500);
|
||||||
create memory table T_VOCABULARY ( VOC_ID_C varchar(36) not null, VOC_NAME_C varchar(50) not null, VOC_VALUE_C varchar(100) not null, VOC_ORDER_N int not null, primary key (VOC_ID_C) );
|
create memory table T_VOCABULARY ( VOC_ID_C varchar(36) not null, VOC_NAME_C varchar(50) not null, VOC_VALUE_C varchar(500) not null, VOC_ORDER_N int not null, primary key (VOC_ID_C) );
|
||||||
|
|
||||||
insert into T_VOCABULARY(VOC_ID_C, VOC_NAME_C, VOC_VALUE_C, VOC_ORDER_N) values('type-collection', 'type', 'Collection', 0);
|
insert into T_VOCABULARY(VOC_ID_C, VOC_NAME_C, VOC_VALUE_C, VOC_ORDER_N) values('type-collection', 'type', 'Collection', 0);
|
||||||
insert into T_VOCABULARY(VOC_ID_C, VOC_NAME_C, VOC_VALUE_C, VOC_ORDER_N) values('type-dataset', 'type', 'Dataset', 1);
|
insert into T_VOCABULARY(VOC_ID_C, VOC_NAME_C, VOC_VALUE_C, VOC_ORDER_N) values('type-dataset', 'type', 'Dataset', 1);
|
||||||
|
@ -73,7 +73,7 @@ public class VocabularyResource extends BaseResource {
|
|||||||
// Validate input data
|
// Validate input data
|
||||||
name = ValidationUtil.validateLength(name, "name", 1, 50, false);
|
name = ValidationUtil.validateLength(name, "name", 1, 50, false);
|
||||||
ValidationUtil.validateRegex(name, "name", "[a-z0-9\\-]+");
|
ValidationUtil.validateRegex(name, "name", "[a-z0-9\\-]+");
|
||||||
value = ValidationUtil.validateLength(value, "value", 1, 100, false);
|
value = ValidationUtil.validateLength(value, "value", 1, 500, false);
|
||||||
Integer order = ValidationUtil.validateInteger(orderStr, "order");
|
Integer order = ValidationUtil.validateInteger(orderStr, "order");
|
||||||
|
|
||||||
// Create the vocabulary
|
// Create the vocabulary
|
||||||
@ -117,7 +117,7 @@ public class VocabularyResource extends BaseResource {
|
|||||||
if (name != null) {
|
if (name != null) {
|
||||||
ValidationUtil.validateRegex(name, "name", "[a-z0-9\\-]+");
|
ValidationUtil.validateRegex(name, "name", "[a-z0-9\\-]+");
|
||||||
}
|
}
|
||||||
value = ValidationUtil.validateLength(value, "value", 1, 100, true);
|
value = ValidationUtil.validateLength(value, "value", 1, 500, true);
|
||||||
Integer order = null;
|
Integer order = null;
|
||||||
if (orderStr != null) {
|
if (orderStr != null) {
|
||||||
order = ValidationUtil.validateInteger(orderStr, "order");
|
order = ValidationUtil.validateInteger(orderStr, "order");
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr class="info">
|
<tr class="info">
|
||||||
<td>
|
<td>
|
||||||
<input type="text" placeholder="New entry" class="form-control" ng-model="entry.value" maxlength="100" />
|
<input type="text" placeholder="New entry" class="form-control" ng-model="entry.value" maxlength="500" />
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="number" class="form-control" ng-model="entry.order" />
|
<input type="number" class="form-control" ng-model="entry.order" />
|
||||||
@ -37,7 +37,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr ng-repeat="entry in entries | orderBy: 'order'">
|
<tr ng-repeat="entry in entries | orderBy: 'order'">
|
||||||
<td>
|
<td>
|
||||||
<input type="text" class="form-control" ng-model="entry.value" maxlength="100" ng-blur="updateEntry(entry)" />
|
<input type="text" class="form-control" ng-model="entry.value" maxlength="500" ng-blur="updateEntry(entry)" />
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="number" class="form-control" ng-model="entry.order" ng-blur="updateEntry(entry)" />
|
<input type="number" class="form-control" ng-model="entry.order" ng-blur="updateEntry(entry)" />
|
||||||
|
Loading…
Reference in New Issue
Block a user