Skip to content

Commit

Permalink
Add weight attribute to Islandora/Repository Item object (#10)
Browse files Browse the repository at this point in the history
* Add weight attr to repo item

* Update weight to int
  • Loading branch information
jabrah authored Jan 21, 2022
1 parent 9d0a159 commit ef760df
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
13 changes: 7 additions & 6 deletions drupal/model/expected.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ type ExpectedPerson struct {
// Represents the expected results of a migrated repository object
type ExpectedRepoObj struct {
ExpectedWithTitle
UniqueId string `json:"unique_id"`
UniqueId string `json:"unique_id"`
Abstract []LanguageString
AccessRights []string `json:"access_rights"`
AltTitle []LanguageString `json:"alt_title"`
Expand Down Expand Up @@ -144,12 +144,13 @@ type ExpectedRepoObj struct {
Value string
LangCode string `json:"language"`
}
Weight int `json:"weight"`
}

// Represents the expected results of a migrated Access Rights taxonomy term
type ExpectedAccessRights struct {
ExpectedWithName
UniqueId string `json:"unique_id"`
UniqueId string `json:"unique_id"`
Authority []struct {
Uri string
Title string
Expand Down Expand Up @@ -177,7 +178,7 @@ type ExpectedIslandoraAccessTerms struct {
// Represents the expected results of a migrated Copyright and Use taxonomy term
type ExpectedCopyrightAndUse struct {
ExpectedWithName
UniqueId string `json:"unique_id"`
UniqueId string `json:"unique_id"`
Authority []struct {
Uri string
Title string
Expand Down Expand Up @@ -213,7 +214,7 @@ type ExpectedFamily struct {
// Represents the expected results of a migrated Genre taxonomy term
type ExpectedGenre struct {
ExpectedWithName
UniqueId string `json:"unique_id"`
UniqueId string `json:"unique_id"`
Authority []struct {
Uri string
Title string
Expand Down Expand Up @@ -250,7 +251,7 @@ type ExpectedGeolocation struct {
// Represents the expected results of a migrated Resource Types taxonomy term
type ExpectedResourceType struct {
ExpectedWithName
UniqueId string `json:"unique_id"`
UniqueId string `json:"unique_id"`
Authority []struct {
Uri string
Title string
Expand All @@ -266,7 +267,7 @@ type ExpectedResourceType struct {
// Represents the expected results of a migrated Subject taxonomy term
type ExpectedSubject struct {
ExpectedWithName
UniqueId string `json:"unique_id"`
UniqueId string `json:"unique_id"`
Authority []struct {
Uri string
Title string
Expand Down
27 changes: 14 additions & 13 deletions drupal/model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ type JsonApiNodeAttributes struct {
// exactly one resource.
func (jad *JsonApiData) Resolve(t *testing.T, v interface{}) {
u := jsonapi.JsonApiUrl{
T: t,
T: t,
// TODO FIXME the BaseUrl won't work as expected. Really the caller wants the BaseUrl that was used to retrieve
// the JsonApiData, which means we really need access to the JSON API 'links' object and use the 'self' href.
// But we can't do that easily right now.
Expand All @@ -86,7 +86,7 @@ func (jad *JsonApiData) Resolve(t *testing.T, v interface{}) {
// password
func (jad *JsonApiData) ResolveWithBasicAuth(t *testing.T, v interface{}, username string, password string) {
u := jsonapi.JsonApiUrl{
T: t,
T: t,
// TODO FIXME the BaseUrl won't work as expected. Really the caller wants the BaseUrl that was used to retrieve
// the JsonApiData, which means we really need access to the JSON API 'links' object and use the 'self' href.
// But we can't do that easily right now.
Expand Down Expand Up @@ -147,7 +147,7 @@ type JsonApiAccessRights struct {
Id string
JsonApiAttributes struct {
Name string
UniqueId string `json:"field_unique_id"`
UniqueId string `json:"field_unique_id"`
Description struct {
Value string
Format string
Expand All @@ -169,7 +169,7 @@ type JsonApiIslandoraAccessTerms struct {
Id string
JsonApiAttributes struct {
Name string
UniqueId string `json:"field_unique_id"`
UniqueId string `json:"field_unique_id"`
Description struct {
Value string
Format string
Expand All @@ -191,7 +191,7 @@ type JsonApiCopyrightAndUse struct {
Id string
JsonApiAttributes struct {
Name string
UniqueId string `json:"field_unique_id"`
UniqueId string `json:"field_unique_id"`
Description struct {
Value string
Format string
Expand Down Expand Up @@ -247,7 +247,7 @@ type JsonApiCollection struct {
JsonApiAttributes struct {
JsonApiNodeAttributes
Title string
UniqueId string `json:"field_unique_id"`
UniqueId string `json:"field_unique_id"`
Description struct {
Value string
LangCode string
Expand Down Expand Up @@ -336,6 +336,7 @@ type JsonApiIslandoraObj struct {
Title string
} `json:"field_library_catalog_link"`
OclcNumber []string `json:"field_oclc_number"`
Weight int `json:"field_weight"`
} `json:"attributes"`
JsonApiRelationships struct {
Abstract struct {
Expand Down Expand Up @@ -418,7 +419,7 @@ type JsonApiGenre struct {
Id string
JsonApiAttributes struct {
Name string
UniqueId string `json:"field_unique_id"`
UniqueId string `json:"field_unique_id"`
Description struct {
Value string
Format string
Expand All @@ -440,8 +441,8 @@ type JsonApiGeolocation struct {
Id string
JsonApiAttributes struct {
Name string
UniqueId string `json:"field_unique_id"`
Broader []struct {
UniqueId string `json:"field_unique_id"`
Broader []struct {
Uri string
Title string
} `json:"field_broader"`
Expand All @@ -467,7 +468,7 @@ type JsonApiResourceType struct {
Id string
JsonApiAttributes struct {
Name string
UniqueId string `json:"field_unique_id"`
UniqueId string `json:"field_unique_id"`
Description struct {
Value string
Format string
Expand All @@ -489,7 +490,7 @@ type JsonApiSubject struct {
Id string
JsonApiAttributes struct {
Name string
UniqueId string `json:"field_unique_id"`
UniqueId string `json:"field_unique_id"`
Description struct {
Value string
Format string
Expand All @@ -511,7 +512,7 @@ type JsonApiLanguage struct {
Id string
JsonApiAttributes struct {
Name string
UniqueId string `json:"field_unique_id"`
UniqueId string `json:"field_unique_id"`
LanguageCode string `json:"field_language_code"`
Description struct {
Value string
Expand Down Expand Up @@ -583,7 +584,7 @@ type JsonApiCorporateBody struct {
Id string
JsonApiAttributes struct {
Name string
UniqueId string `json:"field_unique_id"`
UniqueId string `json:"field_unique_id"`
Description struct {
Value string
Format string
Expand Down

0 comments on commit ef760df

Please sign in to comment.