Setup Manus Online
Manus Online (MOL) publishes for some partners its authority lists of people and organizations as CSV exports. This solution parses them (including their complex date expressions) into a database, and provides lookup by ID and paged search by name, type, SBN type, date range and roles.
Backend
To integrate MOL in your Cadmus API:
▶️ (1) add the Mol.Api.Controllers NuGet package, plus Mol.PgSql when using PostgreSQL (recommended for better performance).
▶️ (2) add to your API Program.cs in ConfigureAppServices or wherever you configure application services (configure options as preferred):
// MOL (endpoints under api/mol)
builder.Services.AddMolServices(options =>
{
options.Provider = MolDatabaseProvider.PostgreSQL;
options.ConnectionString = builder.Configuration.GetConnectionString("Mol");
options.StopOnInitializationFailure = false;
});
▶️ (3) in appsettings.json add MOL settings, e.g.:
{
"ConnectionStrings": {
"Mol": "Host=localhost;Username=postgres;Password=postgres;Database=mol"
},
"Mol": {
"Provider": "PostgreSQL",
"InitializationDelaySeconds": 10,
"InitializationRetryCount": 10,
"StopOnInitializationFailure": false
}
}
Every setting can be overridden with environment variables (e.g. in a Docker compose script), such as ConnectionStrings__Mol etc.
▶️ (4) in your docker-compose.yml script for the API service, remember to override the connection string and properly set the MOL initialization delay if needed. Also add a volume for seeding data at API startup if you do not do it manually:
__PRJ__-api:
environment:
ConnectionStrings__Mol: "Host=cadmus-__PRJ__-pgsql;Username=postgres;Password=postgres;Database=mol"
Mol__InitializationDelaySeconds: "30"
Frontend
▶️ (1) add NPM package:
pnpm i @myrmidon/cadmus-refs-mol-lookup
▶️ (2) add to app.ts the lookup provider configuration:
import { MolRefLookupService } from '@myrmidon/cadmus-refs-mol-lookup';
constructor(
// ...
const storage = inject(RamStorageService);
const mol = inject(MolRefLookupService);
storage.store(LOOKUP_CONFIGS_KEY, [
// ...
// MOL
{
name: 'MOL',
iconUrl: '/img/mol128.png',
description: 'Manus Online Authority File',
label: 'ID',
service: mol,
itemIdGetter: (item: any) => item?.id,
itemLabelGetter: (item: any) => mol.getName(item),
}
]);
)
▶️ (3) add to public/img the MOL icon mol128.png.