[FREE PDF sample] Professional Alfresco Practical Solutions for Enterprise Content Management Wrox Programmer to Programmer 1st Edition David Caruana ebooks
[FREE PDF sample] Professional Alfresco Practical Solutions for Enterprise Content Management Wrox Programmer to Programmer 1st Edition David Caruana ebooks
https://ebookgate.com
https://ebookgate.com/product/professional-
alfresco-practical-solutions-for-enterprise-
content-management-wrox-programmer-to-
programmer-1st-edition-david-caruana/
https://ebookgate.com/product/professional-visual-studio-2008-wrox-
programmer-to-programmer-1st-edition-nick-randolph/
ebookgate.com
https://ebookgate.com/product/professional-c-4-and-net-4-wrox-
programmer-to-programmer-1st-edition-christian-nagel/
ebookgate.com
https://ebookgate.com/product/beginning-visual-c-2010-wrox-programmer-
to-programmer-1st-edition-karli-watson/
ebookgate.com
https://ebookgate.com/product/professional-community-server-themes-
programmer-to-programmer-1st-edition-wyatt-preul/
ebookgate.com
https://ebookgate.com/product/cloud-computing-with-the-windows-azure-
platform-wrox-programmer-to-programmer-1st-edition-roger-jennings/
ebookgate.com
https://ebookgate.com/product/professional-windows-powershell-for-
exchange-server-2007-service-pack-1-programmer-to-programmer-joezer-
cookey-gam/
ebookgate.com
https://ebookgate.com/product/beginning-lua-programming-programmer-to-
programmer-1st-edition-kurt-jung/
ebookgate.com
Caruana,
Discover what makes Alfresco a unique et al. Join the discussion @ p2p.wrox.com Wrox Programmer to Programmer™
solution for your business needs
Professional
Alfresco is a fast, cost-effective enterprise content management system
for Web sites and content applications provided under an open source
license. This book will help developers, architects, Web site architects,
project managers, and content management professionals understand
what Alfresco provides, how it can be implemented, and how
Alfresco can integrate into existing applications or Web sites. This
is the definitive resource written by the people who built Alfresco.
Professional Alfresco:
• Discusses the fundamental Alfresco architecture, components, and services
wrox.com
• Shares detailed guidance on building content applications with the Programmer
Alfresco
Alfresco platform Forums
• Explores Alfresco’s use of new content management standards like Join our Programmer to
Programmer forums to ask
Content Management Interoperability Services (CMIS) and answer programming
• Explains how to extend Alfresco for custom functionality through questions about this book,
join discussions on the
easy Web scripting hottest topics in the industry,
• Offers an overview of the Spring Surf Framework, its features, and and connect with fellow
programmers from around
how it can be used
the world.
• Provides real-world code examples and scenarios in Java® and
JavaScript® with various levels of sophistication and complexity Code Downloads
Take advantage of free code
• Addresses integration with other applications, Web sites, and portals
Professional
samples from this book, as
including Lotus®, Drupal®, SAP®, and Liferay® well as code samples from
hundreds of other books, all
®
David Caruana is the Chief Architect for Alfresco Software. ready to use.
Alfresco
John Newton is the CTO and Chairman for Alfresco Software.
Michael Farman is the Director of Product Management for Alfresco Software.
Read More
Michael G. Uzquiano is the Director of Web Platform Tools for Alfresco Software.
Find articles, ebooks, sample
chapters, and tables of contents Practical ®
Kevin Roast is the User Interface Technical Lead for Alfresco Software. for hundreds of books, and Solutions
more reference resources on for
programming topics that matter
Wrox Professional guides are planned and written by working programmers Enterprise
to meet the real-world needs of programmers, developers, and IT professionals. to you.
Content
Focused and relevant, they address the issues technology professionals face every
day. They provide examples, practical solutions, and expert education in new
technologies, all designed to help programmers do a better job.
Management Practical Solutions for Enterprise Content Management
Contact Us.
We always like to get feedback from our readers. Have a book idea?
Need community support? Let us know by e-mailing [email protected]
PROFESSIONAL ALFRESCO®
INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxix
Continues
PART V APPENDICES (ONLINE ONLY)
APPENDIX A RESTful API Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
APPENDIX B Surf Platform API Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
APPENDIX C Repository FreeMarker Template API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
APPENDIX D Repository JavaScript API Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
APPENDIX E Surf Quick Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513
PROFESSIONAL
Alfresco ®
PROFESSIONAL
Alfresco ®
David Caruana
John Newton
Michael Farman
Michael G. Uzquiano
Kevin Roast
ISBN: 978-0-470-57104-0
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means,
electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the
1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through
payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978)
750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions Department,
John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at
http://www.wiley.com/go/permissions.
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to
the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation
warranties of fitness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The
advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the
publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the
services of a competent professional person should be sought. Neither the publisher nor the author shall be liable for damages
arising herefrom. The fact that an organization or Web site is referred to in this work as a citation and/or a potential source of
further information does not mean that the author or the publisher endorses the information the organization or Web site may
provide or recommendations it may make. Further, readers should be aware that Internet Web sites listed in this work may have
changed or disappeared between when this work was written and when it is read.
For general information on our other products and services please contact our Customer Care Department within the United
States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in
electronic books.
Library of Congress Control Number: 2010921243
Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related trade dress are
trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries,
and may not be used without written permission. Alfresco is a registered trademark of Alfresco Software, Inc. All other
trademarks are the property of their respective owners. Wiley Publishing, Inc. is not associated with any product or vendor
mentioned in this book.
To Karen and Matthew for allowing the time.
–David Caruana
For my wife Loveday, my kids Michael and Helena, and all the dedicated
people at Alfresco.
–John Newton
–Michael Farman
For Jarmi — with whom the cold Chicago winters are fun . . .
and even kind of warm.
–Michael G. Uzquiano
For my wife Lyn for putting up with my computer obsessions, and for my two
‘‘little bears’’ Benjamin and Alexander.
–Kevin Roast
ABOUT THE AUTHORS
DAVID CARUANA is Chief Architect and a founding engineer of Alfresco Software, where he is
responsible for overall product architecture and design, and has developed many of the core capabil-
ities of Alfresco, such as content modeling, workflow, Web scripts, and CMIS. With over 15 years
of experience in the ECM industry, David has previously led product development at Documentum,
where he created Web Development Kit, and Oracle, where he developed several content reposi-
tories. David is a member of the JSR 283 (Content Repository for Java Technology API Version
2.0) Expert Group and the OASIS Content Management Interoperability Services (CMIS) Technical
Committee. He is also active on the Spring Surf and Apache Chemistry open source projects.
JOHN NEWTON, CTO and Chairman of Alfresco, has spent the last 25 years building information
management software. In 1990, he co-founded Documentum, the enterprise content management
company acquired by EMC, with Howard Shao. John started his career in databases as one of the
original engineers at Ingres, the relational database company, and ultimately ran the database devel-
opment group. John was also one of the first entrepreneurs in residence in Europe at Benchmark
Capital. In addition to the Alfresco board, John serves on the board of AIIM, the ECM industry
group, and the London International Festival of Theatre. John graduated with a degree in Electrical
Engineering and Computer Science from the University of California at Berkeley in 1981.
John blogs on content management, open source, and whatever he feels like on
http://newton.typepad.com.
MICHAEL FARMAN has over 20 years experience in the content management industry. He started
working at Interleaf, specializing in large-scale publishing, and was one of the early employees at
Documentum, initially focusing on the pharmaceutical industry and the drug submission process.
Mike spent over ten years at Documentum, where he worked in a variety of technical roles and
vertical industries. Mike was an early employee at Alfresco, working in almost every department
over the past five years, then settling in his current role as Director of Product Management.
MICHAEL G. UZQUIANO is the Director of Web Platform Tools for Alfresco Software, where he has
led the development of Alfresco Surf and Web Studio for scriptable Web delivery and visual layout.
He is also the head of the Spring Surf Project — a formal Spring Framework extension. With over 12
years of experience in the ECM industry, Michael previously pioneered product and service efforts
at Trilogy Software, Epicentric, and Vignette.
Michael holds a Master’s Degree of Management from Northwestern University’s Kellogg Grad-
uate School of Management. He also holds Bachelor and Master of Science degrees in Electrical
Engineering from Cornell University.
KEVIN ROAST is a founding developer of the Alfresco platform and principal developer of the
Alfresco Surf Web Framework. He has over 10 years of experience in the software industry and was
previously a leading developer at Documentum. Kevin’s expertise is in developing and performance-
tuning enterprise-scale application platforms, as well as designing and implementing user interfaces
based on innovative technology. Kevin is also a contributor to various open source projects.
x ❘ ABOUT THE EDITORS
BRIANA WHERRY, the Alfresco Information manager, has spent the past 20 years specializing in
building new teams, designing processes, and embracing new technologies to deliver innovative
documentation solutions to a global audience. Briana has a long working history with the changing
face of technical writing, starting out her career with SGML, moving to HTML, and mostly recently
adopting DITA. When Briana joined Alfresco in 2007, she was faced with the double challenge of
building a new team and implementing DITA in an agile, open source development environment.
Briana is a senior member of the Society for Technical Communication (STC), and a member of the
OASIS DITA Adoption Committee.
DR. PAUL HOLMES-HIGGIN is VP of Engineering, with responsibility for managing Alfresco’s research
and development team and ensuring both innovation and quality are delivered in Alfresco’s software.
Paul has over 20 years of experience managing teams in collaborative research and development,
both in open source and proprietary software organizations. His expertise covers Knowledge-based
Expert Systems, Neural Networks, Information Extraction and Multilingual Natural Language Pro-
cessing. Paul has a PhD in Artificial Intelligence from the University of Surrey.
CREDITS
WHILE THERE ARE FIVE AUTHORS LISTED ON THE FRONT COVER, producing Professional Alfresco
has been a huge team effort.
We would like to thank all of the Alfresco Engineering team, particularly Gavin Cornwell, Andrew
Hind, Brian Remmington, Nicholas Smith, David Ward, Roy Wetherall, and Erik Winlof, for their
insight and technical know-how in the creation of the Alfresco system, and the writing and review of
this book. Additional thanks to the many members of the Engineering team who took on the addi-
tional burden of driving the Alfresco 3.2 release that was delivered during the writing of Professional
Alfresco.
We want to provide a very special thanks to Paul Holmes-Higgin, Vice President of Engineering, for
his role as technical editor for Professional Alfresco. Paul’s assistance was invaluable as he ensured
that the overall approach was right and the detail was accurate.
We also want to give a very big thank you and appreciation to the Alfresco Documentation team.
Without Briana Wherry and her documentation and project management skills, this book would not
have happened. Additional big thanks go to Janys Kobernick and Kathryn MacLean, who have done
an incredible job of turning our developer-speak into readable English.
And finally, we want to thank the Alfresco customers, partners, and community around the globe
for your guidance, feedback, and support through the years. This book is for you.
CONTENTS
INTRODUCTION xxix
CHAPTER 2: ARCHITECTURE 19
Guiding Principles 19
Supporting ECM Requirements 19
Simple, Simple, Simple 20
Scaling to the Enterprise 20
A Modular Approach 20
Incorporating Best-of-Breed Libraries 20
Environment Independence 20
A Solid Core 20
Scriptable Extensions 21
A Standards-Based Approach 21
An Architecture of Participation 21
A High-Level Overview 21
The Alfresco Content Application Server 23
The Content Repository 24
Modularity through a Spring Framework 26
Content Services 27
Protocols 28
APIs 30
The Remote API 30
The Embedded API 32
Content Modeling 33
The Alfresco Web Application Framework 35
Deployment Options 37
Embedded Alfresco 38
The Alfresco Content Application Server 38
Clustered Alfresco 38
The Backup Server 39
Multitenancy 39
The Enterprise Infrastructure 40
CHAPTER 3: SETTING UP AN ALFRESCO ENVIRONMENT 43
Installing Alfresco 43
Running the Alfresco Installation Wizard 44
Repository Configuration 45
Deploying Extensions 45
Spring Configuration Extensions 46
Web Script Extensions 46
Web Tier Configuration Extensions 47
Share Customization Extensions 47
Packaging Extension Files 48
xvi
CONTENTS
Debugging Tips 48
Server-Side JavaScript Logging 48
Server-Side JavaScript Debugging 49
Client-Side JavaScript Logging and Debugging 49
Disabling Caching 50
CHAPTER 4: SERVICES 53
Content Repository Services 54
File and Folder Management 54
Versioning and Check Out/Check In 54
Auditing 55
Authentication, Authorities, and Permissions 55
Modeling 55
Search 56
Content Application Services 56
Content Services 56
Rules and Actions 56
Transformation 56
Metadata Extraction 56
Thumbnailing 56
Control Services 57
Workflow 57
Web Projects 57
Sandboxes 57
Assets 57
Collaboration Services 57
Sites 57
Invite 58
Activity 58
Tagging 58
Commenting 58
How Services Are Built 58
Using Services 59
Embedded APIs 59
Remote APIs 61
Configuring and Extending Existing Services 61
Building a Simple Service 63
Example Counter Service: Tier 1–Java Service Layer 64
Example Counter Service: Tier 2–JavaScript API 64
Example Counter Service: Tier 3–RESTful API 65
xvii
CONTENTS
xviii
Another random document with
no related content on Scribd:
— Conte, una amica della vostra casa voleva salvarvi l'onore, scusate
l'incomodo... addio...
— Aspettate un momento, rispondeva irritato il conte, afferrando con
una mano convulsa le vesti di Maddalena, e gridando... dieci zecchini
sull'asso di spade!...
— Buona fortuna, signore!... e lasciatemi andare... Ripeteva la
maschera.
— Vi chieggo un momento per cortesia... il due di bastoni a quattro
zecchini... aspettate ancora un giro e parleremo...
— Sarà troppo tardi!...
La passione del giuoco teneva il conte inchiodato davanti al tavolino,
la gelosia lo agitava fortemente e l'interna lotta si manifestava sul
suo volto contratto dalla impazienza e dalla collera. Deciso di levarsi
da sedere, la comparsa d'una carta lo ripiombava sulla sedia, e
mentre con l'occhio intento seguiva le vicende del giuoco, colla
attenta orecchia ascoltava gli eccitamenti della maschera che gli
diceva:
— Peccato!... un angelo di bellezza... accogliere di notte in sua casa
un amante all'insaputa del marito!..
— Li raggiungo fra un istante... aspettatemi... quattro zecchini sul
cinque di bastoni...
— Per quattro zecchini... esporsi a perdere un tesoro... esporsi alla
vergogna... al ridicolo...
— Sono con voi... Paroli...
— Troppo tardi!... È già un'ora che sono partiti... forse fuggiti da
Venezia...
— Fuggiti!... e gettando le carte sul tavolo, con gli occhi stralunati e
scintillanti di collera, si levò ad un tratto, gettò a terra la sedia e
presa sotto al braccio la maschera la trasse in un canto della sala. La
folla si restrinse intorno al tavolo, e il suo posto venne occupato
subito da un altro, come nelle battaglie quando si chiudono le file
per riempire i vuoti lasciati dai morti.
Allora il conte, esaminando attentamente la maschera, voleva ad
ogni costo scoprire la persona che si permetteva d'insultarlo in quel
modo e di provocare la sua collera e la sua gelosia. Vani tentativi.
Allora sospettando ancora un qualche imbroglio, un raggiro
immaginato con uno scopo secondario, e dubitando della sincerità
della maschera, le chiese:
— Potreste dirmi il nome della persona che accompagnava mia
moglie?...
— Certamente!... il suo primo innamorato di Villa Saltore... il pittore
Valdrigo...
— Basta così!... rispose con cupa fisonomia il conte Leoni, e senza
proferire altra parola si allontanò dalla maschera, e uscendo dalla
stanza scese rapidamente le scale.
Maddalena e la compagna lo seguivano ad una certa distanza, ma
appena liberato dalla folla, si mise a camminare con passi tanto
frettolosi che volto il canto d'una via lo perdettero di vista
nell'oscurità della notte fra il labirinto delle calli.
La compagna che aveva assistito a tutta la scena, invano tirando per
la veste Maddalena, o stringendole le braccia, e susurrandole
all'orecchio le parole — basta — prudenza — trovandosi finalmente
sola con l'amica, le disse con un accento di paura:
— Che cosa hai fatto mai!... Maddalena!...
— Ho salvato Valdrigo da una relazione colpevole... Con una donna
troppo superiore alla sua condizione... da una maledetta passione...
— Lo hai perduto!... rispose la compagna affannata; hai esposto la
sua vita al più grande pericolo... forse...
— Taci per carità!... mio Dio... se il conte Leoni lo ammazzasse!...
Allora arrestandosi per trovare un appoggio al parapetto d'un ponte,
si asciugava i sudori del volto e mandava lampi dagli occhi. La sua
fantasia le dipingeva il conte Leoni con un coltello alla mano, in
traccia dei colpevoli... apriva una porta... li trovava abbracciati...
Allora ritornando alla collera ed alla gelosia che le ardeva nel cuore,
soggiungeva:
— Ebbene, li ammazzi tutti e due... e col braccio levato in aria faceva
segno di ferire, e raddoppiava i colpi con un sogghigno di gioja
spaventosa, ripetendo ogni volta — li ammazzi... li ammazzi!...
Ripresero il cammino verso il loro quartiere conversando concitate
per via sulle avventure della notte, e sui timori delle conseguenze
probabili.
Essendo vicine di casa si congedarono all'uscio, e ciascheduna entrò
nella propria dimora. Maddalena entrata nella sua stanza, si spogliò
in fretta e gettandosi macchinalmente sul letto incominciò a pensare
a' suoi casi. Ora si sentiva dilaniare dal rimorso, ora la collera le
accendeva lo spirito e la spingeva a desideri di vendetta e di sangue.
— Che cosa sarà succeduto?... chiedeva a sè stessa... e si cacciava
le mani nei capelli, e sospirava e piangeva. Poi riteneva il fiato e
ascoltava tremando. Ogni persona che passava per via risvegliava i
suoi sospetti... se venisse a casa ferito!... e pensava non senza una
certa gioja alle cure che gli avrebbe prodigate, alla guarigione sicura,
al pentimento, e, chi sa!... forse avrebbe aperto gli occhi e
conosciuto il suo amore... poi tornava a tormentarsi con più gravi
paure... se lo portassero a casa moribondo!... mio Dio!... per causa
mia!... la sua morte!... sua madre!... povera Rosa... e piangeva,
affranta dal dolore.
Le ore battevano lentamente all'orologio della chiesa vicina, il
silenzio regnava nella strada, non si sentiva che il tonfo dei remi di
qualche gondola che passava nel canale, e la voce del gondoliere —
stali — premi — all'atto di sboccare in laguna. I minuti le parevano
infiniti... il cervello in ebollizione la trascinava da un pensiero ad un
sogno, da una reminiscenza ad un timore, senza transizione
regolare, colla confusione del caos. Gli orecchi le tintinnavano ancora
della musica da ballo e del gridio delle maschere, vedeva l'oro dei
tavolieri del giuoco, e poi pensava ad una stanza silenziosa, a due
innamorati, ad un bacio, ad una donna svenuta in un'estasi d'amore
e d'obblio... e poi vedeva gli occhi ardenti del conte Leoni, un
coltello... un lago di sangue! Finalmente le parve di riconoscere un
passo lontano, tese l'orecchio con attenzione sostenuta, il passo si
avvicinava, e il cuore le diceva — è Valdrigo. — Poco dopo udì che
s'arrestava alla porta, e la chiave che entrava nella toppa. Aperto
l'uscio, Valdrigo saliva le scale ed entrava tranquillamente nella sua
stanza.
XXXI.
Quando un paese subisce gli ordini degli stranieri, l'ora della sua
morte è vicina. La neutralità disarmata, cioè il dolce far niente,
abbandonava Venezia inerme in balìa dei francesi. Spento l'antico
valore nei baccanali, e ammollite le fibre dei cittadini nella lunga
pace, nelle abitudini effeminate, nei piaceri d'una vita dilettosa,
l'indolenza aveva preso il posto dell'operosità, e la paura succedeva
al coraggio. I tempi delle guerre di Costantinopoli, Candia, Cipro e
Morea erano tramontati per sempre. Colla morte d'Angelo Emo erano
spenti gli eroi della tempra di Enrico Dandolo, di Vittor Pisani, di
Carlo Zeno, di Francesco Morosini. La vecchiaia aveva rimbambito la
Repubblica, le altere minaccie che avrebbero animato gli antichi alla
lotta, facevano piangere l'ultimo Doge. Spento ogni vigore di
governo, la città si divideva in partiti.
I sostenitori delle antiche leggi e degli aviti costumi, si stempravano
in lamenti imbelli e odiavano i francesi; ma alle armi che invadevano
lo Stato, rispondevano con impotenti proteste. I partigiani entusiasti
delle nuove idee spingevano la patria alla rovina, colla stolta fidanza
di trovare la libertà nella perdita della indipendenza. Fra questi
estremi in lotta si agitava il partito che si solleva in tutte le
rivoluzioni, come la schiuma nel mare burrascoso, e barcheggiando
fra gli uni e gli altri, cerca di cavarne il denaro, e gli onori.
Il governo mandava deputati a Bonaparte vincitore, il quale
rispondeva: — «Io sarò un Attila per lo Stato Veneto. Non voglio più
Senato, non voglio più inquisizione. Verrò io a rompere i piombi,
barbarie dei tempi antichi... le opinioni devono essere libere!» —
Tutto era perduto!... Mancava la forza per resistere e il genio per
governare; dovevasi aprire la porla alla libertà, e chiuderla in faccia
agli stranieri. Hanno fatto tutto al contrario!...
Il giorno 12 maggio 1797 fu l'ultimo per la repubblica che da Paolo
Lucio Anafesto a Lodovico Manin visse quattordici secoli
indipendente e gloriosa!
Una colonia di famiglie sfuggite alle stragi dei barbari venne a
piantare le sue tende sulle isolette deserte della laguna. Povera, ma
laboriosa fabbricò le sue piccole dimore di legno, e le modeste
barchette necessarie alla sussistenza dei pochi abitanti.
Crebbe a poco a poco col traffico, abbellì la sua modesta dimora col
frutto degli onesti guadagni. Aumentata la popolazione e la
ricchezza, ampliò le case fino a che giunse a fabbricarle coi marmi
dell'Oriente, ad abbellirle colle statue della antica Grecia; le
barchette pescareccie diventarono forti navigli, che percorsero i
mari, e tornarono in patria onusti di tesori e di gloria. Dapprima
marinaia, commerciante e guerriera, fu poi madre e nutrice di
sapienza e d'arti gentili.
Ma l'acquisto di Cipro le apportò colla ricchezza l'amore della voluttà,
le morbidezze di corrotti costumi; la scoperta d'America le fu fatale al
commercio. Giunta all'apogeo della fortuna s'arrestò a godere la
conquistata grandezza.
Ma chi s'arresta è sorpassato da chi avanza. Venezia cinta del
gemmato diadema si adagiò mollemente sul manto ducale, e
immersa in voluttuosi pensieri mentre il leone ammansato dormiva
ricevette gli omaggi del mondo che ammirava lo splendore della sua
bellezza. Nei giorni del pericolo la sua spada irrugginita e il braccio
infiacchito rifiutarono il loro uffizio, essa non aveva più forze, il suo
leone non aveva più ruggiti. Allora fidente nella costanza della
fortuna e nel prestigio de' suoi vezzi, si cinse di fiori, e assopita dal
dolce far niente, chiuse gli occhi... — Quando li riaperse lo scettro e
il diadema erano scomparsi, i fiori s'erano mutati in catene, il leone,
ferito nel cuore, spirava... Fece uno sforzo per difendersi, ma troppo
tardi!... la regina era divenuta una schiava...