1 23 24 package org.apache.slide.macro; 25 26 import java.util.Arrays ; 27 import java.util.Enumeration ; 28 import java.util.HashMap ; 29 import java.util.Iterator ; 30 import java.util.Map ; 31 import java.util.StringTokenizer ; 32 import org.apache.slide.common.Domain; 33 import org.apache.slide.common.Namespace; 34 import org.apache.slide.common.NamespaceConfig; 35 import org.apache.slide.common.ServiceAccessException; 36 import org.apache.slide.common.SlideException; 37 import org.apache.slide.common.SlideToken; 38 import org.apache.slide.common.Uri; 39 import org.apache.slide.content.Content; 40 import org.apache.slide.content.NodeProperty; 41 import org.apache.slide.content.NodeRevisionContent; 42 import org.apache.slide.content.NodeRevisionDescriptor; 43 import org.apache.slide.content.NodeRevisionDescriptors; 44 import org.apache.slide.content.NodeRevisionNumber; 45 import org.apache.slide.content.RevisionDescriptorNotFoundException; 46 import org.apache.slide.lock.Lock; 47 import org.apache.slide.lock.NodeLock; 48 import org.apache.slide.lock.ObjectLockedException; 49 import org.apache.slide.macro.CopyRouteRedirector.CopyRoute; 50 import org.apache.slide.security.AccessDeniedException; 51 import org.apache.slide.security.NodePermission; 52 import org.apache.slide.security.Security; 53 import org.apache.slide.store.Store; 54 import org.apache.slide.structure.ActionNode; 55 import org.apache.slide.structure.LinkedObjectNotFoundException; 56 import org.apache.slide.structure.ObjectHasChildrenException; 57 import org.apache.slide.structure.ObjectNode; 58 import org.apache.slide.structure.ObjectNotFoundException; 59 import org.apache.slide.structure.Structure; 60 import org.apache.slide.util.Configuration; 61 import org.apache.slide.event.EventDispatcher; 62 import org.apache.slide.event.MacroEvent; 63 import org.apache.slide.event.VetoException; 64 65 70 public final class MacroImpl implements Macro { 71 72 private Namespace namespace; 73 private NamespaceConfig namespaceConfig; 74 private Content contentHelper; 75 private Structure structureHelper; 76 private Security securityHelper; 77 private Lock lockHelper; 78 79 87 public MacroImpl(Namespace namespace, NamespaceConfig namespaceConfig, 88 Security securityHelper, Content contentHelper, 89 Structure structureHelper, 90 Lock lockHelper) { 91 this.namespace = namespace; 92 this.namespaceConfig = namespaceConfig; 93 this.securityHelper = securityHelper; 94 this.contentHelper = contentHelper; 95 this.structureHelper = structureHelper; 96 this.lockHelper = lockHelper; 97 } 98 99 107 public void copy(SlideToken token, String sourceUri, 108 String destinationUri) 109 throws CopyMacroException, DeleteMacroException { 110 copy(token, sourceUri, destinationUri, 111 (CopyRouteRedirector)null, (CopyListener)null, 112 (DeleteTargetRedirector)null, (DeleteListener)null); 113 } 114 115 137 public void copy(SlideToken token, String sourceUri, 138 String destinationUri, CopyRouteRedirector copyRedirector, CopyListener copyListener, 139 DeleteTargetRedirector deleteRedirector, DeleteListener deleteListener) 140 throws CopyMacroException, DeleteMacroException { 141 142 this.copy(token, sourceUri, destinationUri, 143 RECURSIVE_OVERWRITE_PARAMETERS, copyRedirector, copyListener, 144 deleteRedirector, deleteListener); 145 } 146 147 148 157 public void copy(SlideToken token, String sourceUri, 158 String destinationUri, MacroParameters parameters) 159 throws CopyMacroException, DeleteMacroException { 160 copy(token, sourceUri, destinationUri, parameters, null, null, null, null); 161 } 162 163 186 public void copy(SlideToken token, String sourceUri, 187 String destinationUri, MacroParameters parameters, 188 CopyRouteRedirector copyRedirector, CopyListener copyListener, 189 DeleteTargetRedirector deleteRedirector, DeleteListener deleteListener) 190 throws CopyMacroException, DeleteMacroException { 191 192 Domain.debug("Copy " + sourceUri + " to " + destinationUri); 193 194 CopyMacroException e = new CopyMacroException("Copy failed"); 196 197 if (sourceUri.equals(destinationUri)) { 200 e.addException(new ForbiddenException(sourceUri)); 201 throw e; 202 } 203 204 Map alreadyCopied = new HashMap (); parameters.setParameter( ALREADY_COPIED, alreadyCopied ); 206 207 copyObject(token, sourceUri, destinationUri, parameters, true, e, 208 copyRedirector, copyListener, deleteRedirector, deleteListener); 209 210 if (!e.isEmpty()) { 212 throw e; 213 } 214 215 try { 216 if ( MacroEvent.COPY.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(MacroEvent.COPY, new MacroEvent(this, token, namespace, sourceUri, destinationUri)); 217 } catch ( VetoException ve ) { 218 throw new CopyMacroException(ve.getMessage()); 219 } 220 } 221 222 protected void recursiveAccessCheck(Uri uri, ActionNode action) throws SlideException, 223 AccessDeniedException { 224 try { 225 ObjectNode node = uri.getStore().retrieveObject(uri); 226 securityHelper.checkCredentials(uri.getToken(), node, action); 227 Iterator i = node.getChildren().iterator(); 228 while (i.hasNext()) { 229 String child = (String ) i.next(); 230 Uri childUri = namespace.getUri(uri.getToken(), child); 231 recursiveAccessCheck(childUri, action); 232 } 233 } catch (ObjectNotFoundException onfe) { 234 } 236 } 237 238 protected void recursiveLockCheck(Uri uri) throws SlideException, 239 ObjectLockedException 240 { 241 try { 242 ObjectNode node = uri.getStore().retrieveObject(uri); 243 ActionNode action = namespaceConfig.getCreateObjectAction(); 244 lockHelper.checkLock(uri.getToken(), node, action); 245 Iterator i = node.getChildren().iterator(); 246 while (i.hasNext()) { 247 String child = (String ) i.next(); 248 Uri childUri = namespace.getUri(uri.getToken(), child); 249 recursiveLockCheck(childUri); 250 } 251 } catch (ObjectNotFoundException onfe) { 252 } 254 } 255 256 public void rebind(SlideToken token, String sourceUri, 258 String destinationUri, MacroParameters parameters, 259 CopyRouteRedirector copyRedirector, CopyListener copyListener, 260 DeleteTargetRedirector deleteRedirector, DeleteListener deleteListener) 261 throws CopyMacroException, DeleteMacroException { 262 263 CopyMacroException e = new CopyMacroException("Rebind failed"); 264 265 if (sourceUri.equals(destinationUri)) { 268 e.addException(new ForbiddenException(sourceUri)); 269 throw e; 270 } 271 272 Uri source = namespace.getUri(token, sourceUri); 273 Uri destination = namespace.getUri(token, destinationUri); 274 try { 275 recursiveLockCheck(source); 276 recursiveLockCheck(destination); 277 } catch (SlideException ex) { 278 e.addException(ex); 279 throw e; 280 } 281 282 if (parameters.isDeleteCreate()) { 283 try { 284 structureHelper.retrieve(token, destinationUri); 286 delete(token, destinationUri, deleteRedirector, deleteListener); 287 } catch(ObjectNotFoundException onf) { 288 } catch(DeleteMacroException s) { 290 throw s; 291 } catch(SlideException s) { 292 e.addException(s); 293 throw e; 294 } 295 } 296 298 UriHandler destinationUh = new UriHandler(destinationUri); 299 UriHandler destinationParentUh = destinationUh.getParent(); 300 ObjectNode destinationParentNode = null; 301 String destinationSegment = destinationUh.getLastSegment(); 302 UriHandler sourceUh = new UriHandler(sourceUri); 303 UriHandler sourceParentUh = sourceUh.getParent(); 304 ObjectNode sourceParentNode = null; 305 String sourceSegment = sourceUh.getLastSegment(); 306 ObjectNode sourceNode = null; 307 308 try { 309 try { 310 destinationParentNode = 311 structureHelper.retrieve(token, destinationParentUh.toString(), false ); 312 } 313 catch (ObjectNotFoundException ex) { 314 throw new ConflictException(destinationParentUh.toString()); 315 } 316 sourceParentNode = 317 structureHelper.retrieve(token, sourceParentUh.toString(), false ); 318 sourceNode = 319 structureHelper.retrieve(token, sourceUri, false ); 320 } 321 catch (SlideException x) { 322 e.addException(x); 323 throw e; 324 } 325 326 try { 327 if (copyListener != null) { 329 copyListener.beforeCopy(sourceUri, destinationUri, true); 330 } 331 structureHelper.addBinding( token, destinationParentNode, destinationSegment, sourceNode ); 332 structureHelper.removeBinding( token, sourceParentNode, sourceSegment ); 333 } 334 catch (SlideException x) { 335 e.addException(x); 336 throw e; 337 } 338 } 339 340 349 public void move(SlideToken token, String sourceUri, 350 String destinationUri) 351 throws CopyMacroException, DeleteMacroException { 352 move(token, sourceUri, destinationUri, 353 (CopyRouteRedirector)null, (CopyListener)null, 354 (DeleteTargetRedirector)null, (DeleteListener)null); 355 } 356 357 379 public void move(SlideToken token, String sourceUri, 380 String destinationUri, CopyRouteRedirector copyRedirector, CopyListener copyListener, 381 DeleteTargetRedirector deleteRedirector, DeleteListener deleteListener) 382 throws CopyMacroException, DeleteMacroException { 383 384 move(token, sourceUri, destinationUri, 385 RECURSIVE_OVERWRITE_PARAMETERS, 386 copyRedirector, copyListener, deleteRedirector, deleteListener); 387 } 388 389 390 400 public void move(SlideToken token, String sourceUri, 401 String destinationUri, MacroParameters parameters) 402 throws CopyMacroException, DeleteMacroException { 403 move(token, sourceUri, destinationUri, parameters, null, null, null, null); 404 } 405 406 429 public void move(SlideToken token, String sourceUri, 430 String destinationUri, MacroParameters parameters, 431 CopyRouteRedirector copyRedirector, CopyListener copyListener, 432 DeleteTargetRedirector deleteRedirector, DeleteListener deleteListener) 433 throws CopyMacroException, DeleteMacroException { 434 435 if (Configuration.useBinding(namespace.getUri(token, sourceUri).getStore()) && 436 Configuration.useBinding(namespace.getUri(token, destinationUri).getStore()) && 437 sameStore(token, sourceUri, destinationUri)) { 438 rebind(token, sourceUri, destinationUri, parameters, 439 copyRedirector, copyListener, deleteRedirector, deleteListener); 440 } 441 else { 442 copy(token, sourceUri, destinationUri, parameters, 443 copyRedirector, copyListener, deleteRedirector, deleteListener); 444 delete(token, sourceUri, parameters, deleteRedirector, deleteListener); 445 } 446 447 try { 448 if ( MacroEvent.MOVE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(MacroEvent.MOVE, new MacroEvent(this, token, namespace, sourceUri, destinationUri)); 449 } catch ( VetoException ve ) { 450 throw new CopyMacroException(ve.getMessage()); } 452 } 453 454 461 public void delete(SlideToken token, String targetUri) 462 throws DeleteMacroException { 463 delete(token, targetUri, (DeleteTargetRedirector)null, (DeleteListener)null); 464 } 465 466 479 public void delete(SlideToken token, String targetUri, 480 DeleteTargetRedirector deleteRedirector, DeleteListener deleteListener) 481 throws DeleteMacroException { 482 delete(token, targetUri, RECURSIVE_OVERWRITE_PARAMETERS, deleteRedirector, deleteListener); 483 } 484 485 486 495 public void delete(SlideToken token, String targetUri, 496 MacroParameters parameters) 497 throws DeleteMacroException { 498 delete(token, targetUri, parameters, null, null); 499 } 500 501 516 public void delete(SlideToken token, String targetUri, MacroParameters parameters, 517 DeleteTargetRedirector deleteRedirector, DeleteListener deleteListener) 518 throws DeleteMacroException { 519 520 Domain.debug("Delete " + targetUri); 521 522 DeleteMacroException e = new DeleteMacroException("Delete failed"); 523 524 deleteObject(token, targetUri, e, deleteRedirector, deleteListener); 525 526 if (!e.isEmpty()) { 528 throw e; 529 } 530 531 try { 532 if ( MacroEvent.DELETE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(MacroEvent.DELETE, new MacroEvent(this, token, namespace, targetUri)); 533 } catch ( VetoException ve ) { 534 throw new DeleteMacroException(ve.getMessage()); 535 } 536 } 537 538 539 541 542 558 private void copyObject(SlideToken token, String sourceUri, 559 String destinationUri, MacroParameters parameters, boolean isRootOfCopy, 560 CopyMacroException e, CopyRouteRedirector copyRedirector, CopyListener copyListener, 561 DeleteTargetRedirector deleteRedirector, DeleteListener deleteListener 562 ) { 563 564 Domain.debug("Copy object : from " + sourceUri + " to " 565 + destinationUri); 566 567 try { 568 if (isLockNull(token, sourceUri)) { 570 return; 572 } 573 574 ObjectNode sourceNode = 576 structureHelper.retrieve(token, sourceUri, false); 577 Enumeration sourceNodeChildren = sourceNode.enumerateChildren(); 578 ObjectNode destinationNode = null; 579 580 if (copyRedirector != null) { CopyRoute copyRoute = new CopyRoute(sourceUri, destinationUri); 583 copyRoute = copyRedirector.getRedirectedCopyRoute(copyRoute); 584 sourceUri = copyRoute.getSourceUri(); 585 destinationUri = copyRoute.getDestinationUri(); 586 sourceNode = structureHelper.retrieve(token, sourceUri, false); 587 } 589 590 if (copyListener != null) { 592 copyListener.beforeCopy(sourceUri, destinationUri, isRootOfCopy ); 593 } 594 595 if (isRootOfCopy && parameters.isDeleteCreate()) { 597 try { 598 structureHelper.retrieve(token, destinationUri); 600 if (parameters.getParameter(PARENT_BINDINGS) != null) { 601 Map parentBindings = (Map )parameters.getParameter(PARENT_BINDINGS); 602 Iterator i = parentBindings.entrySet().iterator(); 603 while (i.hasNext()) { 604 Map.Entry me = (Map.Entry )i.next(); 605 String uriToDelete = (String )me.getKey()+"/"+(String )me.getValue(); 606 delete(token, uriToDelete, deleteRedirector, deleteListener); 607 } 608 } 609 else { 610 delete(token, destinationUri, deleteRedirector, deleteListener); 611 } 612 } catch(ObjectNotFoundException onf) { 613 } catch(DeleteMacroException s) { 615 Enumeration en = s.enumerateExceptions(); 616 if (en.hasMoreElements()) { 617 throw (SlideException)en.nextElement(); 618 } 619 } 620 } 621 622 boolean destinationExists = destinationExists(token, destinationUri); 623 624 if (parameters.isDeleteCreate() || !destinationExists) { 626 try { 627 Map alreadyCopied = (Map )parameters.getParameter( ALREADY_COPIED ); 628 629 if (alreadyCopied.containsKey(sourceNode.getUuri())) { 630 UriHandler destinationUh = new UriHandler(destinationUri); 636 UriHandler destinationParentUh = destinationUh.getParent(); 637 String segment = destinationUh.getLastSegment(); 638 destinationNode = structureHelper.retrieve( token, (String )alreadyCopied.get(sourceNode.getUuri()) ); 639 ObjectNode destinationParentNode = structureHelper.retrieve( token, destinationParentUh.toString() ); 640 structureHelper.addBinding( token, destinationParentNode, segment, destinationNode ); 641 } 642 else { 643 structureHelper.create(token, sourceNode.copyObject(), 644 destinationUri); 645 destinationNode = structureHelper.retrieve( token, destinationUri ); 646 alreadyCopied.put( sourceNode.getUuri(), destinationNode.getUri() ); 647 } 648 } catch (ObjectNotFoundException s){ 649 throw new ConflictException(s.getObjectUri()); 650 } 651 } 652 653 try { 655 656 Enumeration sourcePermissions = securityHelper 657 .enumeratePermissions(token, sourceNode); 658 659 while (sourcePermissions.hasMoreElements()) { 660 NodePermission permission = 661 (NodePermission) sourcePermissions.nextElement(); 662 NodePermission newPermission = 663 new NodePermission(destinationUri, 664 permission.getSubjectUri(), 665 permission.getActionUri(), 666 permission.isInheritable(), 667 permission.isNegative()); 668 securityHelper.grantPermission(token, newPermission); 669 } 670 671 } catch (AccessDeniedException ex) { 672 } 677 678 NodeRevisionDescriptors sourceNrds = 680 contentHelper.retrieve(token, sourceNode.getUri()); 681 if (sourceNrds.hasRevisions()) { 682 NodeRevisionDescriptor sourceNrd = 683 contentHelper.retrieve(token, sourceNrds); 684 NodeRevisionContent sourceNrc = null; 685 if (sourceNrd.getContentLength() > 0) { 686 sourceNrc = 687 contentHelper.retrieve(token, sourceNrds, sourceNrd); 688 } 689 690 if (parameters.isDeleteCreate() || !destinationExists) { 691 contentHelper.create(token, destinationUri, sourceNrd, sourceNrc); 692 } 693 else { 694 NodeRevisionDescriptor destinationNrd = 695 contentHelper.retrieve(token, 696 contentHelper.retrieve(token, destinationUri)); 697 Enumeration sourceProps = sourceNrd.enumerateProperties(); 698 while (sourceProps.hasMoreElements()) { 699 destinationNrd.setProperty( (NodeProperty)sourceProps.nextElement() ); 700 } 701 contentHelper.store(token, destinationUri, destinationNrd, sourceNrc); 702 } 703 } 704 705 if (copyListener != null) { 707 copyListener.afterCopy(sourceUri, destinationUri, isRootOfCopy, destinationExists); 708 } 709 710 if (parameters.isRecursive()) { 712 while(sourceNodeChildren.hasMoreElements()) { 713 String childUri = (String ) sourceNodeChildren.nextElement(); 714 String childDestinationUri = destinationUri + childUri 715 .substring(sourceNode.getUri().length()); 716 copyObject(token, childUri, childDestinationUri, 717 parameters, false, e, copyRedirector, copyListener, 718 deleteRedirector, deleteListener 719 ); 720 } 721 } 722 723 } catch(SlideException ex) { 724 e.addException(ex); 727 } 728 729 } 730 731 private boolean destinationExists(SlideToken token, String destinationUri) throws ServiceAccessException, LinkedObjectNotFoundException, RevisionDescriptorNotFoundException, ObjectLockedException, AccessDeniedException, VetoException { 732 boolean destinationExists = true; 733 try { 734 contentHelper.retrieve(token, contentHelper.retrieve( 735 token, destinationUri)); 736 } 737 catch (ObjectNotFoundException x) { 738 destinationExists = false; 739 } 740 return destinationExists; 741 } 742 743 744 759 private void deleteObject(SlideToken token, String targetUri, MacroException e, 760 DeleteTargetRedirector deleteRedirector, DeleteListener deleteListener) { 761 762 Domain.debug("Delete object : " + targetUri); 763 764 try { 765 ObjectNode currentObject = 766 structureHelper.retrieve(token, targetUri, false); 767 768 if (!Configuration.useBinding(namespace.getUri(token, targetUri).getStore()) || currentObject.numberOfParentBindings() < 2) { 769 if (currentObject.hasChildren()) { 771 Enumeration children = currentObject.enumerateChildren(); 772 while (children.hasMoreElements()) { 773 String childUri = (String )children.nextElement(); 774 deleteObject(token, childUri, e, deleteRedirector, deleteListener); 775 } 776 } 777 778 if (currentObject.hasLinks()) { 780 Enumeration links = currentObject.enumerateLinks(); 781 while (links.hasMoreElements()) { 782 String linkUri = (String )links.nextElement(); 783 deleteObject(token, linkUri, e, deleteRedirector, deleteListener); 784 } 785 } 786 787 788 if (deleteRedirector != null) { 790 targetUri = deleteRedirector.getRedirectedTargetUri(targetUri); 791 currentObject = structureHelper.retrieve(token, targetUri, false); 792 } 793 794 if (deleteListener != null) { 796 deleteListener.beforeDelete(targetUri); 797 } 798 799 NodeRevisionDescriptors revisionDescriptors = 800 contentHelper.retrieve(token, currentObject.getUri()); 801 802 Enumeration locks = lockHelper.enumerateLocks 804 (token, currentObject.getUri(), false); 805 while (locks.hasMoreElements()) { 806 lockHelper.unlock(token, (NodeLock) locks.nextElement()); 807 } 808 Enumeration permissions = securityHelper.enumeratePermissions 810 (token, currentObject); 811 while (permissions.hasMoreElements()) { 812 NodePermission permission = 813 (NodePermission) permissions.nextElement(); 814 securityHelper.revokePermission(token, permission); 815 } 816 817 if( !revisionDescriptors.isRedirected() ) { 819 Enumeration revisionNumberEnum = 820 revisionDescriptors.enumerateRevisionNumbers(); 821 if (revisionNumberEnum != null) { 822 while (revisionNumberEnum.hasMoreElements()) { 823 contentHelper.remove 824 (token, currentObject.getUri(), 825 (NodeRevisionNumber)revisionNumberEnum.nextElement()); 826 } 827 } 828 removeHiddenRevisions( token, targetUri ); 829 830 contentHelper.remove(token, revisionDescriptors); 832 } 833 } 834 835 structureHelper.remove(token, currentObject); 837 838 if (deleteListener != null) { 840 deleteListener.afterDelete(targetUri); 841 } 842 843 } catch (ObjectHasChildrenException ex) { 844 } catch (SlideException ex) { 849 e.addException(ex); 850 } 851 852 } 853 854 858 private void removeHiddenRevisions( SlideToken token, String targetUri ) throws ServiceAccessException, ObjectNotFoundException, LinkedObjectNotFoundException, AccessDeniedException, ObjectLockedException, VetoException { 859 860 865 try { 866 contentHelper.remove(token, targetUri, NodeRevisionNumber.HIDDEN_0_0 ); 867 } 868 catch (RevisionDescriptorNotFoundException ne) { 869 } 871 } 872 873 877 private static class UriHandler { 878 879 880 String [] tokens = null; 881 final String uriDelimiter = "/"; 882 883 886 UriHandler( String uri ) { 887 StringTokenizer ut = new StringTokenizer ( uri, uriDelimiter ); 888 int ntok = ut.countTokens(); 889 this.tokens = new String [ntok]; 890 for( int i = 0; i < ntok; i++ ) 891 tokens[i] = ut.nextToken(); 892 } 893 894 897 UriHandler( String [] toks ) { 898 this.tokens = new String [toks.length]; 899 for( int i = 0; i < toks.length; i++ ) 900 tokens[i] = toks[i]; 901 } 902 903 907 UriHandler( String [] toks, int number ) { 908 this.tokens = new String [number]; 909 for( int i = 0; i < number; i++ ) 910 tokens[i] = toks[i]; 911 } 912 913 916 boolean isRoot() { 917 return (tokens.length == 0); 918 } 919 920 924 UriHandler getParent() { 925 if( isRoot() ) 926 return null; 927 return new UriHandler( tokens, tokens.length - 1 ); 928 } 929 930 933 boolean isParentOf( UriHandler uh ) { 934 return equals( uh.getParent() ); 935 } 936 937 940 String getLastSegment() { 941 return tokens[tokens.length - 1]; 942 } 943 944 947 public boolean equals( Object o ) { 948 if( o instanceof UriHandler ) { 949 UriHandler ouh = (UriHandler)o; 950 return Arrays.equals( tokens, ouh.tokens ); 951 } 952 return false; 953 } 954 955 958 public int hashCode() { 959 return tokens.length; 960 } 961 962 965 public String toString() { 966 StringBuffer b = new StringBuffer (); 967 if( tokens.length == 0 ) 968 b.append( uriDelimiter ); 969 for( int i = 0; i < tokens.length; i++ ) 970 b.append( uriDelimiter ).append( tokens[i] ); 971 return b.toString(); 972 } 973 } 974 975 private boolean sameStore(SlideToken token, String leftUri, String rightUri) { 976 Store leftStore = namespace.getUri(token, leftUri).getStore(); 977 Store rightStore = namespace.getUri(token, rightUri).getStore(); 978 if (leftStore == null || rightStore == null) { 979 throw new IllegalStateException ("Got null store: leftStore="+leftStore+", rightStore="+rightStore); 980 } 981 return leftStore == rightStore; 982 } 983 984 private boolean isLockNull( SlideToken slideToken, String uriStr ) throws ServiceAccessException { 985 boolean isLockNull = false; 986 try { 987 NodeRevisionDescriptor nrd = 988 contentHelper.retrieve(slideToken, contentHelper.retrieve(slideToken, uriStr)); 989 isLockNull = isLockNull( nrd ); 990 } 991 catch (ServiceAccessException x) { 992 throw x; 993 } 994 catch (SlideException x) { 995 } 997 return isLockNull; 998 } 999 1000 private boolean isLockNull( NodeRevisionDescriptor nrd ) { 1001 return nrd.propertyValueContains("resourcetype", "lock-null"); 1002 } 1003} 1004 1005 1006 1007 | Popular Tags |