Skip to content

Dive into Paged Media

Andy Smith edited this page Apr 26, 2016 · 2 revisions

Creating Objects in the Console

Creating Collections

col = Collection.new(title: ['Test Collection'])
col.depositor='[email protected]'
col.edit_users=['[email protected]']
col.save

Creating Paged Work and Adding to Collection

work = PagedWork.new(title: ['Test Work'])
work.depositor='[email protected]'
work.edit_users=['[email protected]']
work.creator='[email protected]'
work.save
col.members << work

Creating Container and Adding to Paged Work

c = Container.new(title: 'Test Container')
c.save
work.members << c
work.save
col.save

Creating Pages and Adding to Container

f1 = FileSet.new(title: ['Page 1'])
f1.depositor='[email protected]'
f1.edit_users=['[email protected]']
f2 = FileSet.new(title: ['Page 2'])
f2.depositor='[email protected]'
f2.edit_users=['[email protected]']
c.members << [f1,f2]
c.save
work.save
col.save