1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package com.xpn.xwiki

File XWiki.java

 

Coverage histogram

../../../img/srcFileCovDistChart6.png
69% of files have more coverage

Code metrics

852
2,274
389
1
7,103
4,748
955
0.42
5.85
389
2.46

Classes

Class Line # Actions
XWiki 237 2,274 0% 955 1,652
0.530014253%
 

Contributing tests

This file is covered by 131 tests. .

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package com.xpn.xwiki;
21   
22    import java.io.ByteArrayInputStream;
23    import java.io.File;
24    import java.io.FileInputStream;
25    import java.io.FileNotFoundException;
26    import java.io.IOException;
27    import java.io.InputStream;
28    import java.io.PrintWriter;
29    import java.io.StringWriter;
30    import java.lang.reflect.Field;
31    import java.lang.reflect.InvocationTargetException;
32    import java.lang.reflect.Method;
33    import java.lang.reflect.Type;
34    import java.net.MalformedURLException;
35    import java.net.URL;
36    import java.text.DateFormatSymbols;
37    import java.text.SimpleDateFormat;
38    import java.util.ArrayList;
39    import java.util.Arrays;
40    import java.util.Collections;
41    import java.util.Comparator;
42    import java.util.Date;
43    import java.util.Enumeration;
44    import java.util.HashMap;
45    import java.util.HashSet;
46    import java.util.List;
47    import java.util.ListIterator;
48    import java.util.Locale;
49    import java.util.Map;
50    import java.util.Set;
51    import java.util.TimeZone;
52    import java.util.Vector;
53    import java.util.concurrent.ConcurrentHashMap;
54    import java.util.regex.Pattern;
55    import java.util.zip.ZipOutputStream;
56   
57    import javax.annotation.Priority;
58    import javax.inject.Provider;
59    import javax.mail.Message;
60    import javax.mail.Session;
61    import javax.mail.internet.InternetAddress;
62    import javax.mail.internet.MimeMessage;
63    import javax.naming.NamingException;
64    import javax.script.ScriptContext;
65    import javax.servlet.http.Cookie;
66    import javax.servlet.http.HttpServletRequest;
67    import javax.servlet.http.HttpServletResponse;
68   
69    import org.apache.commons.httpclient.Credentials;
70    import org.apache.commons.httpclient.HttpClient;
71    import org.apache.commons.httpclient.URIException;
72    import org.apache.commons.httpclient.UsernamePasswordCredentials;
73    import org.apache.commons.httpclient.auth.AuthScope;
74    import org.apache.commons.httpclient.methods.GetMethod;
75    import org.apache.commons.httpclient.util.URIUtil;
76    import org.apache.commons.io.FileUtils;
77    import org.apache.commons.io.IOUtils;
78    import org.apache.commons.lang3.ArrayUtils;
79    import org.apache.commons.lang3.LocaleUtils;
80    import org.apache.commons.lang3.RandomStringUtils;
81    import org.apache.commons.lang3.StringUtils;
82    import org.apache.commons.lang3.exception.ExceptionUtils;
83    import org.apache.commons.lang3.math.NumberUtils;
84    import org.apache.commons.lang3.reflect.FieldUtils;
85    import org.apache.velocity.VelocityContext;
86    import org.hibernate.HibernateException;
87    import org.slf4j.Logger;
88    import org.slf4j.LoggerFactory;
89    import org.xwiki.bridge.event.DocumentCreatedEvent;
90    import org.xwiki.bridge.event.DocumentCreatingEvent;
91    import org.xwiki.bridge.event.DocumentDeletedEvent;
92    import org.xwiki.bridge.event.DocumentDeletingEvent;
93    import org.xwiki.bridge.event.DocumentRolledBackEvent;
94    import org.xwiki.bridge.event.DocumentRollingBackEvent;
95    import org.xwiki.bridge.event.DocumentUpdatedEvent;
96    import org.xwiki.bridge.event.DocumentUpdatingEvent;
97    import org.xwiki.bridge.event.WikiCopiedEvent;
98    import org.xwiki.bridge.event.WikiDeletedEvent;
99    import org.xwiki.cache.Cache;
100    import org.xwiki.classloader.ClassLoaderManager;
101    import org.xwiki.component.event.ComponentDescriptorAddedEvent;
102    import org.xwiki.component.manager.ComponentLookupException;
103    import org.xwiki.component.manager.ComponentManager;
104    import org.xwiki.component.manager.NamespacedComponentManager;
105    import org.xwiki.component.util.DefaultParameterizedType;
106    import org.xwiki.configuration.ConfigurationSource;
107    import org.xwiki.context.Execution;
108    import org.xwiki.edit.EditConfiguration;
109    import org.xwiki.job.Job;
110    import org.xwiki.job.JobException;
111    import org.xwiki.job.JobExecutor;
112    import org.xwiki.job.annotation.Serializable;
113    import org.xwiki.job.event.status.JobProgressManager;
114    import org.xwiki.job.event.status.JobStatus.State;
115    import org.xwiki.localization.ContextualLocalizationManager;
116    import org.xwiki.mail.MailListener;
117    import org.xwiki.mail.MailSender;
118    import org.xwiki.mail.MailSenderConfiguration;
119    import org.xwiki.mail.MailStatusResultSerializer;
120    import org.xwiki.mail.XWikiAuthenticator;
121    import org.xwiki.model.EntityType;
122    import org.xwiki.model.reference.AttachmentReference;
123    import org.xwiki.model.reference.AttachmentReferenceResolver;
124    import org.xwiki.model.reference.DocumentReference;
125    import org.xwiki.model.reference.DocumentReferenceResolver;
126    import org.xwiki.model.reference.EntityReference;
127    import org.xwiki.model.reference.EntityReferenceResolver;
128    import org.xwiki.model.reference.EntityReferenceSerializer;
129    import org.xwiki.model.reference.LocalDocumentReference;
130    import org.xwiki.model.reference.ObjectReference;
131    import org.xwiki.model.reference.RegexEntityReference;
132    import org.xwiki.model.reference.SpaceReference;
133    import org.xwiki.model.reference.WikiReference;
134    import org.xwiki.observation.EventListener;
135    import org.xwiki.observation.ObservationManager;
136    import org.xwiki.observation.event.CancelableEvent;
137    import org.xwiki.observation.event.Event;
138    import org.xwiki.query.QueryException;
139    import org.xwiki.query.QueryFilter;
140    import org.xwiki.rendering.block.Block;
141    import org.xwiki.rendering.block.Block.Axes;
142    import org.xwiki.rendering.block.MetaDataBlock;
143    import org.xwiki.rendering.block.match.MetadataBlockMatcher;
144    import org.xwiki.rendering.internal.transformation.MutableRenderingContext;
145    import org.xwiki.rendering.listener.MetaData;
146    import org.xwiki.rendering.parser.ParseException;
147    import org.xwiki.rendering.syntax.Syntax;
148    import org.xwiki.rendering.syntax.SyntaxContent;
149    import org.xwiki.rendering.syntax.SyntaxFactory;
150    import org.xwiki.rendering.transformation.RenderingContext;
151    import org.xwiki.resource.ResourceReference;
152    import org.xwiki.resource.ResourceReferenceManager;
153    import org.xwiki.resource.ResourceReferenceResolver;
154    import org.xwiki.resource.ResourceType;
155    import org.xwiki.resource.ResourceTypeResolver;
156    import org.xwiki.resource.entity.EntityResourceReference;
157    import org.xwiki.script.ScriptContextManager;
158    import org.xwiki.skin.Resource;
159    import org.xwiki.skin.Skin;
160    import org.xwiki.skin.SkinManager;
161    import org.xwiki.template.TemplateManager;
162    import org.xwiki.url.ExtendedURL;
163    import org.xwiki.velocity.VelocityManager;
164    import org.xwiki.wiki.descriptor.WikiDescriptor;
165    import org.xwiki.wiki.descriptor.WikiDescriptorManager;
166    import org.xwiki.wiki.manager.WikiManager;
167    import org.xwiki.wiki.manager.WikiManagerException;
168    import org.xwiki.xml.XMLUtils;
169   
170    import com.xpn.xwiki.api.Api;
171    import com.xpn.xwiki.api.Document;
172    import com.xpn.xwiki.api.User;
173    import com.xpn.xwiki.criteria.api.XWikiCriteriaService;
174    import com.xpn.xwiki.doc.DeletedAttachment;
175    import com.xpn.xwiki.doc.MandatoryDocumentInitializer;
176    import com.xpn.xwiki.doc.XWikiAttachment;
177    import com.xpn.xwiki.doc.XWikiDeletedDocument;
178    import com.xpn.xwiki.doc.XWikiDocument;
179    import com.xpn.xwiki.doc.XWikiDocument.XWikiAttachmentToRemove;
180    import com.xpn.xwiki.doc.XWikiDocumentArchive;
181    import com.xpn.xwiki.internal.WikiInitializerJob;
182    import com.xpn.xwiki.internal.WikiInitializerRequest;
183    import com.xpn.xwiki.internal.XWikiCfgConfigurationSource;
184    import com.xpn.xwiki.internal.XWikiConfigDelegate;
185    import com.xpn.xwiki.internal.XWikiInitializerJob;
186    import com.xpn.xwiki.internal.event.XObjectPropertyAddedEvent;
187    import com.xpn.xwiki.internal.event.XObjectPropertyDeletedEvent;
188    import com.xpn.xwiki.internal.event.XObjectPropertyEvent;
189    import com.xpn.xwiki.internal.event.XObjectPropertyUpdatedEvent;
190    import com.xpn.xwiki.internal.render.OldRendering;
191    import com.xpn.xwiki.internal.render.groovy.ParseGroovyFromString;
192    import com.xpn.xwiki.internal.skin.InternalSkinConfiguration;
193    import com.xpn.xwiki.internal.skin.InternalSkinManager;
194    import com.xpn.xwiki.internal.skin.WikiSkin;
195    import com.xpn.xwiki.internal.skin.WikiSkinUtils;
196    import com.xpn.xwiki.job.JobRequestContext;
197    import com.xpn.xwiki.objects.BaseObject;
198    import com.xpn.xwiki.objects.PropertyInterface;
199    import com.xpn.xwiki.objects.classes.BaseClass;
200    import com.xpn.xwiki.objects.classes.PasswordClass;
201    import com.xpn.xwiki.objects.classes.PropertyClass;
202    import com.xpn.xwiki.objects.meta.MetaClass;
203    import com.xpn.xwiki.plugin.XWikiPluginInterface;
204    import com.xpn.xwiki.plugin.XWikiPluginManager;
205    import com.xpn.xwiki.render.groovy.XWikiPageClassLoader;
206    import com.xpn.xwiki.stats.api.XWikiStatsService;
207    import com.xpn.xwiki.stats.impl.SearchEngineRule;
208    import com.xpn.xwiki.stats.impl.XWikiStatsServiceImpl;
209    import com.xpn.xwiki.store.AttachmentRecycleBinStore;
210    import com.xpn.xwiki.store.AttachmentVersioningStore;
211    import com.xpn.xwiki.store.XWikiAttachmentStoreInterface;
212    import com.xpn.xwiki.store.XWikiCacheStore;
213    import com.xpn.xwiki.store.XWikiCacheStoreInterface;
214    import com.xpn.xwiki.store.XWikiHibernateStore;
215    import com.xpn.xwiki.store.XWikiRecycleBinStoreInterface;
216    import com.xpn.xwiki.store.XWikiStoreInterface;
217    import com.xpn.xwiki.store.XWikiVersioningStoreInterface;
218    import com.xpn.xwiki.user.api.XWikiAuthService;
219    import com.xpn.xwiki.user.api.XWikiGroupService;
220    import com.xpn.xwiki.user.api.XWikiRightService;
221    import com.xpn.xwiki.user.api.XWikiUser;
222    import com.xpn.xwiki.user.impl.xwiki.XWikiAuthServiceImpl;
223    import com.xpn.xwiki.user.impl.xwiki.XWikiGroupServiceImpl;
224    import com.xpn.xwiki.user.impl.xwiki.XWikiRightServiceImpl;
225    import com.xpn.xwiki.util.Util;
226    import com.xpn.xwiki.util.XWikiStubContextProvider;
227    import com.xpn.xwiki.web.Utils;
228    import com.xpn.xwiki.web.XWikiEngineContext;
229    import com.xpn.xwiki.web.XWikiMessageTool;
230    import com.xpn.xwiki.web.XWikiRequest;
231    import com.xpn.xwiki.web.XWikiURLFactory;
232    import com.xpn.xwiki.web.XWikiURLFactoryService;
233    import com.xpn.xwiki.web.XWikiURLFactoryServiceImpl;
234    import com.xpn.xwiki.web.includeservletasstring.IncludeServletAsString;
235   
236    @Serializable(false)
 
237    public class XWiki implements EventListener
238    {
239    /** Name of the default wiki. */
240    public static final String DEFAULT_MAIN_WIKI = "xwiki";
241   
242    /** Name of the default home space. */
243    public static final String DEFAULT_HOME_SPACE = "Main";
244   
245    /** Name of the default system space. */
246    public static final String SYSTEM_SPACE = "XWiki";
247   
248    /** Name of the default space homepage. */
249    public static final String DEFAULT_SPACE_HOMEPAGE = "WebHome";
250   
251    public static final String CKEY_SKIN = InternalSkinManager.CKEY_SKIN;
252   
253    public static final String CKEY_BASESKIN = InternalSkinManager.CKEY_PARENTSKIN;
254   
255    public static final String DEFAULT_SKIN = InternalSkinConfiguration.DEFAULT_SKIN;
256   
257    /** Logging helper object. */
258    protected static final Logger LOGGER = LoggerFactory.getLogger(XWiki.class);
259   
260    /** Frequently used Document reference, the class which holds virtual wiki definitions. */
261    private static final DocumentReference VIRTUAL_WIKI_DEFINITION_CLASS_REFERENCE =
262    new DocumentReference(DEFAULT_MAIN_WIKI, SYSTEM_SPACE, "XWikiServerClass");
263   
264    /** The default encoding, and the internally used encoding when dealing with byte representation of strings. */
265    public static final String DEFAULT_ENCODING = "UTF-8";
266   
267    /** Represents no value (ie the default value will be used) in xproperties */
268    private static final String NO_VALUE = "---";
269   
270    /** The main document storage. */
271    private XWikiStoreInterface store;
272   
273    /** The attachment storage (excluding attachment history). */
274    private XWikiAttachmentStoreInterface attachmentStore;
275   
276    /** Store for attachment archives. */
277    private AttachmentVersioningStore attachmentVersioningStore;
278   
279    /** Document versioning storage. */
280    private XWikiVersioningStoreInterface versioningStore;
281   
282    /** Deleted documents storage. */
283    private XWikiRecycleBinStoreInterface recycleBinStore;
284   
285    /**
286    * Storage for deleted attachment.
287    *
288    * @since 1.4M1
289    */
290    private AttachmentRecycleBinStore attachmentRecycleBinStore;
291   
292    private XWikiPluginManager pluginManager;
293   
294    private XWikiAuthService authService;
295   
296    private XWikiRightService rightService;
297   
298    private XWikiGroupService groupService;
299   
300    private XWikiStatsService statsService;
301   
302    private XWikiURLFactoryService urlFactoryService;
303   
304    private XWikiCriteriaService criteriaService;
305   
306    /** Lock object used for the lazy initialization of the authentication service. */
307    private final Object AUTH_SERVICE_LOCK = new Object();
308   
309    /** Lock object used for the lazy initialization of the authorization service. */
310    private final Object RIGHT_SERVICE_LOCK = new Object();
311   
312    /** Lock object used for the lazy initialization of the group management service. */
313    private final Object GROUP_SERVICE_LOCK = new Object();
314   
315    /** Lock object used for the lazy initialization of the statistics service. */
316    private final Object STATS_SERVICE_LOCK = new Object();
317   
318    /** Lock object used for the lazy initialization of the URL Factory service. */
319    private final Object URLFACTORY_SERVICE_LOCK = new Object();
320   
321    private MetaClass metaclass;
322   
323    private String version;
324   
325    private XWikiEngineContext engine_context;
326   
327    private String database;
328   
329    private String fullNameSQL;
330   
331    /**
332    * The list of initialized wikis.
333    */
334    private Map<String, WikiInitializerJob> initializedWikis = new ConcurrentHashMap<>();
335   
336    private boolean isReadOnly = false;
337   
338    /**
339    * @deprecated since 6.1M2, use {@link XWikiCfgConfigurationSource#CFG_ENV_NAME} instead
340    */
341    @Deprecated
342    public static final String CFG_ENV_NAME = XWikiCfgConfigurationSource.CFG_ENV_NAME;
343   
344    public static final String MACROS_FILE = "/templates/macros.txt";
345   
346    /**
347    * File containing XWiki's version, in the format: <version name>.<SVN revision number>.
348    */
349    private static final String VERSION_FILE = "/WEB-INF/version.properties";
350   
351    /**
352    * Property containing the version value in the {@link #VERSION_FILE} file.
353    */
354    private static final String VERSION_FILE_PROPERTY = "version";
355   
356    private static XWikiInitializerJob job;
357   
358    /** List of configured syntax ids. */
359    private List<String> configuredSyntaxes;
360   
361    /** Used to convert a proper Document Reference to string (standard form). */
362    private EntityReferenceSerializer<String> defaultEntityReferenceSerializer;
363   
364    /**
365    * Used to resolve a string into a proper Document Reference using the current document's reference to fill the
366    * blanks, except for the page name for which the default page name is used instead.
367    */
368    private DocumentReferenceResolver<String> currentMixedDocumentReferenceResolver;
369   
370    private DocumentReferenceResolver<EntityReference> currentReferenceDocumentReferenceResolver;
371   
372    private EntityReferenceResolver<String> currentMixedEntityReferenceResolver;
373   
374    private EntityReferenceResolver<String> relativeEntityReferenceResolver;
375   
376    private EntityReferenceSerializer<String> localStringEntityReferenceSerializer;
377   
378    private SyntaxFactory syntaxFactory;
379   
380    private ResourceReferenceManager resourceReferenceManager;
381   
382    private JobExecutor jobExecutor;
383   
384    private InternalSkinManager internalSkinManager;
385   
386    private TemplateManager templateManager;
387   
388    private RenderingContext renderingContext;
389   
390    /**
391    * Whether backlinks are enabled or not (cached for performance).
392    *
393    * @since 3.2M2
394    */
395    private Boolean hasBacklinks;
396   
397    private ConfigurationSource xwikicfg;
398   
399    private ConfigurationSource wikiConfiguration;
400   
401    private ConfigurationSource userConfiguration;
402   
403    private ConfigurationSource spaceConfiguration;
404   
405    private EditConfiguration editConfiguration;
406   
407    private ObservationManager observationManager;
408   
409    private Provider<XWikiContext> xcontextProvider;
410   
411    private ContextualLocalizationManager localization;
412   
413    private Provider<OldRendering> oldRenderingProvider;
414   
415    private ParseGroovyFromString parseGroovyFromString;
416   
417    private JobProgressManager progress;
418   
419    private Provider<DocumentReference> defaultDocumentReferenceProvider;
420   
421    private DocumentReferenceResolver<EntityReference> currentgetdocumentResolver;
422   
423    private AttachmentReferenceResolver<EntityReference> currentAttachmentReferenceResolver;
424   
425    private WikiSkinUtils wikiSkinUtils;
426   
427    /**
428    * List of top level space names that can be used in the fake context document created when accessing a resource
429    * with the 'skin' action.
430    */
431    private List<String> SKIN_RESOURCE_SPACE_NAMES = Arrays.asList("skins", "resources");
432   
 
433  1285888 toggle private ConfigurationSource getConfiguration()
434    {
435  1285893 if (this.xwikicfg == null) {
436  156 this.xwikicfg = Utils.getComponent(ConfigurationSource.class, XWikiCfgConfigurationSource.ROLEHINT);
437    }
438   
439  1285885 return this.xwikicfg;
440    }
441   
 
442  467106 toggle private ConfigurationSource getWikiConfiguration()
443    {
444  467102 if (this.wikiConfiguration == null) {
445  95 this.wikiConfiguration = Utils.getComponent(ConfigurationSource.class, "wiki");
446    }
447   
448  467088 return this.wikiConfiguration;
449    }
450   
 
451  76029 toggle private ConfigurationSource getSpaceConfiguration()
452    {
453  76029 if (this.spaceConfiguration == null) {
454  34 this.spaceConfiguration = Utils.getComponent(ConfigurationSource.class, "space");
455    }
456   
457  76024 return this.spaceConfiguration;
458    }
459   
 
460  7930 toggle private ConfigurationSource getUserConfiguration()
461    {
462  7928 if (this.userConfiguration == null) {
463  29 this.userConfiguration = Utils.getComponent(ConfigurationSource.class, "user");
464    }
465   
466  7928 return this.userConfiguration;
467    }
468   
 
469  92 toggle private EditConfiguration getEditConfiguration()
470    {
471  92 if (this.editConfiguration == null) {
472  12 this.editConfiguration = Utils.getComponent(EditConfiguration.class);
473    }
474   
475  92 return this.editConfiguration;
476    }
477   
 
478  50810 toggle private InternalSkinManager getInternalSkinManager()
479    {
480  50811 if (this.internalSkinManager == null) {
481  36 this.internalSkinManager = Utils.getComponent(InternalSkinManager.class);
482    }
483   
484  50807 return this.internalSkinManager;
485    }
486   
 
487  78482 toggle private TemplateManager getTemplateManager()
488    {
489  78479 if (this.templateManager == null) {
490  35 this.templateManager = Utils.getComponent(TemplateManager.class);
491    }
492   
493  78471 return this.templateManager;
494    }
495   
 
496  12149 toggle private RenderingContext getRenderingContext()
497    {
498  12193 if (this.renderingContext == null) {
499  33 this.renderingContext = Utils.getComponent(RenderingContext.class);
500    }
501   
502  12182 return this.renderingContext;
503    }
504   
 
505  0 toggle private MutableRenderingContext getMutableRenderingContext()
506    {
507  0 return getRenderingContext() instanceof MutableRenderingContext
508    ? (MutableRenderingContext) getRenderingContext() : null;
509    }
510   
 
511  4145 toggle private ObservationManager getObservationManager()
512    {
513  4145 if (this.observationManager == null) {
514  103 this.observationManager = Utils.getComponent(ObservationManager.class);
515    }
516   
517  4145 return this.observationManager;
518    }
519   
 
520  0 toggle private XWikiContext getXWikiContext()
521    {
522  0 if (this.xcontextProvider == null) {
523  0 this.xcontextProvider = Utils.getComponent(XWikiContext.TYPE_PROVIDER);
524    }
525   
526  0 return this.xcontextProvider.get();
527    }
528   
 
529  1069 toggle private ContextualLocalizationManager getLocalization()
530    {
531  1069 if (this.localization == null) {
532  66 this.localization = Utils.getComponent(ContextualLocalizationManager.class);
533    }
534   
535  1069 return this.localization;
536    }
537   
 
538  54 toggle private OldRendering getOldRendering()
539    {
540  54 if (this.oldRenderingProvider == null) {
541  8 this.oldRenderingProvider = Utils.getComponent(OldRendering.TYPE_PROVIDER);
542    }
543   
544  54 return this.oldRenderingProvider.get();
545    }
546   
 
547  0 toggle private ParseGroovyFromString getParseGroovyFromString()
548    {
549  0 if (this.parseGroovyFromString == null) {
550  0 this.parseGroovyFromString = Utils.getComponent(ParseGroovyFromString.class);
551    }
552   
553  0 return this.parseGroovyFromString;
554    }
555   
 
556  522 toggle private JobProgressManager getProgress()
557    {
558  522 if (this.progress == null) {
559  87 this.progress = Utils.getComponent(JobProgressManager.class);
560    }
561   
562  522 return this.progress;
563    }
564   
 
565  0 toggle private Provider<DocumentReference> getDefaultDocumentReferenceProvider()
566    {
567  0 if (this.defaultDocumentReferenceProvider == null) {
568  0 this.defaultDocumentReferenceProvider = Utils.getComponent(DocumentReference.TYPE_PROVIDER);
569    }
570   
571  0 return this.defaultDocumentReferenceProvider;
572    }
573   
 
574  3052 toggle private DocumentReferenceResolver<EntityReference> getCurrentGetDocumentResolver()
575    {
576  3052 if (this.currentgetdocumentResolver == null) {
577  65 this.currentgetdocumentResolver =
578    Utils.getComponent(DocumentReferenceResolver.TYPE_REFERENCE, "currentgetdocument");
579    }
580   
581  3052 return this.currentgetdocumentResolver;
582    }
583   
 
584  1 toggle private AttachmentReferenceResolver<EntityReference> getCurrentAttachmentResolver()
585    {
586  1 if (this.currentAttachmentReferenceResolver == null) {
587  1 this.currentAttachmentReferenceResolver =
588    Utils.getComponent(AttachmentReferenceResolver.TYPE_REFERENCE, "current");
589    }
590   
591  1 return this.currentAttachmentReferenceResolver;
592    }
593   
 
594  87 toggle private EntityReferenceSerializer<String> getDefaultEntityReferenceSerializer()
595    {
596  87 if (this.defaultEntityReferenceSerializer == null) {
597  11 this.defaultEntityReferenceSerializer = Utils.getComponent(EntityReferenceSerializer.TYPE_STRING);
598    }
599   
600  87 return this.defaultEntityReferenceSerializer;
601    }
602   
 
603  53798 toggle private DocumentReferenceResolver<String> getCurrentMixedDocumentReferenceResolver()
604    {
605  53798 if (this.currentMixedDocumentReferenceResolver == null) {
606  41 this.currentMixedDocumentReferenceResolver =
607    Utils.getComponent(DocumentReferenceResolver.TYPE_STRING, "currentmixed");
608    }
609   
610  53790 return this.currentMixedDocumentReferenceResolver;
611    }
612   
 
613  2107 toggle private DocumentReferenceResolver<EntityReference> getCurrentReferenceDocumentReferenceResolver()
614    {
615  2107 if (this.currentReferenceDocumentReferenceResolver == null) {
616  60 this.currentReferenceDocumentReferenceResolver =
617    Utils.getComponent(DocumentReferenceResolver.TYPE_REFERENCE, "current");
618    }
619   
620  2107 return this.currentReferenceDocumentReferenceResolver;
621    }
622   
 
623  0 toggle private EntityReferenceResolver<String> getCurrentMixedEntityReferenceResolver()
624    {
625  0 if (this.currentMixedEntityReferenceResolver == null) {
626  0 this.currentMixedEntityReferenceResolver =
627    Utils.getComponent(