View Javadoc
1   /*
2    * Copyright (c) 2002-2023, City of Paris
3    * All rights reserved.
4    *
5    * Redistribution and use in source and binary forms, with or without
6    * modification, are permitted provided that the following conditions
7    * are met:
8    *
9    *  1. Redistributions of source code must retain the above copyright notice
10   *     and the following disclaimer.
11   *
12   *  2. Redistributions in binary form must reproduce the above copyright notice
13   *     and the following disclaimer in the documentation and/or other materials
14   *     provided with the distribution.
15   *
16   *  3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its
17   *     contributors may be used to endorse or promote products derived from
18   *     this software without specific prior written permission.
19   *
20   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
24   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30   * POSSIBILITY OF SUCH DAMAGE.
31   *
32   * License 1.0
33   */
34  package fr.paris.lutece.plugins.document.business;
35  
36  import fr.paris.lutece.plugins.document.business.attributes.DocumentAttribute;
37  import fr.paris.lutece.plugins.document.business.category.Category;
38  import fr.paris.lutece.plugins.document.business.publication.DocumentPublication;
39  import fr.paris.lutece.plugins.document.business.publication.DocumentPublicationHome;
40  import fr.paris.lutece.portal.business.resourceenhancer.ResourceEnhancer;
41  import fr.paris.lutece.portal.service.i18n.I18nService;
42  import fr.paris.lutece.portal.service.i18n.Localizable;
43  import fr.paris.lutece.portal.service.resource.IExtendableResource;
44  import fr.paris.lutece.portal.service.util.AppPropertiesService;
45  import fr.paris.lutece.util.date.DateUtil;
46  import fr.paris.lutece.util.url.UrlItem;
47  import fr.paris.lutece.util.xml.XmlUtil;
48  
49  import org.apache.commons.lang3.StringUtils;
50  
51  import java.util.Date;
52  import java.util.GregorianCalendar;
53  import java.util.List;
54  import java.util.Locale;
55  
56  import javax.servlet.http.HttpServletRequest;
57  
58  /**
59   * A document of the CMS.
60   */
61  public class Document implements Localizable, IExtendableResource
62  {
63      public static final String CODE_DOCUMENT_TYPE_DOWNLOAD = "download";
64      public static final String CODE_DOCUMENT_TYPE_IMAGE = "image";
65      public static final String PROPERTY_RESOURCE_TYPE = "document";
66      private static final String SERVLET_DOCUMENT_PATH = "document";
67      private static final String PROPERTY_DEFAULT_THUMBNAIL = "document.thumbnail.default";
68      private static final String PROPERTY_RESOURCE_PROVIDER_URL = "document.resource.provider.url";
69  
70      /////////////////////////////////////////////////////////////////////////////////
71      // Xml Tags
72      private static final String TAG_DOCUMENT = "document";
73      private static final String TAG_DOCUMENT_ID = "document-id";
74      private static final String TAG_DATE_PUBLICATION = "document-date-publication";
75      private static final String TAG_DOCUMENT_XML_CONTENT = "document-xml-content";
76      private static final String MARK_ID = "id";
77      private static final String MARK_ID_ATTRIBUTE = "id_attribute";
78      private static final String EMPTY_STRING = "";
79      private static final String CONSTANT_QUESTION_MARK = "?";
80      private static final String CONSTANT_EQUALS = "=";
81  
82      // Variables declarations
83      private int _nIdDocument;
84      private String _strCodeDocumentType;
85      private String _strType;
86      private String _strTitle;
87      private String _strSummary;
88      private int _nIdCreator;
89      private int _nIdMailingList;
90      private java.sql.Timestamp _dateCreation;
91      private java.sql.Timestamp _dateModification;
92      private java.sql.Timestamp _dateValidityBegin;
93      private java.sql.Timestamp _dateValidityEnd;
94      private String _strComment;
95      private String _strXmlWorkingContent;
96      private String _strXmlValidatedContent;
97      private String _strXmlMetadata;
98      private int _nIdSpace;
99      private int _nIdPageTemplateDocument;
100     private int _nPublishedStatus;
101     private String _strSpace;
102     private int _nIdState;
103     private String _strState;
104     private List<DocumentAttribute> _listAttributes;
105     private Locale _locale;
106     private List _listActions;
107     private List<Category> _listCategories;
108     private boolean _bSkipPortlet; // Skips HTML code generation for documents list portlet
109     private boolean _bSkipCategories; // Skips HTML code generation for category list portlet
110 
111     /**
112      * Returns the IdDocument
113      *
114      * @return The IdDocument
115      */
116     public int getId( )
117     {
118         return _nIdDocument;
119     }
120 
121     /**
122      * Sets the IdDocument
123      *
124      * @param nIdDocument
125      *            The IdDocument
126      */
127     public void setId( int nIdDocument )
128     {
129         _nIdDocument = nIdDocument;
130     }
131 
132     /**
133      * Returns the Locale
134      *
135      * @return The Locale
136      */
137     public Locale getLocale( )
138     {
139         return I18nService.getDefaultLocale( ); // FIXME The document should store its locale
140     }
141 
142     /**
143      * Sets the Locale
144      *
145      * @param locale
146      *            The Locale
147      */
148     @Override
149     public void setLocale( Locale locale )
150     {
151         _locale = locale;
152     }
153 
154     /**
155      * Returns the CodeDocumentType
156      *
157      * @return The CodeDocumentType
158      */
159     public String getCodeDocumentType( )
160     {
161         return _strCodeDocumentType;
162     }
163 
164     /**
165      * Sets the CodeDocumentType
166      *
167      * @param strCodeDocumentType
168      *            The CodeDocumentType
169      */
170     public void setCodeDocumentType( String strCodeDocumentType )
171     {
172         _strCodeDocumentType = strCodeDocumentType;
173     }
174 
175     /**
176      * Returns the Title
177      *
178      * @return The Title
179      */
180     public String getTitle( )
181     {
182         return _strTitle;
183     }
184 
185     /**
186      * Sets the Title
187      *
188      * @param strTitle
189      *            The Title
190      */
191     public void setTitle( String strTitle )
192     {
193         _strTitle = strTitle;
194     }
195 
196     /**
197      * Returns the Summary
198      *
199      * @return The Summary
200      */
201     public String getSummary( )
202     {
203         return ( _strSummary != null ) ? _strSummary : EMPTY_STRING;
204     }
205 
206     /**
207      * Sets the Summary
208      *
209      * @param strSummary
210      *            The Summary
211      */
212     public void setSummary( String strSummary )
213     {
214         _strSummary = strSummary;
215     }
216 
217     /**
218      * Returns the DateCreation
219      *
220      * @return The DateCreation
221      */
222     public java.sql.Timestamp getDateCreation( )
223     {
224         return _dateCreation;
225     }
226 
227     /**
228      * Sets the DateCreation
229      *
230      * @param dateCreation
231      *            The DateCreation
232      */
233     public void setDateCreation( java.sql.Timestamp dateCreation )
234     {
235         _dateCreation = dateCreation;
236     }
237 
238     /**
239      * Returns the IdCreator
240      *
241      * @return The IdCreator
242      */
243     public int getCreatorId( )
244     {
245         return _nIdCreator;
246     }
247 
248     /**
249      * Sets the IdCreator
250      *
251      * @param nIdCreator
252      *            The IdCreator
253      */
254     public void setCreatorId( int nIdCreator )
255     {
256         _nIdCreator = nIdCreator;
257     }
258 
259     /**
260      * Returns the Date of the last Modification
261      *
262      * @return The Date of the last Modification
263      */
264     public java.sql.Timestamp getDateModification( )
265     {
266         return _dateModification;
267     }
268 
269     /**
270      * Sets the Date of the last Modification
271      *
272      * @param dateModification
273      *            The Date of the last Modification
274      */
275     public void setDateModification( java.sql.Timestamp dateModification )
276     {
277         _dateModification = dateModification;
278     }
279 
280     /**
281      * Returns the begining Date of the validity period of the document
282      *
283      * @return The begining Date of the validity period of the document
284      */
285     public java.sql.Timestamp getDateValidityBegin( )
286     {
287         return _dateValidityBegin;
288     }
289 
290     /**
291      * Sets the begining Date of the validity period of the document
292      *
293      * @param dateValidityBegin
294      *            The begining Date of the validity period of the document
295      */
296     public void setDateValidityBegin( java.sql.Timestamp dateValidityBegin )
297     {
298         _dateValidityBegin = dateValidityBegin;
299     }
300 
301     /**
302      * Returns the end Date of the validity period of the document
303      *
304      * @return The end Date of the validity period of the document
305      */
306     public java.sql.Timestamp getDateValidityEnd( )
307     {
308         return _dateValidityEnd;
309     }
310 
311     /**
312      * Sets the end Date of the validity period of the document
313      *
314      * @param dateValidityEnd
315      *            The end Date of the validity period of the document
316      */
317     public void setDateValidityEnd( java.sql.Timestamp dateValidityEnd )
318     {
319         _dateValidityEnd = dateValidityEnd;
320     }
321 
322     /**
323      * Returns the Comment
324      *
325      * @return The Comment
326      */
327     public String getComment( )
328     {
329         return ( _strComment != null ) ? _strComment : EMPTY_STRING;
330     }
331 
332     /**
333      * Sets the Comment
334      *
335      * @param strComment
336      *            The Comment
337      */
338     public void setComment( String strComment )
339     {
340         _strComment = strComment;
341     }
342 
343     /**
344      * Returns the XmlWorkingContent
345      *
346      * @return The XmlWorkingContent
347      */
348     public String getXmlWorkingContent( )
349     {
350         return _strXmlWorkingContent;
351     }
352 
353     /**
354      * Sets the XmlWorkingContent
355      *
356      * @param strXmlWorkingContent
357      *            The XmlWorkingContent
358      */
359     public void setXmlWorkingContent( String strXmlWorkingContent )
360     {
361         _strXmlWorkingContent = strXmlWorkingContent;
362     }
363 
364     /**
365      * Returns the XmlValidatedContent
366      *
367      * @return The XmlValidatedContent
368      */
369     public String getXmlValidatedContent( )
370     {
371         return _strXmlValidatedContent;
372     }
373 
374     /**
375      * Sets the XmlValidatedContent
376      *
377      * @param strXmlValidatedContent
378      *            The XmlValidatedContent
379      */
380     public void setXmlValidatedContent( String strXmlValidatedContent )
381     {
382         _strXmlValidatedContent = strXmlValidatedContent;
383     }
384 
385     /**
386      * Returns the XmlMetadata
387      *
388      * @return The XmlMetadata
389      */
390     public String getXmlMetadata( )
391     {
392         return _strXmlMetadata;
393     }
394 
395     /**
396      * Sets the XmlMetadata
397      *
398      * @param strXmlMetadata
399      *            The XmlMetadata
400      */
401     public void setXmlMetadata( String strXmlMetadata )
402     {
403         _strXmlMetadata = strXmlMetadata;
404     }
405 
406     /**
407      * Returns the IdSpace
408      *
409      * @return The IdSpace
410      */
411     public int getSpaceId( )
412     {
413         return _nIdSpace;
414     }
415 
416     /**
417      * Sets the IdSpace
418      *
419      * @param nIdSpace
420      *            The IdSpace
421      */
422     public void setSpaceId( int nIdSpace )
423     {
424         _nIdSpace = nIdSpace;
425     }
426 
427     /**
428      * Returns the Space
429      *
430      * @return The Space
431      */
432     public String getSpace( )
433     {
434         return _strSpace;
435     }
436 
437     /**
438      * Sets the Space
439      *
440      * @param strSpace
441      *            The Space
442      */
443     public void setSpace( String strSpace )
444     {
445         _strSpace = strSpace;
446     }
447 
448     /**
449      * Returns the IdState
450      *
451      * @return The IdState
452      */
453     public int getStateId( )
454     {
455         return _nIdState;
456     }
457 
458     /**
459      * Sets the IdState
460      *
461      * @param nIdState
462      *            The IdState
463      */
464     public void setStateId( int nIdState )
465     {
466         _nIdState = nIdState;
467     }
468 
469     /**
470      * Returns the State
471      *
472      * @return The State
473      */
474     public String getStateKey( )
475     {
476         return _strState;
477     }
478 
479     /**
480      * Returns the State
481      *
482      * @return The State
483      */
484     public String getState( )
485     {
486         return I18nService.getLocalizedString( _strState, _locale );
487     }
488 
489     /**
490      * Sets the State
491      *
492      * @param strState
493      *            The State
494      */
495     public void setStateKey( String strState )
496     {
497         _strState = strState;
498     }
499 
500     /**
501      * Returns the IdMailingList
502      *
503      * @return The IdMailingList
504      */
505     public int getMailingListId( )
506     {
507         return _nIdMailingList;
508     }
509 
510     /**
511      * Sets the IdMailingList
512      *
513      * @param nIdMailingList
514      *            The IdMailingList
515      */
516     public void setMailingListId( int nIdMailingList )
517     {
518         _nIdMailingList = nIdMailingList;
519     }
520 
521     /**
522      * Returns the IdPageTemplateDocument
523      *
524      * @return The IdPageTemplateDocument
525      */
526     public int getPageTemplateDocumentId( )
527     {
528         return _nIdPageTemplateDocument;
529     }
530 
531     /**
532      * Sets the IdPageTemplateDocument
533      *
534      * @param nIdPageTemplateDocument
535      *            The IdPageTemplateDocument
536      */
537     public void setPageTemplateDocumentId( int nIdPageTemplateDocument )
538     {
539         _nIdPageTemplateDocument = nIdPageTemplateDocument;
540     }
541 
542     /**
543      * Returns attributes List
544      * 
545      * @return The document attributes list
546      */
547     public List<DocumentAttribute> getAttributes( )
548     {
549         return _listAttributes;
550     }
551 
552     /**
553      * Set the document attributes list
554      * 
555      * @param listAttributes
556      *            The document attributes list
557      */
558     public void setAttributes( List<DocumentAttribute> listAttributes )
559     {
560         _listAttributes = listAttributes;
561     }
562 
563     /**
564      * Returns Actions List
565      * 
566      * @return The document Actions list
567      */
568     public List getActions( )
569     {
570         return _listActions;
571     }
572 
573     /**
574      * Set the document Actions list
575      * 
576      * @param listActions
577      *            The document Actions list
578      */
579     public void setActions( List listActions )
580     {
581         _listActions = listActions;
582     }
583 
584     /**
585      * Returns the Type
586      *
587      * @return The Type
588      */
589     public String getType( )
590     {
591         return _strType;
592     }
593 
594     /**
595      * Sets the Type
596      *
597      * @param strType
598      *            The Type
599      */
600     public void setType( String strType )
601     {
602         _strType = strType;
603     }
604 
605     /**
606      * @return the _listCategory
607      */
608     public List<Category> getCategories( )
609     {
610         return _listCategories;
611     }
612 
613     /**
614      * @param listCategory
615      *            the _listCategory to set
616      */
617     public void setCategories( List<Category> listCategory )
618     {
619         _listCategories = listCategory;
620     }
621 
622     /**
623      * @param nPublishedStatus
624      *            the nPublishedStatus to set
625      */
626     public void setPublishedStatus( int nPublishedStatus )
627     {
628         _nPublishedStatus = nPublishedStatus;
629     }
630 
631     /**
632      * Returns the PublishedSTatus
633      *
634      * @return The PublishedSTatus
635      */
636     public int getPublishedStatus( )
637     {
638         return _nPublishedStatus;
639     }
640 
641     /**
642      * Returns the SkipPortlet
643      *
644      * @return The SkipPortlet
645      */
646     public boolean isSkipPortlet( )
647     {
648         return _bSkipPortlet;
649     }
650 
651     /**
652      * Sets the SkipPortlet
653      *
654      * @param bSkipPortlet
655      *            The SkipPortlet
656      */
657     public void setSkipPortlet( boolean bSkipPortlet )
658     {
659         _bSkipPortlet = bSkipPortlet;
660     }
661 
662     /**
663      * Returns the SkipCategories
664      *
665      * @return The SkipCategories
666      */
667     public boolean isSkipCategories( )
668     {
669         return _bSkipCategories;
670     }
671 
672     /**
673      * Sets the SkipCategories
674      *
675      * @param bSkipCategories
676      *            The SkipCategories
677      */
678     public void setSkipCategories( boolean bSkipCategories )
679     {
680         _bSkipCategories = bSkipCategories;
681     }
682 
683     /**
684      * Returns a Thumbnail url for the document based on a document attribute or on the document type.
685      * 
686      * @return A Thumbnail url
687      */
688     public String getThumbnail( )
689     {
690         String strThumbnailUrl = AppPropertiesService.getProperty( PROPERTY_DEFAULT_THUMBNAIL );
691         String strResourceUrl = AppPropertiesService.getProperty( PROPERTY_RESOURCE_PROVIDER_URL );
692 
693         DocumentType documentType = DocumentTypeHome.findByPrimaryKey( getCodeDocumentType( ) );
694 
695         if ( documentType.getThumbnailAttributeId( ) != 0 )
696         {
697             strThumbnailUrl = strResourceUrl + getId( );
698         }
699         else
700             if ( !documentType.getDefaultThumbnailUrl( ).equals( "" ) )
701             {
702                 strThumbnailUrl = documentType.getDefaultThumbnailUrl( );
703             }
704 
705         return strThumbnailUrl;
706     }
707 
708     ////////////////////////////////////////////////////////////////////////////
709     // XML Generation
710 
711     /**
712      * Returns the xml of this document
713      * 
714      * @param request
715      *            The HTTP Servlet request
716      * @param nIdPortlet
717      *            the id of the portlet where the document is published
718      * @return the link xml
719      */
720     public String getXml( HttpServletRequest request, int nIdPortlet )
721     {
722         StringBuffer strXml = new StringBuffer( );
723 
724         XmlUtil.beginElement( strXml, TAG_DOCUMENT );
725 
726         XmlUtil.addElement( strXml, TAG_DOCUMENT_ID, Integer.toString( getId( ) ) );
727 
728         if ( nIdPortlet != -1 )
729         {
730             DocumentPublication publication = DocumentPublicationHome.findByPrimaryKey( nIdPortlet, getId( ) );
731             String strDate = DateUtil.getDateString( publication.getDatePublishing( ), getLocale( ) );
732             XmlUtil.addElement( strXml, TAG_DATE_PUBLICATION, strDate );
733         }
734 
735         XmlUtil.addElement( strXml, TAG_DOCUMENT_XML_CONTENT, getXmlValidatedContent( ) );
736 
737         // additionnal info
738         ResourceEnhancer.getXmlAddOn( strXml, PROPERTY_RESOURCE_TYPE, getId( ) );
739 
740         XmlUtil.endElement( strXml, TAG_DOCUMENT );
741 
742         return strXml.toString( );
743     }
744 
745     /**
746      * Returns the xml document of this link
747      *
748      * @param nIdPortlet
749      *            the id of the portlet where the document is published
750      * @param request
751      *            The HTTP servlet request
752      * @return the link xml document
753      */
754     public String getXmlDocument( HttpServletRequest request, int nIdPortlet )
755     {
756         return XmlUtil.getXmlHeader( ) + getXml( request, nIdPortlet );
757     }
758 
759     /**
760      * Returns a document attribute by its code
761      * 
762      * @param strAttributeCode
763      *            The Attribute Code
764      * @return the attribute object corresponding to the code
765      */
766     public DocumentAttribute getAttribute( String strAttributeCode )
767     {
768         if ( _listAttributes != null )
769         {
770             for ( DocumentAttribute attribute : _listAttributes )
771             {
772                 if ( attribute.getCode( ).equals( strAttributeCode ) )
773                 {
774                     return attribute;
775                 }
776             }
777         }
778 
779         return null;
780     }
781 
782     /**
783      * Control that an document is valid, i.e. that its period of validity defined by its dateValidityBegin and its dateValidityEnd is valid : an document is
784      * valid if the current date > = dateValidityBegin and if current date < = dateValidityEnd If the two dates are null, the test of validity will return true
785      * if one of the dates is null, the result of the test will be that carried out on the non null date
786      * 
787      * @return true if the document is valid, false otherwise
788      */
789     public boolean isValid( )
790     {
791         java.sql.Timestamp dateValidityBegin = getDateValidityBegin( );
792         java.sql.Timestamp dateValidityEnd = getDateValidityEnd( );
793 
794         GregorianCalendar gc = new GregorianCalendar( );
795 
796         java.sql.Date dateToday = new java.sql.Date( gc.getTime( ).getTime( ) );
797 
798         if ( ( dateValidityBegin == null ) && ( dateValidityEnd == null ) )
799         {
800             return true;
801         }
802         else
803             if ( dateValidityBegin == null )
804             {
805                 // Return true if dateValidityEnd >= DateToday, false otherwise :
806                 return ( dateValidityEnd.compareTo( dateToday ) >= 0 );
807             }
808             else
809                 if ( dateValidityEnd == null )
810                 {
811                     // Return true if dateValidityBegin <= DateToday, false otherwise :
812                     return ( dateValidityBegin.compareTo( dateToday ) <= 0 );
813                 }
814                 else
815                 {
816                     // Return true if dateValidityBegin <= dateToday <= dateValidityEnd, false
817                     // otherwise :
818                     return ( ( dateValidityBegin.compareTo( dateToday ) <= 0 ) && ( dateValidityEnd.compareTo( dateToday ) >= 0 ) );
819                 }
820     }
821 
822     /**
823      * Control that an document is out of date, i.e. dateValidityEnd has expired :
824      * 
825      * @return true if the document is out of date, false otherwise
826      */
827     public boolean isOutOfDate( )
828     {
829         if ( getDateValidityEnd( ) == null )
830         {
831             return false;
832         }
833 
834         // Return false if dateValidityEnd >= DateToday, true otherwise :
835         return !( getDateValidityEnd( ).compareTo( new Date( ) ) >= 0 );
836     }
837 
838     /**
839      * {@inheritDoc}
840      */
841     @Override
842     public String getIdExtendableResource( )
843     {
844         return Integer.toString( _nIdDocument );
845     }
846 
847     /**
848      * {@inheritDoc}
849      */
850     @Override
851     public String getExtendableResourceType( )
852     {
853         return PROPERTY_RESOURCE_TYPE;
854     }
855 
856     /**
857      * {@inheritDoc}
858      */
859     @Override
860     public String getExtendableResourceName( )
861     {
862         return _strTitle;
863     }
864 
865     /**
866      * {@inheritDoc}
867      */
868     @Override
869     public String getExtendableResourceDescription( )
870     {
871         return _strSummary;
872     }
873 
874     /**
875      * {@inheritDoc}
876      */
877     @Override
878     public String getExtendableResourceImageUrl( )
879     {
880         if ( StringUtils.equalsIgnoreCase( _strCodeDocumentType, CODE_DOCUMENT_TYPE_IMAGE ) )
881         {
882             UrlItem urlItem = new UrlItem( SERVLET_DOCUMENT_PATH );
883             urlItem.addParameter( MARK_ID, _nIdDocument );
884 
885             return urlItem.getUrl( );
886         }
887 
888         if ( _listAttributes != null )
889         {
890             for ( DocumentAttribute attribute : _listAttributes )
891             {
892                 if ( StringUtils.equals( attribute.getCodeAttributeType( ), "image" ) )
893                 {
894                     UrlItem urlItem = new UrlItem( SERVLET_DOCUMENT_PATH );
895                     urlItem.addParameter( MARK_ID, _nIdDocument );
896                     urlItem.addParameter( MARK_ID_ATTRIBUTE, attribute.getId( ) );
897 
898                     return urlItem.getUrl( );
899                 }
900             }
901         }
902 
903         return null;
904     }
905 }