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

File DiffPluginApi.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart4.png
78% of files have more coverage

Code metrics

2
11
8
1
117
46
9
0.82
1.38
8
1.12

Classes

Class Line # Actions
DiffPluginApi 33 11 0% 9 14
0.3333333433.3%
 

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 com.xpn.xwiki.plugin.diff;
21   
22    import java.util.List;
23   
24    import com.xpn.xwiki.XWikiContext;
25    import com.xpn.xwiki.XWikiException;
26    import com.xpn.xwiki.api.Api;
27   
28    /**
29    * @version $Id: 3c555c991336b696f82dab7b0b27a08197b9e2e8 $
30    * @deprecated since 4.1 use diff service
31    */
32    @Deprecated
 
33    public class DiffPluginApi extends Api
34    {
35    private DiffPlugin plugin;
36   
 
37  2 toggle public DiffPluginApi(DiffPlugin plugin, XWikiContext context)
38    {
39  2 super(context);
40  2 setPlugin(plugin);
41    }
42   
 
43  0 toggle public DiffPlugin getPlugin()
44    {
45  0 if (hasProgrammingRights()) {
46  0 return this.plugin;
47    }
48  0 return null;
49    }
50   
 
51  2 toggle public void setPlugin(DiffPlugin plugin)
52    {
53  2 this.plugin = plugin;
54    }
55   
56    /**
57    * Return a list of Delta objects representing line differences in text1 and text2
58    *
59    * @param text1 original content
60    * @param text2 revised content
61    * @return list of Delta objects
62    */
 
63  0 toggle public List getDifferencesAsList(String text1, String text2) throws XWikiException
64    {
65  0 return this.plugin.getDifferencesAsList(text1, text2);
66    }
67   
68    /**
69    * Return an html blocks representing line diffs between text1 and text2
70    *
71    * @param text1 original content
72    * @param text2 revised content
73    * @return list of Delta objects
74    */
 
75  0 toggle public String getDifferencesAsHTML(String text1, String text2) throws XWikiException
76    {
77  0 return this.plugin.getDifferencesAsHTML(text1, text2);
78    }
79   
80    /**
81    * Return an html blocks representing line diffs between text1 and text2
82    *
83    * @param text1 original content
84    * @param text2 revised content
85    * @param allDoc view all document or only changes
86    * @return list of Delta objects
87    */
 
88  2 toggle public String getDifferencesAsHTML(String text1, String text2, boolean allDoc) throws XWikiException
89    {
90  2 return this.plugin.getDifferencesAsHTML(text1, text2, allDoc);
91    }
92   
93    /**
94    * Return a list of Delta objects representing word differences in text1 and text2
95    *
96    * @param text1 original content
97    * @param text2 revised content
98    * @return list of Delta objects
99    */
 
100  0 toggle public List getWordDifferencesAsList(String text1, String text2) throws XWikiException
101    {
102  0 return this.plugin.getWordDifferencesAsList(text1, text2);
103    }
104   
105    /**
106    * Return an html blocks representing word diffs between text1 and text2
107    *
108    * @param text1 original content
109    * @param text2 revised content
110    * @return list of Delta objects
111    */
 
112  0 toggle public String getWordDifferencesAsHTML(String text1, String text2) throws XWikiException
113    {
114  0 return this.plugin.getWordDifferencesAsHTML(text1, text2);
115    }
116   
117    }