1 16 package org.outerj.daisy.repository; 17 18 import org.outerx.daisy.x10.DocumentDocument; 19 20 import java.util.Map ; 21 import java.util.Date ; 22 23 41 public interface Document { 42 46 public long getId(); 47 48 public long getBranchId(); 49 50 public long getLanguageId(); 51 52 public VariantKey getVariantKey(); 53 54 58 public boolean isVariantNew(); 59 60 66 public AvailableVariants getAvailableVariants() throws RepositoryException; 67 68 74 public long getDocumentTypeId(); 75 76 87 public void changeDocumentType(long documentTypeId) throws RepositoryException; 88 89 92 public void changeDocumentType(String documentTypeName) throws RepositoryException; 93 94 99 public String getName(); 100 101 108 public void setName(String name); 109 110 116 public long getOwner(); 117 118 124 public void setOwner(long userId); 125 126 133 public boolean isPrivate(); 134 135 141 public void setPrivate(boolean _private); 142 143 148 public Date getCreated(); 149 150 157 public boolean isRetired(); 158 159 164 public void setRetired(boolean retired); 165 166 172 public Date getLastModified(); 173 174 180 public long getLastModifier(); 181 182 188 public Date getVariantLastModified(); 189 190 196 public long getVariantLastModifier(); 197 198 208 public Versions getVersions() throws RepositoryException; 209 210 219 public Version getVersion(long id) throws RepositoryException; 220 221 227 public long getLastVersionId(); 228 229 235 public Version getLastVersion() throws RepositoryException; 236 237 243 public Version getLiveVersion() throws RepositoryException; 244 245 250 public long getLiveVersionId(); 251 252 255 public boolean canReadLiveOnly(); 256 257 269 public void setField(String name, Object value) throws DocumentTypeInconsistencyException; 270 271 276 public void setField(long fieldTypeId, Object value) throws DocumentTypeInconsistencyException; 277 278 285 public void deleteField(String name); 286 287 292 public void deleteField(long fieldTypeId); 293 294 301 public Field getField(String fieldTypeName) throws FieldNotFoundException; 302 303 308 public Field getField(long fieldTypeId) throws FieldNotFoundException; 309 310 315 public boolean hasField(long fieldTypeId); 316 317 322 public boolean hasField(String fieldTypeName); 323 324 329 public Fields getFields(); 330 331 338 public Fields getFieldsInOrder(); 339 340 341 346 public void save() throws RepositoryException; 347 348 387 public void save(boolean validate) throws RepositoryException; 388 389 392 public void validate() throws DocumentTypeInconsistencyException; 393 394 400 public void setNewVersionState(VersionState versionState); 401 402 405 public VersionState getNewVersionState(); 406 407 425 public boolean lock(long duration, LockType lockType) throws RepositoryException; 426 427 438 public boolean releaseLock() throws RepositoryException; 439 440 449 public LockInfo getLockInfo(boolean fresh) throws RepositoryException; 450 451 457 public void setCustomField(String name, String value); 458 459 465 public void deleteCustomField(String name); 466 467 473 public String getCustomField(String name); 474 475 480 public boolean hasCustomField(String name); 481 482 487 public void clearCustomFields(); 488 489 495 public Map getCustomFields(); 496 497 502 public void setPart(String partTypeName, String mimeType, byte[] data) throws DocumentTypeInconsistencyException; 503 504 509 public void setPart(long partTypeId, String mimeType, byte[] data) throws DocumentTypeInconsistencyException; 510 511 516 public void setPart(String partTypeName, String mimeType, PartDataSource partDataSource) throws DocumentTypeInconsistencyException; 517 518 523 public void setPart(long partTypeId, String mimeType, PartDataSource partDataSource) throws DocumentTypeInconsistencyException; 524 525 533 public void setPartFileName(String partTypeName, String fileName); 534 535 543 public void setPartFileName(long partTypeId, String fileName); 544 545 551 public void setPartMimeType(String partTypeName, String mimeType); 552 553 559 public void setPartMimeType(long partTypeId, String mimeType); 560 561 566 public void deletePart(long partTypeId); 567 568 573 public void deletePart(String name); 574 575 580 public Part getPart(long partTypeId) throws PartNotFoundException; 581 582 587 public Part getPart(String name) throws PartNotFoundException; 588 589 594 public boolean hasPart(long partTypeId); 595 596 601 public boolean hasPart(String name); 602 603 606 public Parts getParts(); 607 608 public Parts getPartsInOrder(); 609 610 615 public void addLink(String title, String target); 616 617 622 public void deleteLink(int index); 623 624 629 public void clearLinks(); 630 631 636 public Links getLinks(); 637 638 643 public void addToCollection(DocumentCollection collection); 644 645 650 public void removeFromCollection(DocumentCollection collection); 651 652 656 public DocumentCollections getCollections(); 657 658 661 public boolean inCollection(DocumentCollection collection); 662 663 666 public boolean inCollection(long collectionId); 667 668 public DocumentDocument getXml() throws RepositoryException; 669 670 public DocumentDocument getXmlWithoutVariant() throws RepositoryException; 671 672 public DocumentDocument getXmlWithoutVersionedData() throws RepositoryException; 673 674 681 public DocumentDocument getXml(long versionId) throws RepositoryException; 682 683 686 public void clearCollections(); 687 688 693 public String getSummary(); 694 695 700 public long getVariantCreatedFromBranchId(); 701 702 705 public long getVariantCreatedFromLanguageId(); 706 707 710 public long getVariantCreatedFromVersionId(); 711 712 public long getUpdateCount(); 713 714 public long getVariantUpdateCount(); 715 } 716 | Popular Tags |