If I remember correctly, the magnets are in the statues or the blocks they move to the correct spot on the mantle or shelf. Use to be able to purchase these locks from Constantine's Restorer Supply. Used them on hidden desk drawers and wall panels.
I'm seriously considering making a simplified set of these for bookshelf/bayonet storage.
I'd let mine lay flat open against the wall to display the bayonets and since they aren't high-security items I could use a simple door slide lock with a channel cut through the top of the shelf, attach it to a book and done. Slide book back to open, slide forward to re lock.
No pistons, no magnets, I'm thinking a lowes trip for:
2 boards to length/width
Sliding door locks