From: http://www.ddj.com/ftp/1998/1998_12/dprl.txt Date: 1999-06-22 See: http://www.ddj.com/articles/1998/9812/9812toc.htm See: http://www.oasis-open.org/cover/dprl.html#dobbs1998 ------------------------------------------------------------------------ Digital Content & Intellectual Property Rights by Arun Ramanujapuram and Prasad Ram Listing One (Work: (Rights-Language-Version: 1.02) (Work-ID: "ISDN-1-55860-166-X; AAP-2348957tut") (Description: "Title: 'Zuke-Zack, the Moby Dog Story' Author: 'John Beagle' Copyright 1994 Jones Publishing") (Owner: (Certificate: (Authority: "Library of Congress") (ID: "Murphy Publishers"))) (Parts: "Photo-Celebshots-Dogs-23487gfj" "Dog-Breeds-Chart-AKC") (Comment: "Rights edited by Pete Jones, June 1996.") (Contents: (From: 1) (To: 16636)) (Rights-Group: "Regular" (Comment: "This set of rights is used for standard retail editions.") (Bundle: (Time: (Until: 1998/01/01 0:01)) (Fee: (To: "Jones-PBLSH-18546789")(House: "Visa"))) (Play: (Fee: (Metered: (Rate: 1.00 USD) (Per: 1:0:0) (By: 0:0:1)) )) (Print: (Fee: (Per-Use: 10.00 USD)) (Printer: (Certificate: (Authority: "DPT" (Type: "TrustedPrinter-6"))) (Watermark: (Watermark-Str: "Title: 'Zeke Zack - the Moby Dog' Copyright 1994 by Zeke Jones. All Rights Reserved.") (Watermark-Tokens: user-id institution-location render-name render-time) ))) (Transfer: ) (Copy: (Fee: (Per-Use: 10.00 USD) )) (Copy: (Access: (User: (Certificate: (Authority: "Murphy Publishers") (Type: "Distributor"))))) (Delete:) (Backup:) (Restore: (Fee: (Per-Use: 5.00 USD))) )) Listing Two 1. The rights specification engine is instantiated. A default work with a rights group is established. UsageRights rgtEngine = UsageRights.getInstance(); Work work = rgtEngine.createWork("Work-ID-001235"); IRightsGroup rgtGroup = work.createRightsGroup("My Group"); 2. The View right is added to the rights group and a $10.00 US flat-rate fee conditions is specified for the right. This amount is to be credit to the publisher's account "PUB-BA-00234". IRight viewRgt = rgtGroup.addRight(IRight.VIEW); IFeeSpec feeSpec = viewRgt.createFeeSpec(); feeSpec.setFlatFee(10.00, Currency.USD); feeSpec.setAccount("PUB-BA-00234"); 3. The Print right is added to the rights group. A $5.00 US pay-per-use fee condition and a fixed interval time-condition are specified for the right. IRight printRgt = rgtGroup.addRight(IRight.PRINT); IFeeSpec feeSpec2 = printRgt.createFeeSpec(); feeSpec2.setFee(5.00, Currency.USD); feeSpec2.setAccount("PUB-BA-00234"); 4. The rights specification is saved in an output file. rgtEngine.save("c:\\docs\\mydoc\\example.rgt"); Listing Three 1. Instantiate the SPD preparation engine, which is part of the SPD preparation toolkit. Make a preparation request. The preparation engine uses the SPD Device Driver and generates a set of RPF pages from the native document. The RPF pages are placed in the target directory (say, c:\docs\mydoc). The native document name is "example.doc". SPDPrepKit prepEngine = new SPDPrepKit(); PrepEngine->preparationRequest("c:\\docs\\mydoc\\example.doc", "c:\\docs\\mydoc\\"); 2. Instantiate the SPD creation engine, which is part of the SPD creation toolkit. Set the engine properties such as the source directory (c:\docs\mydoc) that contains the set of RPF files, and the destination directory (say, c:\doc\myspd) where the generic SPD will be created. SPDCreateKit createEngine = new SPDCreateKit(); CreateEngine->setProperty(SPD_TEMPLATE_DIRECTORY, "c:\\docs\\mydoc\\"); createEngine->setProperty(SPD_TARGET_DIRECTORY, "c:\\docs\\myspd\\"); 3. Make an SPD creation request using the rights file created above. Note that if watermark and policies are not specified, the SPD will be created with default policies and no watermark. The default policies include password authentication, no tracking, simple text-based notification of permission information, and no tracking. Note that the RPF files in the source (or template) directory are identified using the original document's name. CreateEngine->create("example", "c:\\docs\\mydoc\\example.rgt", POLICY_DEFAULTS); 4. The generic SPD (a binary file) is created in c:\docs\myspd. 3