-
Notifications
You must be signed in to change notification settings - Fork 3
AdvancedFeatures
You're in luck. MST uses MySQL for persistent storage and we provide hooks for you to create, alter, and delete database tables when your service is installed, updated, or deleted. Your custom tables will be contained in its own database/schema, so make sure your database user has the proper privileges to create and drop schemas.
- There are 3 files that will be run automatically when you install, update, or delete a service in the MST.
- install.sql
- update.{version}.sql
- This could actually be more than one file because your customers might not all upgrade for each version you release. When a service is updated, the MST will run each update script from the previous version (exclusive) to the version being upgraded to (inclusive). For example
- previous version: 1.0.1
- version being upgraded to: 1.0.4
- the mst will run the scripts (not failing if they don't exist)
- update.1.0.2.sql
- update.1.0.3.sql
- update.1.0.4.sql
- This could actually be more than one file because your customers might not all upgrade for each version you release. When a service is updated, the MST will run each update script from the previous version (exclusive) to the version being upgraded to (inclusive). For example
- delete.sql
- since your database tables, procedures, functions are all contained within a schema, the MST will just drop that schema. So it's not necessary for you to explicitly drop your tables. However, you might have a reason to do some cleanup processing for whatever reason.
Your custom developer environment is already configured with spring. This means that many utilities are automatically injected into your MetadataService implementation. If your service needs custom database tables, we suggest you follow the DAO pattern. We've made it easy for you to follow this pattern by adhering to convention over configuration. The diagram below shows the pattern we follow for coordinating our classes.
What does this mean to me?
- note: Despite having "service" in its name, classes which extend GenericMetadataService are actually managers (extends BaseManager) according to the above diagram. When this section speaks of services, it is referring to the service pattern in the above diagram (not an implementation of MetadataService).
- If you're doing any database code, you'll want to do that in 1 or more DAOs. You may also optionally want to have 1 or more Service classes to coordinate your DAOs. Service classes provide an additional layer between your MetadataService class and your DAOs.
- To follow our DAO pattern
- Your class must extend GenericMetadataServiceDAO
- you must add a setter method to the class you wish to inject your DAO into. This can either be your MetadataService (manager) class or your own service classes. eg
public class TransformationService extends GenericMetadataService {
protected HeldHoldingRecordDAO heldHoldingRecordDAO = null;
public void setHeldHoldingRecordDAO(HeldHoldingRecordDAO heldHoldingRecordDAO) {
this.heldHoldingRecordDAO = heldHoldingRecordDAO;
}
...
}
- To follow our Service pattern
- Your class must be part of our classpath structure, i.e. xc.mst.services
- Your class must extend GenericMetadataServiceService
- you must add a setter method to the class you wish to inject your Service into. This would be in your MetadataService (manager) class. eg
public class TransformationService extends GenericMetadataService {
protected MyTotallyAwesomeService myTotallyAwesomeService= null;
public void setMyTotallyAwesomeService (MyTotallyAwesomeService myTotallyAwesomeService) {
this.myTotallyAwesomeService= myTotallyAwesomeService;
}
...
}
But what benefit does this have?
Without any configuration (beyond the above instructions), you'll have access to a spring JdbcTemplate which makes it super easy to do database operations. eg
String lastName = this.jdbcTemplate.queryForObject(
"select last_name from t_actor where id = ?",
new Object[]{1212L}, String.class);
this.jdbcTemplate.update(
"update t_actor set = ? where id = ?",
"Banjo", 5276L);
- Downloads
- Installing the Toolkit
- Hardware Requirements
- Installing 3rd Party Tools
- Installing the Metadata Services Toolkit
- Configuring
- Starting the MST
- Uninstalling and Reinstalling the MST
- Upgrading the MST
- Useful Info
- Using the Toolkit
- Services
- What is a service?
- What are Configuration 1 and Configuration 2?
- XC MARCXML Normalization
- MARCXML to XC Transformation
- DC to XC Transformation
- MARC Aggregation
- Multiple Instances of the Same Service
- Harvesting from an MST Service
- How To Implement a Service
- About the XC Schema
- MST Frequently Asked Questions
-
Performance Results
- RecordBreakdown
- MySQLCustomizations
- Release Notes
- Next Coding Period Summary
- Glossary
- Developer ScratchPad
- ServerChart
- Transformation 1.0
- TransformationDocumentationNotes
- new
- TransformationDocumentation
- old
- AdditionalWorksAndExpressions
- Transformation Service Documentation
- TransformationServiceSteps
- XcRoleTranslationTable
- AggregationServices
- MarcAggregation
- TransformationTwoPointOh
- old
- FirstIteration
- PriorDesign
- PackagingMST
- 1.0 Decisions
- ReleaseWork
- QuickInstallNotes
- MST Implementation Details
- OaiIdIndexAlgorithm
- CacheDetails
- MessageHandling
- ServiceTests
- ProcessingStepsExplained
- ResumptionToken->completeListSize
- UpdateDelete
- OaiPmhImpl
- record counts
- RecordCountsOnePtTwoPtOne
- in production
- how to log and display
- RecordCountsOnePtZero
- RecordCountTestRestarted
- UrRecordCounts
- RecordCountTesting
- TransformationWackiness
- OaiImplementation
- Testing
- randys-30
- RegressionTests
- QuickRef
- UnicodeNormalization
- LoggingHelp
- CodeFormatPolicy
- SvnBranchingStrategy
- MultipleEclipseWorkspaces
- DeleteReaddServiceForRetest
- FileHarvests
- CharsetEncodingWithEric
- DrupalSolrOptimization
- WorkPlan
- MetricsForAssessment
- IdeasForImprovement
- RandomNotes
-
Wiki en español
- Servicios
- Qué es un Servicio de Metadatos?
- Servicio de Normalización XC MARCXML
- Servicio de Transformación MARCXML a Esquema XC
- Servicio de Agregación MARC
- Servicios
