Top Level Namespace
- Includes:
- JSONModel
Defined Under Namespace
Modules: ASConstants, ASModel, ASUtils, ASpaceCoverage, ASpaceExport, ASpaceImport, ASpaceMappings, AgentManager, AgentNames, Agents, ApplicationHelper, ArchivalObjectSeries, AspaceFormHelper, AuthHelpers, AutoGenerator, ClassificationHelper, ClassificationIndexing, Classifications, CollectionManagements, ColumnDefs, ComponentTransfer, ComponentsAddChildren, CrudHelpers, Dates, Deaccessions, DigitalObjectTrees, DirectionalRelationships, DynamicEnums, EACBaseMap, EnumerationHelper, Events, Exceptions, ExportHelper, ExportHelpers, Extents, ExternalDocuments, ExternalIDs, FileEmbedHelper, FileVersions, I18n, Identifiers, ImpliedPublication, Instances, JSON, JSONModel, JSONModelI18nMixin, JSONSchemaUtils, JobsHelper, MapToAspaceContainer, MarcXMLBaseMap, MemoryLeak, MixedContentParser, Notes, NotesHelper, ObjectGraph, PluginHelper, Publishable, RESTHelpers, RecordChildren, RecordableCataloging, ReindexTopContainers, RelatedAgents, Relationships, ReportHelper, ReportManager, ResolverHelper, ResourceTrees, RestrictionCalculator, RevisionStatements, RightsRestrictionNotes, RightsStatements, SearchHelper, Sequel, SequelColumnTypes, SerializeExtraContainerValues, SidebarHelper, SubContainers, Subjects, Telephones, TestUtils, Transferable, TreeNodes, Trees, URIResolver, UserDefineds, WelcomeHelper
Classes: ASDate, ASFop, ASpaceEnvironment, ASpaceGems, ASpaceLogger, AbstractReport, AccessDeniedException, Accession, AccessionConverter, AccessionsController, ActiveEdit, AdvancedQueryBuilder, AdvancedSearch, AgentContact, AgentCorporateEntity, AgentFamily, AgentPerson, AgentRelationshipAssociative, AgentRelationshipEarlierlater, AgentRelationshipParentchild, AgentRelationshipSubordinatesuperior, AgentSoftware, AgentsController, AnonymousUser, ApplicationController, ArchivalObject, ArchivalObjectChildren, ArchivalObjectsController, ArchivalRecordChildren, ArchivesSpaceDynamicEnumAttribute, ArchivesSpaceReadOnlyDynamicEnumAttribute, ArchivesSpaceSchema, ArchivesSpaceService, ArchivesSpaceSubTypeAttribute, ArchivesSpaceTypeAttribute, ArchivistsToolkit, AspaceJsonToManagedContainerMapper, AuthenticationManager, BackendEnumSource, BackgroundJobQueue, BadParamsException, BarcodeCheck, BatchDeleteController, BatchDeleteFailed, BatchImportRunner, CSVResponse, Classification, ClassificationTerm, ClassificationTermsController, ClassificationsController, ClientEnumSource, CollectionManagement, CollectionManagementController, CollectionManagementRecordsController, ConflictException, Container, ContainerLocation, ContainerManagementMigration, ContainerProfile, ContainerProfilesController, Converter, CreatedAccessionsReport, DB, DBAuth, DBMigrator, DCModel, DCSerializer, Deaccession, DefaultValues, DigitalObject, DigitalObjectChildren, DigitalObjectComponent, DigitalObjectComponentChildren, DigitalObjectComponentsController, DigitalObjectConverter, DigitalObjectsController, DigitalRecordChildren, EACConverter, EACModel, EACSerializer, EADConverter, EADModel, EADSerializer, EditMediator, Enumeration, EnumerationValue, EnumerationsController, Event, EventsController, ExportsController, Extent, ExtentCalculator, ExtentCalculatorController, ExternalDocument, ExternalId, FileVersion, FindAndReplaceRunner, Group, GroupsController, HTMLResponse, IDLookup, IfMissingAttribute, ImportCanceled, ImportException, Instance, InstanceData, InstanceKey, InvalidUsernameException, JDBCReport, JSONModelType, JSONReport, JSONResponse, JasperReport, JasperReportRegister, Job, JobCreatedRecord, JobFile, JobModifiedRecord, JobRunner, JobsController, LDAPAuth, LDAPException, LabelModel, Location, LocationsController, Log, LongPolling, MARCModel, MARCSerializer, METSModel, METSSerializer, MODSModel, MODSSerializer, MarcXMLAccessionConverter, MarcXMLConverter, MergeRequestFailed, MockAuthenticationSource, MockHTTP, NameAuthorityId, NameCorporateEntity, NameFamily, NamePerson, NameSoftware, NestedRecordResolver, NotFoundException, Note, NoteBibliography, NoteDigitalObject, NoteIndex, NoteIndexItem, NoteMultipart, NoteOrderedlist, NotePersistentId, NoteSinglepart, Notifications, PDFResponse, Permission, Permissions, Preference, PreferencesController, PrintToPDFRunner, ProgressTicker, RdeTemplate, RdeTemplatesController, ReadOnlyException, RealtimeIndexing, RecordNotFound, ReferenceError, ReportResponse, ReportRunner, RepositoriesController, Repository, RepositoryNotEmpty, RepositoryReport, RequestContext, Resequencer, Resolver, ResolverController, Resource, ResourceChildren, ResourcesController, RetryTransaction, RevisionStatement, RightsRestriction, RightsRestrictionType, RightsStatement, Search, SearchController, SearchResultData, Sequence, SequenceError, SequenceGenerator, Session, SessionController, Solr, SolrSnapshotter, StaticAssetFinder, StreamingImport, StreamingJsonReader, SubContainer, SubContainerToAspaceJsonMapper, Subject, SubjectsController, SubnoteMetadata, SystemInfoController, Telephone, Term, TestsController, Ticker, Tombstone, TopContainer, TopContainersController, TransferConstraintError, UnprocessedAccessionsReport, UpdateMonitorController, User, UserDefined, UserDefinedFieldMigrator, UserNotFoundException, Username, UsersController, UtilsController, ValidatorCache, Vocabulary, WelcomeController, XLSXResponse
Schemata: abstract_agent_relationship_schema, abstract_agent_schema, abstract_archival_object_schema, abstract_classification_schema, abstract_name_schema, abstract_note_schema, accession_parts_relationship_schema, accession_schema, accession_sibling_relationship_schema, active_edits_schema, advanced_query_schema, agent_contact_schema, agent_corporate_entity_schema, agent_family_schema, agent_person_schema, agent_relationship_associative_schema, agent_relationship_earlierlater_schema, agent_relationship_parentchild_schema, agent_relationship_subordinatesuperior_schema, agent_software_schema, archival_object_schema, archival_record_children_schema, boolean_field_query_schema, boolean_query_schema, classification_schema, classification_term_schema, classification_tree_schema, collection_management_schema, container_location_schema, container_profile_schema, container_schema, date_field_query_schema, date_schema, deaccession_schema, default_values_schema, defaults_schema, digital_object_component_schema, digital_object_schema, digital_object_tree_schema, digital_record_children_schema, enumeration_migration_schema, enumeration_schema, enumeration_value_schema, event_schema, extent_schema, external_document_schema, external_id_schema, field_query_schema, file_version_schema, find_and_replace_job_schema, group_schema, import_job_schema, instance_schema, job_schema, location_batch_schema, location_batch_update_schema, location_schema, merge_request_schema, name_corporate_entity_schema, name_family_schema, name_form_schema, name_person_schema, name_software_schema, note_abstract_schema, note_bibliography_schema, note_bioghist_schema, note_chronology_schema, note_citation_schema, note_definedlist_schema, note_digital_object_schema, note_index_item_schema, note_index_schema, note_multipart_schema, note_orderedlist_schema, note_outline_level_schema, note_outline_schema, note_singlepart_schema, note_text_schema, permission_schema, preference_schema, print_to_pdf_job_schema, rde_template_schema, record_tree_schema, report_job_schema, repository_schema, repository_with_agent_schema, resource_schema, resource_tree_schema, revision_statement_schema, rights_restriction_schema, rights_statement_schema, sub_container_schema, subject_schema, telephone_schema, term_schema, top_container_schema, user_defined_schema, user_schema, vocabulary_schema
Constant Summary
- DEFAULT_INDICATOR =
'default_indicator'
- BASE_SEARCH_PARAMS =
[["q", String, "A search query string",
:optional => true],
["aq", JSONModel(:advanced_query), "A json string containing the advanced query",
:optional => true],
["type",
[String],
"The record type to search (defaults to all types if not specified)",
:optional => true],
["sort",
String,
"The attribute to sort and the direction e.g. &sort=title desc&...",
:optional => true],
["facet",
[String],
"The list of the fields to produce facets for",
:optional => true],
["filter_term", [String], "A json string containing the term/value pairs to be applied as filters. Of the form: {\"fieldname\": \"fieldvalue\"}.",
:optional => true],
["simple_filter", [String], "A simple direct filter to be applied as a filter. Of the form 'primary_type:accession OR primary_type:agent_person'.",
:optional => true],
["exclude",
[String],
"A list of document IDs that should be excluded from results",
:optional => true],
["root_record",
String,
"Search within a collection of records (defined by the record at the root of the tree)",
:optional => true]]
- AbstractRelationship =
We’ll create a concrete instance of this class for each defined relationship.
Class.new(Sequel::Model) do
- JOB_TYPES =
[
{"type" => "JSONModel(:import_job) object"},
{"type" => "JSONModel(:find_and_replace_job) object"},
{"type" => "JSONModel(:print_to_pdf_job) object"},
{"type" => "JSONModel(:report_job) object"}
]
- MERGEABLE_TYPES =
[
{"type" => "JSONModel(:subject) uri"},
{"type" => "JSONModel(:agent_person) uri"},
{"type" => "JSONModel(:agent_corporate_entity) uri"},
{"type" => "JSONModel(:agent_software) uri"},
{"type" => "JSONModel(:agent_family) uri"},
{"type" => "JSONModel(:resource) uri"},
{"type" => "JSONModel(:digital_object) uri"}
]
Instance Method Summary
(collapse)
-
- (Object) a_resource
-
- (Object) add_restriction_to_record(record, begin_date = '2000-01-01', end_date = '2020-01-01', local_access_restriction_type = ["RestrictedSpecColl", "RestrictedCurApprSpecColl", "RestrictedFragileSpecColl", "InProcessSpecColl", "ColdStorageBrbl"])
-
- (Object) build_container_location(location_uri, status = 'current')
-
- (Object) create_ao_with_instances(resource, parent, containers = [])
-
- (Object) create_archival_object_with_rights(top_container_json, dates = [])
-
- (Object) create_container_profile(name, depth, height, width, dim_units, ext_dim)
-
- (Object) create_containers(container_profile, num = 1)
-
- (Object) create_user(username = "test1", name = "Tester")
-
- (Object) find_and_replace_job(resource_uri)
-
- (Object) print_to_pdf_job(resource_uri)
-
- (Object) stub_default_indicator
Methods included from JSONModel
JSONModel, #JSONModel, add_error_handler, all, allow_unmapped_enum_value, backend_url, client_mode?, custom_validations, destroy_model, enum_default_value, enum_values, handle_error, init, load_schema, #models, models, parse_jsonmodel_ref, parse_reference, repository, repository_for, schema_src, set_repository, strict_mode, strict_mode?, with_repository
Instance Method Details
- (Object) a_resource
20
21
22
|
# File 'backend/spec/model_find_and_replace_job_spec.rb', line 20
def a_resource
create(:json_resource, :extents => [build(:json_extent, :container_summary => "a box of foos")])
end
|
- (Object) add_restriction_to_record(record, begin_date = '2000-01-01', end_date = '2020-01-01', local_access_restriction_type = ["RestrictedSpecColl", "RestrictedCurApprSpecColl",
"RestrictedFragileSpecColl", "InProcessSpecColl",
"ColdStorageBrbl"])
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'backend/spec/model_restriction_spec.rb', line 6
def add_restriction_to_record(record,
begin_date = '2000-01-01',
end_date = '2020-01-01',
local_access_restriction_type = ["RestrictedSpecColl", "RestrictedCurApprSpecColl",
"RestrictedFragileSpecColl", "InProcessSpecColl",
"ColdStorageBrbl"])
record['notes'] << build(:json_note_multipart,
:type => 'accessrestrict',
:rights_restriction => {
:begin => begin_date,
:end => end_date,
:local_access_restriction_type => local_access_restriction_type
}).to_hash
clz = Kernel.const_get(record.class.record_type.to_s.camelize)
clz[record.id].update_from_json(record)
end
|
- (Object) build_container_location(location_uri, status = 'current')
19
20
21
22
23
24
25
26
27
|
# File 'backend/spec/model_managed_container_spec.rb', line 19
def build_container_location(location_uri, status = 'current')
hash = {
'status' => status,
'start_date' => '2000-01-01',
'ref' => location_uri
}
hash['end_date'] = '2010-01-01' if status == 'previous'
JSONModel(:container_location).from_hash(hash)
end
|
- (Object) create_ao_with_instances(resource, parent, containers = [])
24
25
26
27
28
29
|
# File 'backend/spec/model_extent_calculator_spec.rb', line 24
def create_ao_with_instances(resource, parent, containers = [])
create(:json_archival_object,
"resource" => {"ref" => resource.uri},
"parent" => {"ref" => parent.uri},
"instances" => containers.map{|con| build_instance(con)})
end
|
- (Object) create_archival_object_with_rights(top_container_json, dates = [])
7
8
9
10
11
12
13
14
15
16
|
# File 'backend/spec/model_managed_container_spec.rb', line 7
def create_archival_object_with_rights(top_container_json, dates = [])
rights_statements = dates.map{|date| build(:json_rights_statement, {
:restriction_start_date => date[0],
:restriction_end_date => date[1]
})}
archival_object = create(:json_archival_object,
:instances => [build_instance(top_container_json)],
:rights_statements => rights_statements)
archival_object.save
end
|
- (Object) create_container_profile(name, depth, height, width, dim_units, ext_dim)
5
6
7
8
9
10
11
12
|
# File 'backend/spec/model_extent_calculator_spec.rb', line 5
def create_container_profile(name, depth, height, width, dim_units, ext_dim)
create(:json_container_profile, :name => name,
:depth => depth,
:height => height,
:width => width,
:dimension_units => dim_units,
:extent_dimension => ext_dim)
end
|
- (Object) create_containers(container_profile, num = 1)
15
16
17
18
19
20
21
|
# File 'backend/spec/model_extent_calculator_spec.rb', line 15
def create_containers(container_profile, num = 1)
containers = []
num.times do |n|
containers << create(:json_top_container, 'container_profile' => {'ref' => container_profile.uri})
end
containers
end
|
- (Object) create_user(username = "test1", name = "Tester")
3
4
5
6
7
8
9
|
# File 'backend/spec/controller_user_spec.rb', line 3
def create_user(username = "test1", name = "Tester")
user = JSONModel(:user).from_hash(:username => username,
:name => name)
user.save(:password => "password")
end
|
- (Object) find_and_replace_job(resource_uri)
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'backend/spec/model_find_and_replace_job_spec.rb', line 5
def find_and_replace_job(resource_uri)
json = build(:json_job,
:job_type => 'find_and_replace_job',
:job => build(:json_find_and_replace_job,
:find => "/foo/",
:replace => "bar",
:record_type => "extent",
:property => "container_summary",
:base_record_uri => resource_uri
)
)
json
end
|
- (Object) print_to_pdf_job(resource_uri)
6
7
8
9
10
11
|
# File 'backend/spec/model_print_to_pdf_job_spec.rb', line 6
def print_to_pdf_job( resource_uri )
build( :json_job,
:job_type => 'print_to_pdf_job',
:job => build(:json_print_to_pdf_job, :source => resource_uri)
)
end
|
- (Object) stub_default_indicator
9
10
11
12
13
14
15
|
# File 'backend/spec/model_compatibility_spec.rb', line 9
def stub_default_indicator
AppConfig.stub(:[]).and_call_original
AppConfig.stub(:has_key?).and_call_original
AppConfig.stub(:has_key?).with(:managed_containers_default_indicator).and_return(true)
AppConfig.stub(:[]).with(:managed_containers_default_indicator).and_return(DEFAULT_INDICATOR)
end
|