View Javadoc
1   /*
2    * Copyright (C) 2003-2008 eXo Platform SAS.
3    *
4    * This program is free software; you can redistribute it and/or
5    * modify it under the terms of the GNU Affero General Public License
6    * as published by the Free Software Foundation; either version 3
7    * of the License, or (at your option) any later version.
8    *
9    * This program is distributed in the hope that it will be useful,
10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12   * GNU General Public License for more details.
13   *
14   * You should have received a copy of the GNU General Public License
15   * along with this program; if not, see<http://www.gnu.org/licenses/>.
16   */
17  package org.exoplatform.services.wcm.search;
18  
19  import java.io.InputStream;
20  import java.util.Calendar;
21  
22  import javax.jcr.AccessDeniedException;
23  import javax.jcr.InvalidItemStateException;
24  import javax.jcr.Item;
25  import javax.jcr.ItemExistsException;
26  import javax.jcr.ItemNotFoundException;
27  import javax.jcr.ItemVisitor;
28  import javax.jcr.MergeException;
29  import javax.jcr.NoSuchWorkspaceException;
30  import javax.jcr.Node;
31  import javax.jcr.NodeIterator;
32  import javax.jcr.PathNotFoundException;
33  import javax.jcr.Property;
34  import javax.jcr.PropertyIterator;
35  import javax.jcr.ReferentialIntegrityException;
36  import javax.jcr.RepositoryException;
37  import javax.jcr.Session;
38  import javax.jcr.UnsupportedRepositoryOperationException;
39  import javax.jcr.Value;
40  import javax.jcr.ValueFormatException;
41  import javax.jcr.lock.Lock;
42  import javax.jcr.lock.LockException;
43  import javax.jcr.nodetype.ConstraintViolationException;
44  import javax.jcr.nodetype.NoSuchNodeTypeException;
45  import javax.jcr.nodetype.NodeDefinition;
46  import javax.jcr.nodetype.NodeType;
47  import javax.jcr.query.Row;
48  import javax.jcr.version.Version;
49  import javax.jcr.version.VersionException;
50  import javax.jcr.version.VersionHistory;
51  import org.apache.commons.lang.StringEscapeUtils;
52  import org.exoplatform.services.wcm.core.NodeLocation;
53  
54  /**
55   * Created by The eXo Platform SAS
56   * Author : Hoa Pham
57   * hoa.phamvu@exoplatform.com
58   * Feb 2, 2009
59   */
60  public class ResultNode implements Node{
61  
62    /** The node. */
63    private NodeLocation nodeLocation;
64  
65    /** The score. */
66    private float score;
67  
68    /** The excerpt. */
69    private String excerpt;
70  
71    /** user navigation node's uri **/
72    private String userNavigationURI;
73  
74    /**
75     * Instantiates a new result node.
76     *
77     * @param node the node
78     * @param row the row
79     *
80     * @throws RepositoryException the repository exception
81     */
82    public ResultNode(Node node, Row row) throws RepositoryException{
83      this.nodeLocation = NodeLocation.getNodeLocationByNode(node);
84      if(row != null) {
85        Value excerpt = row.getValue("rep:excerpt(.)");
86        this.excerpt = excerpt == null ? "" : excerpt.getString();
87        this.score = row.getValue("jcr:score").getLong();
88      }
89    }
90  
91    public ResultNode(Node node, float score, String excerpt) {
92      this.nodeLocation = NodeLocation.getNodeLocationByNode(node);
93      this.excerpt = excerpt;
94      this.score = score;
95    }
96  
97    public ResultNode(Node node, Row row, String userNavURI) throws RepositoryException {
98      this.nodeLocation = NodeLocation.getNodeLocationByNode(node);
99      this.userNavigationURI = userNavURI;
100     Value excerpt = row.getValue("rep:excerpt(.)");
101     this.excerpt = excerpt == null ? "" : excerpt.getString();
102     this.score = row.getValue("jcr:score").getLong();
103   }
104 
105   /**
106    * Gets the node.
107    *
108    * @return the node
109    */
110   public Node getNode() { return NodeLocation.getNodeByLocation(nodeLocation); }
111 
112   /**
113    * Sets the node.
114    *
115    * @param node the new node
116    */
117   public void setNode(Node node) { this.nodeLocation = NodeLocation.getNodeLocationByNode(node); }
118 
119   /**
120    * @param userNavigationURI the userNavigationURI to set
121    */
122   public void setUserNavigationURI(String userNavigationURI) {
123     this.userNavigationURI = userNavigationURI;
124   }
125 
126   /**
127    * @return the userNavigationURI
128    */
129   public String getUserNavigationURI() {
130     return userNavigationURI;
131   }
132 
133   /**
134    * Gets the score.
135    *
136    * @return the score
137    */
138   public float getScore() { return score; }
139 
140   /**
141    * Sets the score.
142    *
143    * @param score the new score
144    */
145   public void setScore(float score) { this.score = score; }
146 
147   /**
148    * Gets the excerpt.
149    *
150    * @return the excerpt
151    */
152   public String getExcerpt() {
153 	excerpt = StringEscapeUtils.unescapeHtml(excerpt);
154     return excerpt;
155   }
156 
157   public String getEditor() {
158     String editor = null;
159     try {
160       if (getNode().hasProperty("exo:owner")) {
161         editor = getNode().getProperty("exo:owner").getString();
162       }
163     } catch (Exception ex) {
164       editor = null;
165     }
166     return editor;
167   }
168 
169   /**
170    * Sets the excerpt.
171    *
172    * @param excerpt the new excerpt
173    */
174   public void setExcerpt(String excerpt) {
175     this.excerpt = excerpt;
176   }
177 
178   /**
179    * Gets the title.
180    *
181    * @return the title
182    *
183    * @throws Exception the exception
184    */
185   public String getTitle() throws Exception {
186     if(getNode().hasProperty("exo:title")) {
187       return getNode().getProperty("exo:title").getString();
188     }
189     return getNode().getName();
190   }
191 
192   /**
193    * Gets the summary.
194    *
195    * @return the summary
196    *
197    * @throws Exception the exception
198    */
199   public String getSummary() throws Exception {
200     if(getNode().hasProperty("exo:summary")) {
201       return getNode().getProperty("exo:summary").getString();
202     }
203     return null;
204   }
205 
206   /**
207    * Get the meta tag SEO's description of page node
208    *
209    * @return
210    * @throws Exception
211    */
212   public String getDescription() throws Exception {
213     if (getNode().hasProperty("exo:metaDescription")) {
214       return getNode().getProperty("exo:metaDescription").getString();
215     }
216     return null;
217   }
218 
219   /* (non-Javadoc)
220    * @see javax.jcr.Node#addMixin(java.lang.String)
221    */
222   public void addMixin(String name) throws NoSuchNodeTypeException, VersionException,
223   ConstraintViolationException, LockException, RepositoryException {
224     throw new  ConstraintViolationException("Unsupported this method");
225   }
226 
227   /* (non-Javadoc)
228    * @see javax.jcr.Node#addNode(java.lang.String)
229    */
230   public Node addNode(String name) throws ItemExistsException, PathNotFoundException,
231   VersionException, ConstraintViolationException, LockException, RepositoryException {
232     throw new  ConstraintViolationException("Unsupported this method");
233   }
234 
235   /* (non-Javadoc)
236    * @see javax.jcr.Node#addNode(java.lang.String, java.lang.String)
237    */
238   public Node addNode(String name, String type) throws ItemExistsException,
239   PathNotFoundException, NoSuchNodeTypeException, LockException, VersionException,
240   ConstraintViolationException, RepositoryException {
241     throw new  ConstraintViolationException("Unsupported this method");
242   }
243 
244   /* (non-Javadoc)
245    * @see javax.jcr.Node#canAddMixin(java.lang.String)
246    */
247   public boolean canAddMixin(String name) throws NoSuchNodeTypeException, RepositoryException {
248     throw new  ConstraintViolationException("Unsupported this method");
249   }
250 
251   /* (non-Javadoc)
252    * @see javax.jcr.Node#cancelMerge(javax.jcr.version.Version)
253    */
254   public void cancelMerge(Version version) throws VersionException, InvalidItemStateException,
255   UnsupportedRepositoryOperationException, RepositoryException {
256     throw new  ConstraintViolationException("Unsupported this method");
257   }
258 
259   /* (non-Javadoc)
260    * @see javax.jcr.Node#checkin()
261    */
262   public Version checkin() throws VersionException, UnsupportedRepositoryOperationException,
263   InvalidItemStateException, LockException, RepositoryException {
264     throw new  ConstraintViolationException("Unsupported this method");
265   }
266 
267   /* (non-Javadoc)
268    * @see javax.jcr.Node#checkout()
269    */
270   public void checkout() throws UnsupportedRepositoryOperationException, LockException,
271   RepositoryException {
272     throw new  ConstraintViolationException("Unsupported this method");
273   }
274 
275   /* (non-Javadoc)
276    * @see javax.jcr.Node#doneMerge(javax.jcr.version.Version)
277    */
278   public void doneMerge(Version version) throws VersionException, InvalidItemStateException,
279   UnsupportedRepositoryOperationException, RepositoryException {
280     throw new  ConstraintViolationException("Unsupported this method");
281   }
282 
283   /* (non-Javadoc)
284    * @see javax.jcr.Node#getBaseVersion()
285    */
286   public Version getBaseVersion() throws UnsupportedRepositoryOperationException,
287   RepositoryException {
288     return getNode().getBaseVersion();
289   }
290 
291   /* (non-Javadoc)
292    * @see javax.jcr.Node#getCorrespondingNodePath(java.lang.String)
293    */
294   public String getCorrespondingNodePath(String nodePath) throws ItemNotFoundException,
295   NoSuchWorkspaceException, AccessDeniedException, RepositoryException {
296     return getNode().getCorrespondingNodePath(nodePath);
297   }
298 
299   /* (non-Javadoc)
300    * @see javax.jcr.Node#getDefinition()
301    */
302   public NodeDefinition getDefinition() throws RepositoryException {
303     return getNode().getDefinition();
304   }
305 
306   /* (non-Javadoc)
307    * @see javax.jcr.Node#getIndex()
308    */
309   public int getIndex() throws RepositoryException {
310     return getNode().getIndex();
311   }
312 
313   /* (non-Javadoc)
314    * @see javax.jcr.Node#getLock()
315    */
316   public Lock getLock() throws UnsupportedRepositoryOperationException, LockException,
317   AccessDeniedException, RepositoryException {
318     return getNode().getLock();
319   }
320 
321   /* (non-Javadoc)
322    * @see javax.jcr.Node#getMixinNodeTypes()
323    */
324   public NodeType[] getMixinNodeTypes() throws RepositoryException {
325     return getNode().getMixinNodeTypes();
326   }
327 
328   /* (non-Javadoc)
329    * @see javax.jcr.Node#getNode(java.lang.String)
330    */
331   public Node getNode(String name) throws PathNotFoundException, RepositoryException {
332     return getNode().getNode(name);
333   }
334 
335   /* (non-Javadoc)
336    * @see javax.jcr.Node#getNodes()
337    */
338   public NodeIterator getNodes() throws RepositoryException {
339     return getNode().getNodes();
340   }
341 
342   /* (non-Javadoc)
343    * @see javax.jcr.Node#getNodes(java.lang.String)
344    */
345   public NodeIterator getNodes(String name) throws RepositoryException {
346     return getNode().getNodes(name);
347   }
348 
349   /* (non-Javadoc)
350    * @see javax.jcr.Node#getPrimaryItem()
351    */
352   public Item getPrimaryItem() throws ItemNotFoundException, RepositoryException {
353     return getNode().getPrimaryItem();
354   }
355 
356   /* (non-Javadoc)
357    * @see javax.jcr.Node#getPrimaryNodeType()
358    */
359   public NodeType getPrimaryNodeType() throws RepositoryException {
360     return getNode().getPrimaryNodeType();
361   }
362 
363   /* (non-Javadoc)
364    * @see javax.jcr.Node#getProperties()
365    */
366   public PropertyIterator getProperties() throws RepositoryException {
367     return getNode().getProperties();
368   }
369 
370   /* (non-Javadoc)
371    * @see javax.jcr.Node#getProperties(java.lang.String)
372    */
373   public PropertyIterator getProperties(String name) throws RepositoryException {
374     return getNode().getProperties(name);
375   }
376 
377   /* (non-Javadoc)
378    * @see javax.jcr.Node#getReferences()
379    */
380   public PropertyIterator getReferences() throws RepositoryException {
381     return getNode().getReferences();
382   }
383 
384   /* (non-Javadoc)
385    * @see javax.jcr.Node#getUUID()
386    */
387   public String getUUID() throws UnsupportedRepositoryOperationException, RepositoryException {
388     return getNode().getUUID();
389   }
390 
391   /* (non-Javadoc)
392    * @see javax.jcr.Node#getVersionHistory()
393    */
394   public VersionHistory getVersionHistory() throws UnsupportedRepositoryOperationException,
395   RepositoryException {
396     return getNode().getVersionHistory();
397   }
398 
399   /* (non-Javadoc)
400    * @see javax.jcr.Node#hasNode(java.lang.String)
401    */
402   public boolean hasNode(String name) throws RepositoryException {
403     return getNode().hasNode(name);
404   }
405 
406   /* (non-Javadoc)
407    * @see javax.jcr.Node#hasNodes()
408    */
409   public boolean hasNodes() throws RepositoryException {
410     return getNode().hasNodes();
411   }
412 
413   /* (non-Javadoc)
414    * @see javax.jcr.Node#hasProperties()
415    */
416   public boolean hasProperties() throws RepositoryException {
417     return getNode().hasProperties();
418   }
419 
420   /* (non-Javadoc)
421    * @see javax.jcr.Node#hasProperty(java.lang.String)
422    */
423   public boolean hasProperty(String name) throws RepositoryException {
424     return getNode().hasProperty(name);
425   }
426 
427   /* (non-Javadoc)
428    * @see javax.jcr.Node#holdsLock()
429    */
430   public boolean holdsLock() throws RepositoryException {
431     return getNode().holdsLock();
432   }
433 
434   /* (non-Javadoc)
435    * @see javax.jcr.Node#isCheckedOut()
436    */
437   public boolean isCheckedOut() throws RepositoryException {
438     return getNode().isCheckedOut();
439   }
440 
441   /* (non-Javadoc)
442    * @see javax.jcr.Node#isLocked()
443    */
444   public boolean isLocked() throws RepositoryException {
445     return getNode().isLocked();
446   }
447 
448   /* (non-Javadoc)
449    * @see javax.jcr.Node#isNodeType(java.lang.String)
450    */
451   public boolean isNodeType(String type) throws RepositoryException {
452     return getNode().isNodeType(type);
453   }
454 
455   /* (non-Javadoc)
456    * @see javax.jcr.Node#lock(boolean, boolean)
457    */
458   public Lock lock(boolean arg0, boolean arg1) throws UnsupportedRepositoryOperationException,
459   LockException, AccessDeniedException, InvalidItemStateException, RepositoryException {
460     throw new UnsupportedRepositoryOperationException("Unsupported this method");
461   }
462 
463   /* (non-Javadoc)
464    * @see javax.jcr.Node#merge(java.lang.String, boolean)
465    */
466   public NodeIterator merge(String arg0, boolean arg1) throws NoSuchWorkspaceException,
467   AccessDeniedException, MergeException, LockException, InvalidItemStateException,
468   RepositoryException {
469     throw new RepositoryException("Unsupported this method");
470   }
471 
472   /* (non-Javadoc)
473    * @see javax.jcr.Node#orderBefore(java.lang.String, java.lang.String)
474    */
475   public void orderBefore(String arg0, String arg1)
476   throws UnsupportedRepositoryOperationException, VersionException,
477   ConstraintViolationException, ItemNotFoundException, LockException, RepositoryException {
478     getNode().orderBefore(arg0, arg1);
479   }
480 
481   /* (non-Javadoc)
482    * @see javax.jcr.Node#removeMixin(java.lang.String)
483    */
484   public void removeMixin(String arg0) throws NoSuchNodeTypeException, VersionException,
485   ConstraintViolationException, LockException, RepositoryException {
486     throw new RepositoryException("Unsupported this method");
487   }
488 
489   /* (non-Javadoc)
490    * @see javax.jcr.Node#restore(java.lang.String, boolean)
491    */
492   public void restore(String arg0, boolean arg1) throws VersionException, ItemExistsException,
493   UnsupportedRepositoryOperationException, LockException, InvalidItemStateException,
494   RepositoryException {
495     throw new RepositoryException("Unsupported this method");
496   }
497 
498   /* (non-Javadoc)
499    * @see javax.jcr.Node#restore(javax.jcr.version.Version, boolean)
500    */
501   public void restore(Version arg0, boolean arg1) throws VersionException, ItemExistsException,
502   UnsupportedRepositoryOperationException, LockException, RepositoryException {
503     throw new RepositoryException("Unsupported this method");
504   }
505 
506   /* (non-Javadoc)
507    * @see javax.jcr.Node#restore(javax.jcr.version.Version, java.lang.String, boolean)
508    */
509   public void restore(Version arg0, String arg1, boolean arg2) throws PathNotFoundException,
510   ItemExistsException, VersionException, ConstraintViolationException,
511   UnsupportedRepositoryOperationException, LockException, InvalidItemStateException,
512   RepositoryException {
513     throw new RepositoryException("Unsupported this method");
514   }
515 
516   /* (non-Javadoc)
517    * @see javax.jcr.Node#restoreByLabel(java.lang.String, boolean)
518    */
519   public void restoreByLabel(String arg0, boolean arg1) throws VersionException,
520   ItemExistsException, UnsupportedRepositoryOperationException, LockException,
521   InvalidItemStateException, RepositoryException {
522     throw new RepositoryException("Unsupported this method");
523   }
524 
525   /* (non-Javadoc)
526    * @see javax.jcr.Node#setProperty(java.lang.String, javax.jcr.Value)
527    */
528   public Property setProperty(String arg0, Value arg1) throws ValueFormatException,
529   VersionException, LockException, ConstraintViolationException, RepositoryException {
530     throw new RepositoryException("Unsupported this method");
531   }
532 
533   /* (non-Javadoc)
534    * @see javax.jcr.Node#setProperty(java.lang.String, javax.jcr.Value[])
535    */
536   public Property setProperty(String arg0, Value[] arg1) throws ValueFormatException,
537   VersionException, LockException, ConstraintViolationException, RepositoryException {
538     throw new RepositoryException("Unsupported this method");
539   }
540 
541   /* (non-Javadoc)
542    * @see javax.jcr.Node#setProperty(java.lang.String, java.lang.String[])
543    */
544   public Property setProperty(String arg0, String[] arg1) throws ValueFormatException,
545   VersionException, LockException, ConstraintViolationException, RepositoryException {
546     throw new RepositoryException("Unsupported this method");
547   }
548 
549   /* (non-Javadoc)
550    * @see javax.jcr.Node#setProperty(java.lang.String, java.lang.String)
551    */
552   public Property setProperty(String arg0, String arg1) throws ValueFormatException,
553   VersionException, LockException, ConstraintViolationException, RepositoryException {
554     throw new RepositoryException("Unsupported this method");
555   }
556 
557   /* (non-Javadoc)
558    * @see javax.jcr.Node#setProperty(java.lang.String, java.io.InputStream)
559    */
560   public Property setProperty(String arg0, InputStream arg1) throws ValueFormatException,
561   VersionException, LockException, ConstraintViolationException, RepositoryException {
562     throw new RepositoryException("Unsupported this method");
563   }
564 
565   /* (non-Javadoc)
566    * @see javax.jcr.Node#setProperty(java.lang.String, boolean)
567    */
568   public Property setProperty(String arg0, boolean arg1) throws ValueFormatException,
569   VersionException, LockException, ConstraintViolationException, RepositoryException {
570     throw new RepositoryException("Unsupported this method");
571   }
572 
573   /* (non-Javadoc)
574    * @see javax.jcr.Node#setProperty(java.lang.String, double)
575    */
576   public Property setProperty(String arg0, double arg1) throws ValueFormatException,
577   VersionException, LockException, ConstraintViolationException, RepositoryException {
578     throw new RepositoryException("Unsupported this method");
579   }
580 
581   /* (non-Javadoc)
582    * @see javax.jcr.Node#setProperty(java.lang.String, long)
583    */
584   public Property setProperty(String arg0, long arg1) throws ValueFormatException,
585   VersionException, LockException, ConstraintViolationException, RepositoryException {
586     throw new RepositoryException("Unsupported this method");
587   }
588 
589   /* (non-Javadoc)
590    * @see javax.jcr.Node#setProperty(java.lang.String, java.util.Calendar)
591    */
592   public Property setProperty(String arg0, Calendar arg1) throws ValueFormatException,
593   VersionException, LockException, ConstraintViolationException, RepositoryException {
594     throw new RepositoryException("Unsupported this method");
595   }
596 
597   /* (non-Javadoc)
598    * @see javax.jcr.Node#setProperty(java.lang.String, javax.jcr.Node)
599    */
600   public Property setProperty(String arg0, Node arg1) throws ValueFormatException,
601   VersionException, LockException, ConstraintViolationException, RepositoryException {
602     throw new RepositoryException("Unsupported this method");
603   }
604 
605   /* (non-Javadoc)
606    * @see javax.jcr.Node#setProperty(java.lang.String, javax.jcr.Value, int)
607    */
608   public Property setProperty(String arg0, Value arg1, int arg2) throws ValueFormatException,
609   VersionException, LockException, ConstraintViolationException, RepositoryException {
610     throw new RepositoryException("Unsupported this method");
611   }
612 
613   /* (non-Javadoc)
614    * @see javax.jcr.Node#setProperty(java.lang.String, javax.jcr.Value[], int)
615    */
616   public Property setProperty(String arg0, Value[] arg1, int arg2) throws ValueFormatException,
617   VersionException, LockException, ConstraintViolationException, RepositoryException {
618     throw new RepositoryException("Unsupported this method");
619   }
620 
621   /* (non-Javadoc)
622    * @see javax.jcr.Node#setProperty(java.lang.String, java.lang.String[], int)
623    */
624   public Property setProperty(String arg0, String[] arg1, int arg2) throws ValueFormatException,
625   VersionException, LockException, ConstraintViolationException, RepositoryException {
626     throw new RepositoryException("Unsupported this method");
627   }
628 
629   /* (non-Javadoc)
630    * @see javax.jcr.Node#setProperty(java.lang.String, java.lang.String, int)
631    */
632   public Property setProperty(String arg0, String arg1, int arg2) throws ValueFormatException,
633   VersionException, LockException, ConstraintViolationException, RepositoryException {
634     throw new RepositoryException("Unsupported this method");
635   }
636 
637   /* (non-Javadoc)
638    * @see javax.jcr.Node#unlock()
639    */
640   public void unlock() throws UnsupportedRepositoryOperationException, LockException,
641   AccessDeniedException, InvalidItemStateException, RepositoryException {
642     throw new RepositoryException("Unsupported this method");
643   }
644 
645   /* (non-Javadoc)
646    * @see javax.jcr.Node#update(java.lang.String)
647    */
648   public void update(String arg0) throws NoSuchWorkspaceException, AccessDeniedException,
649   LockException, InvalidItemStateException, RepositoryException {
650     throw new RepositoryException("Unsupported this method");
651   }
652 
653   /* (non-Javadoc)
654    * @see javax.jcr.Item#accept(javax.jcr.ItemVisitor)
655    */
656   public void accept(ItemVisitor arg0) throws RepositoryException {
657     getNode().accept(arg0);
658   }
659 
660   /* (non-Javadoc)
661    * @see javax.jcr.Item#getAncestor(int)
662    */
663   public Item getAncestor(int arg0) throws ItemNotFoundException, AccessDeniedException,
664   RepositoryException {
665     return getNode().getAncestor(arg0);
666   }
667 
668   /* (non-Javadoc)
669    * @see javax.jcr.Item#getDepth()
670    */
671   public int getDepth() throws RepositoryException {
672     return getNode().getDepth();
673   }
674 
675   /* (non-Javadoc)
676    * @see javax.jcr.Item#getName()
677    */
678   public String getName() throws RepositoryException {
679     return getNode().getName();
680   }
681 
682   /* (non-Javadoc)
683    * @see javax.jcr.Item#isModified()
684    */
685   public boolean isModified() {
686     return getNode().isModified();
687   }
688 
689   /* (non-Javadoc)
690    * @see javax.jcr.Item#isNew()
691    */
692   public boolean isNew() {
693     return getNode().isNew();
694   }
695 
696   /* (non-Javadoc)
697    * @see javax.jcr.Item#isNode()
698    */
699   public boolean isNode() {
700     return getNode().isNode();
701   }
702 
703   /* (non-Javadoc)
704    * @see javax.jcr.Item#isSame(javax.jcr.Item)
705    */
706   public boolean isSame(Item arg0) throws RepositoryException {
707     return getNode().isSame(arg0);
708   }
709 
710   /* (non-Javadoc)
711    * @see javax.jcr.Item#refresh(boolean)
712    */
713   public void refresh(boolean arg0) throws InvalidItemStateException, RepositoryException {
714     getNode().refresh(arg0);
715   }
716 
717   /* (non-Javadoc)
718    * @see javax.jcr.Item#remove()
719    */
720   public void remove() throws VersionException, LockException, ConstraintViolationException,
721   RepositoryException {
722     throw new RepositoryException("Unsupported this method");
723   }
724 
725   /* (non-Javadoc)
726    * @see javax.jcr.Item#save()
727    */
728   public void save() throws AccessDeniedException, ItemExistsException,
729   ConstraintViolationException, InvalidItemStateException, ReferentialIntegrityException,
730   VersionException, LockException, NoSuchNodeTypeException, RepositoryException {
731     throw new RepositoryException("Unsupported this method");
732   }
733 
734   /* (non-Javadoc)
735    * @see javax.jcr.Node#getProperty(java.lang.String)
736    */
737   public Property getProperty(String arg0) throws PathNotFoundException, RepositoryException {
738     return getNode().getProperty(arg0);
739   }
740 
741   /* (non-Javadoc)
742    * @see javax.jcr.Item#getParent()
743    */
744   public Node getParent() throws ItemNotFoundException, AccessDeniedException,
745   RepositoryException {
746     return getNode().getParent();
747   }
748 
749   /* (non-Javadoc)
750    * @see javax.jcr.Item#getPath()
751    */
752   public String getPath() throws RepositoryException {
753     return getNode().getPath();
754   }
755 
756   /* (non-Javadoc)
757    * @see javax.jcr.Item#getSession()
758    */
759   public Session getSession() throws RepositoryException {
760     return getNode().getSession();
761   }
762 
763   /* (non-Javadoc)
764    * @see java.lang.Object#equals(java.lang.Object)
765    */
766   @Override
767   public boolean equals(Object obj) {
768     try {
769       ResultNode resNode = (ResultNode)obj;
770       if(getNode().getPath().equals(resNode.getNode().getPath())) return true;
771     } catch(Exception e) {
772       return false;
773     }
774     return false;
775   }
776 
777   @Override
778   public int hashCode() {
779     return nodeLocation.hashCode();
780   }
781 }