Skip to content

Commit

Permalink
Merge pull request #67 from ianibo/master
Browse files Browse the repository at this point in the history
Improve searching and title lookup
  • Loading branch information
ianibo committed Dec 11, 2018
2 parents e9954fc + 6457b54 commit 9b00f86
Show file tree
Hide file tree
Showing 10 changed files with 222 additions and 208 deletions.
2 changes: 1 addition & 1 deletion scripts/dev_submit_pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ TRIAL_AGREEMENT_ID=`curl --header "X-Okapi-Tenant: diku" -H "Content-Type: appli
localReference: "TRIAL_ALR_001",
vendorReference: "TRIAL_AVR_001",
startDate: "2018-01-01",
endDate: "2018-12-31",
endDate: "2019-12-31",
renewalDate: "2019-01-01",
nextReviewDate: "2018-10-01",
vendor: {
Expand Down
8 changes: 4 additions & 4 deletions scripts/register_and_enable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ if [ ! -d "$DESCRIPTORDIR" ]; then
./gradlew generateDescriptors
fi

curl -XDELETE http://localhost:9130/_/proxy/tenants/diku/modules/olf-erm-1.0.0
curl -XDELETE http://localhost:9130/_/discovery/modules/olf-erm-1.0.0/localhost-olf-erm-1.0.0
curl -XDELETE http://localhost:9130/_/proxy/modules/olf-erm-1.0.0
curl -XDELETE http://localhost:9130/_/proxy/tenants/diku/modules/olf-erm-1.0.3
curl -XDELETE http://localhost:9130/_/discovery/modules/olf-erm-1.0.0/localhost-olf-erm-1.0.3
curl -XDELETE http://localhost:9130/_/proxy/modules/olf-erm-1.0.3
# ./gradlew clean generateDescriptors
curl -XPOST http://localhost:9130/_/proxy/modules -d @"${DESCRIPTORDIR}/ModuleDescriptor.json"
curl -XPOST http://localhost:9130/_/discovery/modules -d @"${DESCRIPTORDIR}/DeploymentDescriptor.json"
curl -XPOST http://localhost:9130/_/proxy/tenants/diku/modules -d '{"id": "olf-erm-1.0.0"}'
curl -XPOST http://localhost:9130/_/proxy/tenants/diku/modules -d '{"id": "olf-erm-1.0.3"}'
popd
3 changes: 1 addition & 2 deletions service/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ gormVersion=6.1.10.RELEASE
gradleWrapperVersion=3.5

appName=olf-erm
appVersion=1.0.2

appVersion=1.0.3

dockerRepo=folioci
dockerTagSuffix=
4 changes: 2 additions & 2 deletions service/grails-app/domain/org/olf/kb/Identifier.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public class Identifier implements MultiTenant<Identifier> {
static mapping = {
id column:'id_id', generator: 'uuid', length:36
version column:'id_version'
value column:'id_value'
ns column:'id_ns_fk'
value column:'id_value', index:'identifier_value_idx'
ns column:'id_ns_fk', index:'identifier_value_idx'
}

static constraints = {
Expand Down
16 changes: 9 additions & 7 deletions service/grails-app/domain/org/olf/kb/TitleInstance.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,8 @@ public class TitleInstance extends ErmResource implements MultiTenant<TitleInsta
static namedQueries = {
entitled {
createAlias ('platformInstances', 'pi')
// createAlias ('pi.entitlements', 'pi_entitlements', JoinType.LEFT_OUTER_JOIN)
createAlias ('pi.packageOccurences', 'pi_po', JoinType.LEFT_OUTER_JOIN)
// createAlias ('pi_po.entitlements', 'pi_po_entitlements', JoinType.LEFT_OUTER_JOIN)
createAlias ('pi_po.pkg', 'pi_po_pkg', JoinType.LEFT_OUTER_JOIN)
// createAlias ('pi_po_pkg.entitlements', 'pi_po_pkg_entitlements', JoinType.LEFT_OUTER_JOIN)


createAlias ('pi.packageOccurences', 'pi_po', JoinType.LEFT_OUTER_JOIN)
createAlias ('pi_po.pkg', 'pi_po_pkg', JoinType.LEFT_OUTER_JOIN)
or {
isNotEmpty 'pi.entitlements'
isNotEmpty 'pi_po.entitlements'
Expand Down Expand Up @@ -62,4 +57,11 @@ public class TitleInstance extends ErmResource implements MultiTenant<TitleInsta
name (nullable:false, blank:false)
work (nullable:true, blank:false)
}

public String getCodexSummary() {
dev num_entitlements = 0;
dev num_current_entitlements = 0;
dev num_package_appearences = 0;
return "${name} (${type?.value}/${subType?.value})";
}
}
Loading

0 comments on commit 9b00f86

Please sign in to comment.