1. Project Clover database Sat Feb 2 2019 06:45:20 CET
  2. Package org.xwiki.bridge

File DocumentModelBridge.java

 

Code metrics

0
0
0
1
135
26
0
-
-
0
-

Classes

Class Line # Actions
DocumentModelBridge 34 0 - 0 0
-1.0 -
 

Contributing tests

No tests hitting this source file were found.

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 org.xwiki.bridge;
21   
22    import org.xwiki.model.reference.DocumentReference;
23    import org.xwiki.rendering.block.XDOM;
24    import org.xwiki.rendering.syntax.Syntax;
25   
26    /**
27    * Exposes methods for accessing Documents. This is temporary until we remodel the Model classes and the Document
28    * services. The implementation is actually the XWikiDocument class, so this is just a light interface that hides the
29    * old xwiki-core.
30    *
31    * @version $Id: 3a8b8036c762990b8e3ad46e8792a9413bc2952e $
32    * @since 1.6M1
33    */
 
34    public interface DocumentModelBridge
35    {
36    /**
37    * Retrieve the full name of the document, in the <code>Space.Name</code> format, for example <tt>Main.WebHome</tt>.
38    *
39    * @return A <code>String</code> representation of the document's full name.
40    * @deprecated use {@link #getDocumentReference} instead
41    */
42    @Deprecated
43    String getFullName();
44   
45    /**
46    * @return the document's reference (without the document locale)
47    * @since 2.2M1
48    */
49    DocumentReference getDocumentReference();
50   
51    /**
52    * Retrieve the actual language of the document variant. If this is a translation, then it is the language of the
53    * translation. If this is the original variant of the document, then it it is the default language of the document.
54    *
55    * @return The document's language in a 2-letter code.
56    */
57    String getRealLanguage();
58   
59    /**
60    * Retrieves the textual content of the document.
61    *
62    * @return The document's content.
63    */
64    String getContent();
65   
66    /**
67    * Retrieves a copy of the document before it was changed.
68    *
69    * @return the copy of this Document instance before any modification was made to it.
70    */
71    DocumentModelBridge getOriginalDocument();
72   
73    /**
74    * @return the Syntax id representing the syntax used for the current document. For example "xwiki/1.0" represents
75    * the first version XWiki syntax while "xwiki/2.0" represents version 2.0 of the XWiki Syntax.
76    * @deprecated since 3.0M1 use {@link #getSyntax()} instead
77    */
78    @Deprecated
79    String getSyntaxId();
80   
81    /**
82    * @return the Syntax id representing the syntax used for the current document. For example "xwiki/1.0" represents
83    * the first version XWiki syntax while "xwiki/2.0" represents version 2.0 of the XWiki Syntax.
84    * @since 3.0M1
85    */
86    Syntax getSyntax();
87   
88    /**
89    * @return the page to which the document belongs to (eg "WebHome")
90    * @deprecated since 2.2M1 use {@link #getDocumentReference()} instead
91    */
92    @Deprecated
93    String getPageName();
94   
95    /**
96    * Return the full local space reference. For example a document located in sub-space <code>space11</code> of space
97    * <code>space1</code> will return <code>space1.space11</code>.
98    *
99    * @return the space to which the document belongs to (eg "Main")
100    * @deprecated since 2.2M1 use {@link #getDocumentReference()} instead
101    */
102    @Deprecated
103    String getSpaceName();
104   
105    /**
106    * Retrieve the name of the virtual wiki this document belongs to.
107    *
108    * @return A <code>String</code> representation of the document's wiki name.
109    * @deprecated since 2.2M1 use {@link #getDocumentReference()} instead
110    */
111    @Deprecated
112    String getWikiName();
113   
114    /**
115    * @return the document's title or null if not set
116    */
117    String getTitle();
118   
119    /**
120    * @return a string identifying the current version of this document
121    */
122    String getVersion();
123   
124    /**
125    * @return the XDOM for the document
126    * @since 3.0M3
127    */
128    XDOM getXDOM();
129   
130    /**
131    * @return the document's content author user reference
132    * @since 7.2M1
133    */
134    DocumentReference getContentAuthorReference();
135    }