mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
43628: Fix for ALF-16299 - On full user profile, in the 'Sites' tab, the site descriptions are not aligned when a long site description is provided. 43639: ALF-16701: use newly released Spring Surf 1.2.0-M1 rather than a SNAPSHOT 43644: ALF-16527: webscript person.lib.ftl does not include all attributes for users out of the box. - added missing organizationId attribute. 43649: ALF-16756: WebDAV: An error occurs on drag&drop content from local machine to alfresco when inbound move rule configured. 43651: ALF-16756: Fixed typos - I took this code in good faith! 43659: ALF-16006: MT: Document Library is absent after upgrade from 3.4.x to 4.1.x (eg. 3.4.10 -> 4.1.1) - More patch dependencies required 43666: ALF-16833 / MNT-187: Fixed regression in inbound rule firing caused by the fix to ALF-14744 - Inbound rules were not firing for newly created content nodes that had null content properties (e.g. dataListItems) - Now the ALF-14744 fix has been revised so that inbound rules are only not fired for new nodes with zero-length content, as possibly created by the OSX / Windows 7 WebDAV clients during an upload, and only if policy.content.update.ignoreEmpty=true (the default) - OnContentUpdateRuleTrigger removed. Now all content property updates are handled by OnPropertyUpdateRuleTrigger so that we can have this subtle treatment of 'empty' content properties. - Reverted ALF-14744 changes to RuleServiceCoverageTest and added new tests for 'empty' content and ASPECT_NO_CONTENT - Updated RuleTriggerTest in line with changes 43675: Merged V4.1 to V4.1-BUG-FIX 43674: Merged PATCHES/V4.1.1 to V4.1 43673: Merged V3.4-BUG-FIX to PATCHES/V4.1.1 43672: ALF-16834, ALF-16833, MNT-187: Fix unit test failures and 'fine tune' logic to handle multiple updates within a single transaction creating a node 43676: ALF-12324: Can't delete site with WQS content - Don't try to add nodes to the publish queue on site deletion 43689: Fix for ALF-14207 - cm:link not correctly handled in Share's doclist when users don't have permission 43690: Fix for ALF-16538 - Wrong label on change group permission message 43696: ALF-16348 (Inconsistent error message when latest manager leaves a site) 43719: ALF-16031: "CMISChangeLog does not log Created events" 43720: ALF-14137: "When calling CMIS getAllVersions method using the OpenCMIS Browser the PreparedStatement is executed multiple times" 43722: ALF-16352: Re-instated manage permissions action to document list view 43745: Fix for ALF-15351. ContentModelFormProcessor had a TODO to handle associations defined on aspects other than those aspects already on the node for which a form is being submitted. I've added code that, when an association is added to a node, will check if the association is defined on any aspect in the system and if it is, it will let the association be created. 43757: ALF-16171: If a password for admin user is specified with a space in the end during the installation Alfresco startup fails - Added validation that will not allow the specified password to contain leading to trailing white space 43760: Fixed ALF-16317 "Labels not displaying full text when creating a rule on a folder with IE8" part 2 43769: Fix for ALF-13461. Merged PATCHES/V3.4.8 to BRANCHES/DEV/V4.1-BUG-FIX: 43344: MNT-162: Merged DEV to PATCHES/V3.4.8 43254: MNT-162: CLONE - Hidden folder "Comments" is available to searching - Removed last '/' from COMMENT_QNAMEPATH constant. 43770: ALF-15616: Merged V3.4-BUG-FIX (3.4.12) to V4.1-BUG-FIX (4.1.3) 43768: Merged Dev to V3.4-BUG-FIX (3.4.12) 43743: ALF-11956: WCM accessibility The problem with absence of initial focus on the first Web form element has been resolved in 'alfresco.xforms.XForm._loadHandler()'. This method creates all controls, defined in the form. 'alfresco.xforms.FocusResolver._findControl()' has been renamed to a public-like method ('alfresco.xforms.FocusResolver.findControl()'). Also it has been modified to introduce a possibility of searching elements, using root XForms widgets container. Some other minor fixes. 43772: Fixed ALF-16497 "Selected Items drop down box is expanded to the right in IE9" 43787: Merged in Philippe's fix for ALF-16313:unmakeTranslation() called on pivot language gives exception 43794: ALF-16155: "Notification digest accumulates and is repeatedly sent if 1 or more notification email fails" 43805: ALF-16212: Fixes double encoding issue. 43835: Fixed ALF-13595: Patches third party library date.js to prevent infinite loop. 43836: ALF-16480: Merged PATCHES/V4.1.1 to V4.1-BUG-FIX 43252: MNT-166: Document lock not removed after the lock expiry date has been reached - Changed evaluator "evaluator.doclib.metadata.isLocked" to use "evaluator.doclib.indicator.nodeLocked" and "evaluator.doclib.indicator.lockOwner" evaluator. 43253: MNT-165: "Cancel Editing" does not completely remove lock from document - Added documentLibrary cancel editing action for locked documents. 43300: MNT-171: Merged V4.1-BUG-FIX to PATCHES/V4.1.1 (modified) 43096: Fix for ALF-16283 - When document is checked out, 'Edit Online' and 'Upload New Version' options should not be visible on the original document. 43311: MNT-165: "Cancel Editing" does not completely remove lock from document - Fix for page refresh problem when cancel editing on details page 43421: MNT-186: 4.1.1.7 HF: Webscipt error on doclib page, containing locked by other users files - Change evaluator.doclib.metadata.isLocked to break circular dependency 43755: MNT-202: Upload New Version not available for a document that has been edited offline - Upload New Version is now available if editable by user (respecting locks, type of checkout, etc). 43844: ALF-16696: Merged DEV to V4.1-BUG-FIX 43734: Share nodebrowser is unable to access node of a document with MS residual properties - Use localname if no prefix is registered for a namespace uri 43864: Fixed ALF-16320 "Properties side panel collapses after editing properties in document preview window with IE8" 43866: Fixed ALF-16320 "Properties side panel collapses after editing properties in document preview window with IE8" part 2 - Checking using YAHOO.util.Event.getTarget instead 43867: Fixed ALF-16276 "'"Web View' dahslet displays 2 scrollbars in IE8." 43872: Merged V4.1 to V4.1-BUG-FIX 43622: ALF-16757: Sharepoint doesn't work correct with SSO - Fix by Pavel 43633: Latest translations from Gloria (r43623) 43636: Merged PATCHES/V4.1.1 to V4.1 43301: ALF-16811 / MNT-173: SOLR tracking spending too long evaluating paths - Too much time was being spent fetching the individual nodes in each path and there could be potentially thousands - Now we traverse all the ancestor parent associations in the cache before switching shared cache reads off, then bulk load them in one shot! 43303: ALF-16812 / MNT-174: "dictionaryDAO.init() called, yet no namespace registry for domain" after node rejoins cluster - namespaceRegistryCache is secondary to the clustered dictionaryRegistryCache, so can be a non-clustered cache. Synchronization and thread locals already in use so still thread safe. - dictionaryDAO.init() now has sole responsibility of establishing the NamespaceRegistry threadlocal within its locks, so no more risk of cyclic dependencies, race conditions, partial initialization, or registries dropping out of the cache - To avoid being confused by the 'consistent read' behaviour of a transactional cache, DictionaryDAOImpl now reads / writes directly to a shared cache. Again locks and thread locals still used so still thread safe 43334: ALF-16812 / MNT-174: Fixed failing unit tests - Because DictionaryDAOImpl now reads directly from the shared cache we need to reset it on initialization to avoid problems in multi-context unit tests 43337: ALF-16811 / MNT-173: Fix test failure. Cope with IDs of deleted nodes in getCachedAncestors() 43356: ALF-16811 / MNT-173: If we are disabling shared cache reads for the transaction, convert all existing reads and updates to avoid 'consistent read' behaviour giving us a potentially out of date node already accessed - Existing read buckets are simply thrown away - Updates are converted to removes to avoid any assumptions about existing shared cache content - New entries are left alone as they haven't come from the shared cache anyway 43410: ALF-16813 / MNT-185: Web Scripts are being endlessly re-registering in clustered environment - Due to 'consistent read' behaviour of transactional cache - As accesses are regulated by RW locks we can read straight through to the shared cache instead 43565: ALF-16814 / MNT-190: Bmlab Solr Node 2 threw unhandled NullPointerException (and possibly made solr unresponsive) - Added missing return statement 43646: ALF-15755: Rationalization of WebDAVMethod.checkNode() 43681: Merged HEAD to V4.1 43656: Fix for ALF-16683 CMIS: cannot navigate to original document was created through CMIS with CHECKED OUT version state. 43698: Latest Russian translations from Gloria 43838: ALF-16875: Merged V4.1-BUG-FIX to V4.1 43836: ALF-16480: Merged PATCHES/V4.1.1 to V4.1-BUG-FIX 43252: MNT-166: Document lock not removed after the lock expiry date has been reached - Changed evaluator "evaluator.doclib.metadata.isLocked" to use "evaluator.doclib.indicator.nodeLocked" and "evaluator.doclib.indicator.lockOwner" evaluator. 43253: MNT-165: "Cancel Editing" does not completely remove lock from document - Added documentLibrary cancel editing action for locked documents. 43300: MNT-171: Merged V4.1-BUG-FIX to PATCHES/V4.1.1 (modified) 43096: Fix for ALF-16283 - When document is checked out, 'Edit Online' and 'Upload New Version' options should not be visible on the original document. 43311: MNT-165: "Cancel Editing" does not completely remove lock from document - Fix for page refresh problem when cancel editing on details page 43421: MNT-186: 4.1.1.7 HF: Webscipt error on doclib page, containing locked by other users files - Change evaluator.doclib.metadata.isLocked to break circular dependency 43755: ALF-16890 / MNT-202: Upload New Version not available for a document that has been edited offline - Upload New Version is now available if editable by user (respecting locks, type of checkout, etc). 43868: Reverse merging r43838 - Merge in wrong direction introducing duplicate fragment into share-documentlibrary-config.xml 43871: ALF-16890: Merged PATCHES/V4.1.1 to V4.1 43755: MNT-202: Upload New Version not available for a document that has been edited offline - Upload New Version is now available if editable by user (respecting locks, type of checkout, etc). 43873: Merged V4.1 to V4.1-BUG-FIX (RECORD ONLY) 43602: ALF-16254: Merged V4.1-BUG-FIX to V4.1 43598: Merged HEAD to BRANCHES/DEV/V4.1-BUG-FIX 41906: ALF-11378: REST API has been modified to return extra information about a user whether s/he belongs to a group or not. 43612: ALF-16598: Merged V4.1-BUG-FIX to V4.1 43252: MNT-166: Document lock not removed after the lock expiry date has been reached - Changed evaluator "evaluator.doclib.metadata.isLocked" to use "evaluator.doclib.indicator.nodeLocked" and "evaluator.doclib.indicator.lockOwner" evaluator. 43254: MNT-165: "Cancel Editing" does not completely remove lock from document - Added documentLibrary cancel editing action for locked documents. 43300: MNT-171: Merged V4.1-BUG-FIX to PATCHES/V4.1.1 (modified) 43096: Fix for ALF-16283 - When document is checked out, 'Edit Online' and 'Upload New Version' options should not be visible on the original document. 43311: MNT-165: "Cancel Editing" does not completely remove lock from document - Fix for page refresh problem when cancel editing on details page 43421: MNT-186: 4.1.1.7 HF: Webscipt error on doclib page, containing locked by other users files - Change evaluator.doclib.metadata.isLocked to break circular dependency 43615: ALF-16794: Merged V4.1-BUG-FIX to V4.1 43478: MNT-181: Now WebDAV will ALWAYS preserve the original metadata and versions of ANY node that is temporarily 'moved out' in ANY kind of 'shuffle' operation - To make the source node temporarily invisible to WebDAV the client specific HIDDEN aspect features are used - WebDAVHelper.isRenameShuffle() method introduced, to parallel ALF-3856 CIFS fix and using similar system.webdav.renameShufflePattern global property to detect the start of a shuffle - WebDAVHelper converted to use proper dependency injection - CopyMethod has become a simple subclass of MoveMethod as all the hidden aspect munging is done by it - DeleteMethod now preserves hidden nodes - PropFindMethod now ignores hidden nodes - Listing methods will hide hidden nodes from WebDAV 43483: MNT-181: Corrected typo 43523: MNT-181: Corrections - WebDAVLockService.unlock() made 'harmless' to call on already-unlocked nodes - Delete method hides rather than deletes versioned nodes and working copes in case it is called by OSX Finder during a 'replace' operation 43524: MNT-181: Correction - PutMethod now 'unhides' hidden nodes and behaves as though it created them 43570: MNT-181: More corrections researched by Valery - Don't treat all moves to temporary locations as copies - just those from non-temporary locations. Avoids initial upload leaving lots of hidden files around. - Only copy the content, not the whole node including aspects to avoid versioning temporary files! - Don't version on changes to sys:clientVisibilityMask - avoids 'double versioning' - Recognize Mac .TemporaryItems folder and ._ files as temporary 43586: MNT-181: Final correction researched by Valery - Corrected system.webdav.renameShufflePattern so that it matches .TemporaryItems folder and ._ files as a full match 43616: ALF-15755: Merged V4.1-BUG-FIX to V4.1 43591: ALF-16772: If the WebDAV path of a document exceeds 255 characters, documents opened in MSOffice cannot be saved back - Interpret null nodeLockToken as not locked. 43629: Merged V4.1-BUG-FIX to V4.1 (4.1.2) 43498: Fix for ALF-16648 - Alfresco Enterprise artifacts in artifacts.alfresco.com do not provide POM files / dependencies declarations: Merged HEAD to V4.1-BUG-FIX (4.1.2) 43380: -- added site content for alfresco-platform-distribution POM 43379: -- added site documentation for alfresco-platform-distribution POM 43378: -- added site documentation for alfresco-platform-distribution POM -- deployed site for 4.2.b Community at https://artifacts.alfresco.com/nexus/content/repositories/alfresco-docs/alfresco-platform-distribution/latest/index.html -- created repository for Enterprise docs and added url in the appropriate edition properties 43273: Use property to define POI version 42966: ALF-14353 - Added platform distribution POM to standard maven-deploy procedure 42965: ALF-14353 - added alfresco-platform-distribution to provide a Maven release descriptor (dependencyManagement) per each Community / Enterprise release -- moved maven-ant-tasks not to be in the runtime lib -- added platform distribution pom in the SDK folder -- updated maven.xml to deploy filter and deploy the appropriate platform-distribution POM per each releae -- in maven.xml moved configure-release and configure-snapshot goals to maven-env-prerequisites -- updated sdk readme to explain the presence of alfresco-platform-distribution POM 42912: -- updated README header on the POM specifying it's NOT usable to build Alfresco -- make a clear reference to the POMs that get deployed by pom-experimental.xml being usable for development 42842: ALF-14353: Fix artifactId alfresco-jlan -> alfresco-jlan-embed 41883: ALF-14353 - fixed multiple Maven build issues. Now mvn clean install -f pom-experimental.xml works fine. Also deployed Spring Surf 1.2.0-SNAPSHOT so proper Surf version is retrieved 41882: added pre-requisites to build POMs successfully with mvn clean install -f pom-experimental.xml 43634: Merged V4.1-BUG-FIX to V4.1 43386: ALF-13091: Prevent bean post processor propagation to child application contexts. Remove Jsr250BeanPostPorcessor from the CXF configuration, to prevent strange interaction with component scanning. 43641: Merged V4.1-BUG-FIX to V4.1 (4.1.2) 43639: ALF-16701: use newly released Spring Surf 1.2.0-M1 in POM files rather than a SNAPSHOT 43645: Merged V4.1-BUG-FIX to V4.1 43644: ALF-16527: webscript person.lib.ftl does not include all attributes for users out of the box. - added missing organizationId attribute. 43660: Merged V4.1-BUG-FIX to V4.1 43659: ALF-16006: MT: Document Library is absent after upgrade from 3.4.x to 4.1.x (eg. 3.4.10 -> 4.1.1) - More patch dependencies required 43669: Merged V4.1-BUG-FIX to V4.1 43666: ALF-16833 / MNT-187: Fixed regression in inbound rule firing caused by the fix to ALF-14744 - Inbound rules were not firing for newly created content nodes that had null content properties (e.g. dataListItems) - Now the ALF-14744 fix has been revised so that inbound rules are only not fired for new nodes with zero-length content, as possibly created by the OSX / Windows 7 WebDAV clients during an upload, and only if policy.content.update.ignoreEmpty=true (the default) - OnContentUpdateRuleTrigger removed. Now all content property updates are handled by OnPropertyUpdateRuleTrigger so that we can have this subtle treatment of 'empty' content properties. - Reverted ALF-14744 changes to RuleServiceCoverageTest and added new tests for 'empty' content and ASPECT_NO_CONTENT - Updated RuleTriggerTest in line with changes 43697: Merged V4.1-BUG-FIX to V4.1 43689: Fix for ALF-14207 - cm:link not correctly handled in Share's doclist when users don't have permission 43761: Merged V4.1-BUG-FIX to V4.1 43760: Fixed ALF-16317 "Labels not displaying full text when creating a rule on a folder with IE8" part 2 43796: Merged V4.1-BUG-FIX to V4.1 43795: Fix for ALF-16254 - "Leave Site" behaviour for group based site membership: Blah, Blah, Blah! 43883: Fix for ALF-12711. Separated preparation of email message from sending of email message as described in analysis in JIRA. Did not merge the fix provided as MailActionExecuter.java.diff but reimplemented a fix based on that. 43888: ALF-16781: Merged V3.4-BUG-FIX (3.4.12) to V4.1-BUG-FIX (4.1.3) 43887: ALF-16898 CLONE - Transformation Server history shows incorrect transformation "To" type for images - ImageTransformActionExecuter ("Transform and Copy Image") re-factored to use ContentService rather than hard coded to ImageMagick 43900: Merged V4.1 to V4.1-BUG-FIX 43898: Merged PATCHES/V4.1.1 to V4.1 43708: ALF-16903 / MNT-203: ACL changes not propagated between two non clustered Alfresco instances hitting same Solr and Database - Although SOLRTrackingComponentImpl was not trusting the cache when tracking node transactions, it was still trusting the cache for ACL change sets - This mean that when the SOLR node is using an Alfresco out of the cluster (which we are supposed to support) it could see stale ACLs - Fixed this by using the same strategy we use in AbstractNodeDAO - Now the main acl CRUD cache is set to ignore the shared cache during SOLR tracking - All secondary ACL caches are keyed by ACL ID AND version, so it prevents the possibility of retrieving a stale cached ACL for an old version 43713: ALF-16903 / MNT-203: ACL changes not propagated between two non clustered Alfresco instances hitting same Solr and Database - Fix test failures - deleteAccessControlEntries must 'touch' all the ACLs it affects to keep caches valid - createAccessControlList should return the newly-versioned ACL 43736: ALF-16904 / MNT-204: Index showing no progress on Solr server - SAP's tracking thread got stuck indefinitely waiting on a content response after sending a request, probably due to some misbehaving proxy or balancer - Now we make it possible to recover from this - A new alfresco.socketTimeout parameter is now supported in solrcore.properties - It specifies the number of milliseconds SOLR will wait before giving up waiting for data on an HTTP connection - The default is still zero which means wait indefinitely 43759: ALF-16904 / MNT-204: Fixed compilation error 43899: Merged PATCHES/V4.1.1 to V4.1 (RECORD ONLY) 43667: Merged V4.1-BUG-FIX to PATCHES/V4.1.1 43666: ALF-16833 / MNT-187: Fixed regression in inbound rule firing caused by the fix to ALF-14744 - Inbound rules were not firing for newly created content nodes that had null content properties (e.g. dataListItems) - Now the ALF-14744 fix has been revised so that inbound rules are only not fired for new nodes with zero-length content, as possibly created by the OSX / Windows 7 WebDAV clients during an upload, and only if policy.content.update.ignoreEmpty=true (the default) - OnContentUpdateRuleTrigger removed. Now all content property updates are handled by OnPropertyUpdateRuleTrigger so that we can have this subtle treatment of 'empty' content properties. - Reverted ALF-14744 changes to RuleServiceCoverageTest and added new tests for 'empty' content and ASPECT_NO_CONTENT - Updated RuleTriggerTest in line with changes 43901: Merged V3.4-BUG-FIX to V4.1-BUG-FIX 43571: Merged DEV to V3.4-BUG-FIX 43569: ALF-16222: It's impossible to delete a file/message via IMAP using Microsoft Entourage 2008 in MacOSX 10.8 fixed: UID failed.Existing file or folder error on attempt to delete file if deleted items already contains file with the same name. modified: AttachmentExtractor modified to avoid code dublication. 43599: Fix for ALF-16505 - Discussion topics are sorted in ascending order (oldest first and newest last) when selecting 'All topics' 43610: Merged Dev to V3.4-BUGFIX (3.4.12) 43416: ALF-16470: SPP:Meeting recurent events are displayed incorrect in share calendar in all tabs (Day, Week, Month) Incorrect lucene query to search for events (it was search for events ONLY after fromDate, that gets from browser query. And recursive events, that have startDate before browser's query date, wasn't included into summary query for search for events. Start date is incorrect and is sets two times. Interval for month of end date is to small. Recursive event, that was started in previous month, and ends in current month, isn't included into result of search. For events, that ends on next date after start date, displays (view by month) only start date. 43625: ALF-11817: Cope with incomplete lock token headers from Microsoft-WebDAV-MiniRedir without the enclosing <> by just consuming the whole string 43670: ALF-11817: Prevent auto-hidden dot underscore files from reappearing on a put by checking for a shuffle path before 'unhiding' 43746: Merged DEV to V3.4-BUG-FIX (with corrections) 43692: ALF-16808 Webdav: Two versions of document have been added after the document has been rewritten once more via drag and drop action. 1. Checked whether the current content property is empty. 2. Disabled the versionable aspect. 3. Added the new content to the node. 43763: Fix for ALF-14828 - Incorrect behavior on delete action (WCMQS site) 43771: Fix for ALF-12752 - Custom form appearance parameters not accounted for causing ovverlapped textareas xforms changing their height 43773: Merged DEV to V3.4-BUG-FIX (3.4.12) 42010: ALF-14040: Event start/end time displays incorrect on MS Outlook Calendar and Calendar of created Meeting workspace 1) Send a date for "Site Calendar" dashlet in ISO-8601 format (like in v4.1.1), then after transformation to client's time zone it is displayed correct 2) For "My Calendar" dashlet we need to take into account that if the event is "all day event", then date should be used without time zone transformation 43804: ALF-12326 HomeFolderProviderSynchronizer fails to move any user space which has a rule configured on it 43837: Fixes ALF-12145: Date.js patches merged to 3.4 Merged BRANCHES/DEV/V4.0-BUG-FIX to BRANCHES/DEV/V3.4-BUG-FIX: 36202: ALF-13483: Japanese: Incorrect date handle in a date Input filed Merged BRANCHES/DEV/V4.1-BUG-FIX to BRANCHES/DEV/V3.4-BUG-FIX: 43835: Fixed ALF-13595: Patches third party library date.js to prevent infinite loop. 43839: ALF-16869: Merged PATCHES/V3.4.8 to V3.4-BUG-FIX 43344: MNT-162: Merged DEV to PATCHES/V3.4.8 43254: MNT-162: CLONE - Hidden folder "Comments" is available to searching - Removed last '/' from COMMENT_QNAMEPATH constant. 43902: Merged V3.4-BUG-FIX to V4.1-BUG-FIX (RECORD ONLY) 43177: Merged DEV to V3.4-BUG-FIX 43087: ALF-16474: Records Management groups were not deleted after removing RM site - Delete Records Management groups on ASPECT_RECORDS_MANAGEMENT_ROOT delete - Backport of RM-190 from RM 2.0 43228: ALF-16266: Merged HEAD to V3.4-BUG-FIX 32846: Fixes: ALF-10519: Issues with translation of roles. 31413: Fixes: ALF-10519 - Internationalises the role names for the repo browser's manage permissions page & makes these available to other pages through common.properties 43229: ALF-16266: Fix conflict data left in the properties file. 43624: ALF-11817: Merged PATCHES/V4.0.2 to V3.4-BUG-FIX 43587: Merged BRANCHES/V4.1-BUG-FIX to PATCHES/V4.0.2 42363: ALF-16213: renaming versioned file results in file being deleted. 43478: MNT-181: Now WebDAV will ALWAYS preserve the original metadata and versions of ANY node that is temporarily 'moved out' in ANY kind of 'shuffle' operation - To make the source node temporarily invisible to WebDAV the client specific HIDDEN aspect features are used - WebDAVHelper.isRenameShuffle() method introduced, to parallel ALF-3856 CIFS fix and using similar system.webdav.renameShufflePattern global property to detect the start of a shuffle - WebDAVHelper converted to use proper dependency injection - CopyMethod has become a simple subclass of MoveMethod as all the hidden aspect munging is done by it - DeleteMethod now preserves hidden nodes - PropFindMethod now ignores hidden nodes - Listing methods will hide hidden nodes from WebDAV 43483: MNT-181: Corrected typo 43523: MNT-181: Corrections - WebDAVLockService.unlock() made 'harmless' to call on already-unlocked nodes - Delete method hides rather than deletes versioned nodes and working copies in case it is called by OSX Finder during a 'replace' operation 43524: MNT-181: Correction - PutMethod now 'unhides' hidden nodes and behaves as though it created them 43570: MNT-181: More corrections researched by Valery - Don't treat all moves to temporary locations as copies - just those from non-temporary locations. Avoids initial upload leaving lots of hidden files around. - Only copy the content, not the whole node including aspects to avoid versioning temporary files! - Don't version on changes to sys:clientVisibilityMask - avoids 'double versioning' - Recognize Mac .TemporaryItems folder and ._ files as temporary 43586: MNT-181: Final correction researched by Valery - Corrected system.webdav.renameShufflePattern so that it matches .TemporaryItems folder and ._ files as a full match 43671: ALF-16834: Merged V4.1-BUG-FIX to V3.4-BUG-FIX 43666: ALF-16833 / MNT-187: Fixed regression in inbound rule firing caused by the fix to ALF-14744 - Inbound rules were not firing for newly created content nodes that had null content properties (e.g. dataListItems) - Now the ALF-14744 fix has been revised so that inbound rules are only not fired for new nodes with zero-length content, as possibly created by the OSX / Windows 7 WebDAV clients during an upload, and only if policy.content.update.ignoreEmpty=true (the default) - OnContentUpdateRuleTrigger removed. Now all content property updates are handled by OnPropertyUpdateRuleTrigger so that we can have this subtle treatment of 'empty' content properties. - Reverted ALF-14744 changes to RuleServiceCoverageTest and added new tests for 'empty' content and ASPECT_NO_CONTENT - Updated RuleTriggerTest in line with changes 43842: Merged V4.0-BUG-FIX to V3.4-BUG-FIX 33387: ALF-12492 - Email with empty subject sent to Alfresco by SMTP cause Null pointer Exception 43843: ALF-16717: Merged V4.1-BUG-FIX to V3.4-BUG-FIX 43314: ALF-16575 - Email server does not accept email where Subject ends with a period git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@43914 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
1122 lines
32 KiB
Java
1122 lines
32 KiB
Java
package org.alfresco.slingshot.web.scripts;
|
|
|
|
import java.io.IOException;
|
|
import java.io.Serializable;
|
|
import java.util.ArrayList;
|
|
import java.util.Collection;
|
|
import java.util.Collections;
|
|
import java.util.HashMap;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Set;
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
import org.alfresco.repo.domain.PropertyValue;
|
|
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
|
import org.alfresco.service.cmr.avm.AVMService;
|
|
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
|
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
|
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
|
|
import org.alfresco.service.cmr.repository.AssociationRef;
|
|
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
|
import org.alfresco.service.cmr.repository.NodeRef;
|
|
import org.alfresco.service.cmr.repository.NodeService;
|
|
import org.alfresco.service.cmr.repository.Path;
|
|
import org.alfresco.service.cmr.repository.StoreRef;
|
|
import org.alfresco.service.cmr.search.SearchService;
|
|
import org.alfresco.service.cmr.security.AccessPermission;
|
|
import org.alfresco.service.cmr.security.AccessStatus;
|
|
import org.alfresco.service.cmr.security.OwnableService;
|
|
import org.alfresco.service.cmr.security.PermissionService;
|
|
import org.alfresco.service.namespace.NamespaceException;
|
|
import org.alfresco.service.namespace.NamespaceService;
|
|
import org.alfresco.service.namespace.QName;
|
|
import org.alfresco.service.namespace.RegexQNamePattern;
|
|
import org.alfresco.service.transaction.TransactionService;
|
|
import org.alfresco.util.ISO9075;
|
|
import org.springframework.extensions.webscripts.Cache;
|
|
import org.springframework.extensions.webscripts.DeclarativeWebScript;
|
|
import org.springframework.extensions.webscripts.Status;
|
|
import org.springframework.extensions.webscripts.WebScriptException;
|
|
import org.springframework.extensions.webscripts.WebScriptRequest;
|
|
|
|
/**
|
|
* Node browser web script to handle search results, node details and workspaces
|
|
*
|
|
* @author dcaruana
|
|
* @author wabson
|
|
*/
|
|
public class NodeBrowserScript extends DeclarativeWebScript
|
|
{
|
|
/** available query languages */
|
|
private static List<String> queryLanguages = new ArrayList<String>();
|
|
static
|
|
{
|
|
queryLanguages.add("noderef");
|
|
queryLanguages.add(SearchService.LANGUAGE_XPATH);
|
|
queryLanguages.add(SearchService.LANGUAGE_LUCENE);
|
|
queryLanguages.add(SearchService.LANGUAGE_FTS_ALFRESCO);
|
|
queryLanguages.add(SearchService.LANGUAGE_CMIS_STRICT);
|
|
queryLanguages.add(SearchService.LANGUAGE_CMIS_ALFRESCO);
|
|
queryLanguages.add(SearchService.LANGUAGE_JCR_XPATH);
|
|
}
|
|
|
|
// stores and node
|
|
transient private List<StoreRef> stores = null;
|
|
|
|
// supporting repository services
|
|
transient private TransactionService transactionService;
|
|
transient private NodeService nodeService;
|
|
transient private DictionaryService dictionaryService;
|
|
transient private SearchService searchService;
|
|
transient private NamespaceService namespaceService;
|
|
transient private PermissionService permissionService;
|
|
transient private OwnableService ownableService;
|
|
transient private AVMService avmService;
|
|
|
|
/**
|
|
* @param transactionService transaction service
|
|
*/
|
|
public void setTransactionService(TransactionService transactionService)
|
|
{
|
|
this.transactionService = transactionService;
|
|
}
|
|
|
|
private TransactionService getTransactionService()
|
|
{
|
|
return transactionService;
|
|
}
|
|
|
|
/**
|
|
* @param nodeService node service
|
|
*/
|
|
public void setNodeService(NodeService nodeService)
|
|
{
|
|
this.nodeService = nodeService;
|
|
}
|
|
|
|
private NodeService getNodeService()
|
|
{
|
|
return nodeService;
|
|
}
|
|
|
|
/**
|
|
* @param searchService search service
|
|
*/
|
|
public void setSearchService(SearchService searchService)
|
|
{
|
|
this.searchService = searchService;
|
|
}
|
|
|
|
private SearchService getSearchService()
|
|
{
|
|
return searchService;
|
|
}
|
|
|
|
/**
|
|
* @param dictionaryService dictionary service
|
|
*/
|
|
public void setDictionaryService(DictionaryService dictionaryService)
|
|
{
|
|
this.dictionaryService = dictionaryService;
|
|
}
|
|
|
|
private DictionaryService getDictionaryService()
|
|
{
|
|
return dictionaryService;
|
|
}
|
|
|
|
/**
|
|
* @param namespaceService namespace service
|
|
*/
|
|
public void setNamespaceService(NamespaceService namespaceService)
|
|
{
|
|
this.namespaceService = namespaceService;
|
|
}
|
|
|
|
private NamespaceService getNamespaceService()
|
|
{
|
|
return namespaceService;
|
|
}
|
|
|
|
/**
|
|
* @param permissionService permission service
|
|
*/
|
|
public void setPermissionService(PermissionService permissionService)
|
|
{
|
|
this.permissionService = permissionService;
|
|
}
|
|
|
|
private PermissionService getPermissionService()
|
|
{
|
|
return permissionService;
|
|
}
|
|
|
|
public void setOwnableService(OwnableService ownableService)
|
|
{
|
|
this.ownableService = ownableService;
|
|
}
|
|
|
|
public OwnableService getOwnableService()
|
|
{
|
|
return ownableService;
|
|
}
|
|
|
|
/**
|
|
* @param avmService AVM service
|
|
*/
|
|
public void setAVMService(AVMService avmService)
|
|
{
|
|
this.avmService = avmService;
|
|
}
|
|
|
|
private AVMService getAVMService()
|
|
{
|
|
return avmService;
|
|
}
|
|
|
|
/**
|
|
* Gets the list of repository stores
|
|
*
|
|
* @return stores
|
|
*/
|
|
public List<StoreRef> getStores()
|
|
{
|
|
if (stores == null)
|
|
{
|
|
stores = getNodeService().getStores();
|
|
}
|
|
return stores;
|
|
}
|
|
|
|
/**
|
|
* Gets the current node type
|
|
*
|
|
* @return node type
|
|
*/
|
|
public QName getNodeType(NodeRef nodeRef)
|
|
{
|
|
return getNodeService().getType(nodeRef);
|
|
}
|
|
|
|
/**
|
|
* Gets the current node primary path
|
|
*
|
|
* @return primary path
|
|
*/
|
|
public String getPrimaryPath(NodeRef nodeRef)
|
|
{
|
|
Path primaryPath = getNodeService().getPath(nodeRef);
|
|
return ISO9075.decode(primaryPath.toString());
|
|
}
|
|
|
|
/**
|
|
* Gets the current node primary path
|
|
*
|
|
* @return primary path
|
|
*/
|
|
public String getPrimaryPrefixedPath(NodeRef nodeRef)
|
|
{
|
|
Path primaryPath = getNodeService().getPath(nodeRef);
|
|
return ISO9075.decode(primaryPath.toPrefixString(getNamespaceService()));
|
|
}
|
|
|
|
/**
|
|
* Gets the current node primary parent reference
|
|
*
|
|
* @return primary parent ref
|
|
*/
|
|
public NodeRef getPrimaryParent(NodeRef nodeRef)
|
|
{
|
|
Path primaryPath = getNodeService().getPath(nodeRef);
|
|
Path.Element element = primaryPath.last();
|
|
NodeRef parentRef = ((Path.ChildAssocElement) element).getRef().getParentRef();
|
|
return parentRef;
|
|
}
|
|
|
|
/**
|
|
* Gets the current node aspects
|
|
*
|
|
* @return node aspects
|
|
*/
|
|
public List<Aspect> getAspects(NodeRef nodeRef)
|
|
{
|
|
Set<QName> qnames = getNodeService().getAspects(nodeRef);
|
|
List<Aspect> aspects = new ArrayList<Aspect>(qnames.size());
|
|
for (QName qname : qnames)
|
|
{
|
|
aspects.add(new Aspect(qname));
|
|
}
|
|
return aspects;
|
|
}
|
|
|
|
/**
|
|
* Gets the current node parents
|
|
*
|
|
* @return node parents
|
|
*/
|
|
public List<ChildAssociation> getParents(NodeRef nodeRef)
|
|
{
|
|
List<ChildAssociationRef> parents = getNodeService().getParentAssocs(nodeRef);
|
|
List<ChildAssociation> assocs = new ArrayList<ChildAssociation>(parents.size());
|
|
for (ChildAssociationRef ref : parents)
|
|
{
|
|
assocs.add(new ChildAssociation(ref));
|
|
}
|
|
return assocs;
|
|
}
|
|
|
|
/**
|
|
* Gets the current node properties
|
|
*
|
|
* @return properties
|
|
*/
|
|
public List<Property> getProperties(NodeRef nodeRef)
|
|
{
|
|
Map<QName, Serializable> propertyValues = getNodeService().getProperties(nodeRef);
|
|
List<Property> properties = new ArrayList<Property>(propertyValues.size());
|
|
for (Map.Entry<QName, Serializable> property : propertyValues.entrySet())
|
|
{
|
|
properties.add(new Property(property.getKey(), property.getValue()));
|
|
}
|
|
return properties;
|
|
}
|
|
|
|
/**
|
|
* Gets whether the current node inherits its permissions from a parent node
|
|
*
|
|
* @return true => inherits permissions
|
|
*/
|
|
public boolean getInheritPermissions(NodeRef nodeRef)
|
|
{
|
|
Boolean inheritPermissions = this.getPermissionService().getInheritParentPermissions(nodeRef);
|
|
return inheritPermissions.booleanValue();
|
|
}
|
|
|
|
/**
|
|
* Gets the current node permissions
|
|
*
|
|
* @return the permissions
|
|
*/
|
|
public List<Permission> getPermissions(NodeRef nodeRef)
|
|
{
|
|
List<Permission> permissions = null;
|
|
AccessStatus readPermissions = this.getPermissionService().hasPermission(nodeRef, PermissionService.READ_PERMISSIONS);
|
|
if (readPermissions.equals(AccessStatus.ALLOWED))
|
|
{
|
|
List<Permission> nodePermissions = new ArrayList<Permission>();
|
|
for (Iterator<AccessPermission> iterator = getPermissionService().getAllSetPermissions(nodeRef).iterator(); iterator
|
|
.hasNext();)
|
|
{
|
|
AccessPermission ap = iterator.next();
|
|
nodePermissions.add(new Permission(ap.getPermission(), ap.getAuthority(), ap.getAccessStatus().toString()));
|
|
}
|
|
permissions = nodePermissions;
|
|
}
|
|
else
|
|
{
|
|
List<Permission> noReadPermissions = new ArrayList<Permission>(1);
|
|
noReadPermissions.add(new NoReadPermissionGranted());
|
|
permissions = noReadPermissions;
|
|
}
|
|
return permissions;
|
|
}
|
|
|
|
/**
|
|
* Gets the current node permissions
|
|
*
|
|
* @return the permissions
|
|
*/
|
|
public List<Permission> getStorePermissionMasks(NodeRef nodeRef)
|
|
{
|
|
List<Permission> permissionMasks = null;
|
|
if (nodeRef.getStoreRef().getProtocol().equals(StoreRef.PROTOCOL_AVM))
|
|
{
|
|
permissionMasks = new ArrayList<Permission>();
|
|
for (Iterator<AccessPermission> iterator = getPermissionService().getAllSetPermissions(nodeRef.getStoreRef()).iterator(); iterator
|
|
.hasNext();)
|
|
{
|
|
AccessPermission ap = iterator.next();
|
|
permissionMasks.add(new Permission(ap.getPermission(), ap.getAuthority(), ap.getAccessStatus().toString()));
|
|
}
|
|
}
|
|
else
|
|
{
|
|
permissionMasks = new ArrayList<Permission>(1);
|
|
permissionMasks.add(new NoStoreMask());
|
|
}
|
|
return permissionMasks;
|
|
}
|
|
|
|
/**
|
|
* Gets the current node children
|
|
*
|
|
* @return node children
|
|
*/
|
|
public List<ChildAssociation> getChildren(NodeRef nodeRef)
|
|
{
|
|
List<ChildAssociationRef> refs = getNodeService().getChildAssocs(nodeRef);
|
|
List<ChildAssociation> assocs = new ArrayList<ChildAssociation>(refs.size());
|
|
for (ChildAssociationRef ref : refs)
|
|
{
|
|
assocs.add(new ChildAssociation(ref));
|
|
}
|
|
return assocs;
|
|
}
|
|
|
|
/**
|
|
* Gets the current node associations
|
|
*
|
|
* @return associations
|
|
*/
|
|
public List<PeerAssociation> getAssocs(NodeRef nodeRef)
|
|
{
|
|
List<AssociationRef> refs = null;
|
|
try
|
|
{
|
|
refs = getNodeService().getTargetAssocs(nodeRef, RegexQNamePattern.MATCH_ALL);
|
|
}
|
|
catch (UnsupportedOperationException err)
|
|
{
|
|
// some stores do not support associations
|
|
}
|
|
List<PeerAssociation> assocs = new ArrayList<PeerAssociation>(refs.size());
|
|
for (AssociationRef ref : refs)
|
|
{
|
|
assocs.add(new PeerAssociation(ref.getTypeQName(), ref.getSourceRef(), ref.getTargetRef()));
|
|
}
|
|
return assocs;
|
|
}
|
|
|
|
/**
|
|
* Gets the current source associations
|
|
*
|
|
* @return associations
|
|
*/
|
|
public List<PeerAssociation> getSourceAssocs(NodeRef nodeRef)
|
|
{
|
|
List<AssociationRef> refs = null;
|
|
try
|
|
{
|
|
refs = getNodeService().getSourceAssocs(nodeRef, RegexQNamePattern.MATCH_ALL);
|
|
}
|
|
catch (UnsupportedOperationException err)
|
|
{
|
|
// some stores do not support associations
|
|
}
|
|
List<PeerAssociation> assocs = new ArrayList<PeerAssociation>(refs.size());
|
|
for (AssociationRef ref : refs)
|
|
{
|
|
assocs.add(new PeerAssociation(ref.getTypeQName(), ref.getSourceRef(), ref.getTargetRef()));
|
|
}
|
|
return assocs;
|
|
}
|
|
|
|
public boolean getInAVMStore(NodeRef nodeRef)
|
|
{
|
|
return nodeRef.getStoreRef().getProtocol().equals(StoreRef.PROTOCOL_AVM);
|
|
}
|
|
|
|
public List<Map<String, String>> getAVMStoreProperties(NodeRef nodeRef)
|
|
{
|
|
List<Map<String, String>> avmStoreProps = null;
|
|
// work out the store name from current nodeRef
|
|
String store = nodeRef.getStoreRef().getIdentifier();
|
|
Map<QName, PropertyValue> props = getAVMService().getStoreProperties(store);
|
|
List<Map<String, String>> storeProperties = new ArrayList<Map<String, String>>();
|
|
|
|
for (Map.Entry<QName, PropertyValue> property : props.entrySet())
|
|
{
|
|
Map<String, String> map = new HashMap<String, String>(2);
|
|
map.put("name", property.getKey().toString());
|
|
map.put("type", property.getValue().getActualTypeString());
|
|
String val = property.getValue().getStringValue();
|
|
if (val == null)
|
|
{
|
|
val = "null";
|
|
}
|
|
map.put("value", val);
|
|
|
|
storeProperties.add(map);
|
|
}
|
|
|
|
avmStoreProps = storeProperties;
|
|
|
|
return avmStoreProps;
|
|
}
|
|
|
|
/**
|
|
* Action to submit search
|
|
*
|
|
* @return next action
|
|
*/
|
|
public List<Node> submitSearch(final String store, final String query, final String queryLanguage) throws IOException
|
|
{
|
|
final StoreRef storeRef = new StoreRef(store);
|
|
RetryingTransactionCallback<List<Node>> searchCallback = new RetryingTransactionCallback<List<Node>>()
|
|
{
|
|
public List<Node> execute() throws Throwable
|
|
{
|
|
List<Node> searchResults = null;
|
|
if (queryLanguage.equals("noderef"))
|
|
{
|
|
// ensure node exists
|
|
NodeRef nodeRef = new NodeRef(query);
|
|
boolean exists = getNodeService().exists(nodeRef);
|
|
if (!exists)
|
|
{
|
|
throw new WebScriptException(500, "Node " + nodeRef + " does not exist.");
|
|
}
|
|
searchResults = new ArrayList<Node>(1);
|
|
searchResults.add(new Node(nodeRef));
|
|
return searchResults;
|
|
}
|
|
|
|
// perform search
|
|
List<NodeRef> nodeRefs = getSearchService().query(storeRef, queryLanguage, query).getNodeRefs();
|
|
searchResults = new ArrayList<Node>(nodeRefs.size());
|
|
for (NodeRef nodeRef : nodeRefs) {
|
|
searchResults.add(new Node(nodeRef));
|
|
}
|
|
return searchResults;
|
|
}
|
|
};
|
|
|
|
try
|
|
{
|
|
return getTransactionService().getRetryingTransactionHelper().doInTransaction(searchCallback, true);
|
|
}
|
|
catch (Throwable e)
|
|
{
|
|
throw new IOException(e.getMessage(), e);
|
|
}
|
|
}
|
|
|
|
@Override
|
|
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache)
|
|
{
|
|
if (req.getPathInfo().equals("/slingshot/node/search"))
|
|
{
|
|
List<Node> nodes;
|
|
Map<String, Object> tmplMap = new HashMap<String, Object>(1);
|
|
try
|
|
{
|
|
if (req.getParameter("store") == null || req.getParameter("store").length() == 0)
|
|
{
|
|
status.setCode(HttpServletResponse.SC_BAD_REQUEST);
|
|
status.setMessage("Store name not provided");
|
|
status.setRedirect(true);
|
|
return null;
|
|
}
|
|
if (req.getParameter("q") == null || req.getParameter("q").length() == 0)
|
|
{
|
|
status.setCode(HttpServletResponse.SC_BAD_REQUEST);
|
|
status.setMessage("Search query not provided");
|
|
status.setRedirect(true);
|
|
return null;
|
|
}
|
|
if (req.getParameter("lang") == null || req.getParameter("lang").length() == 0)
|
|
{
|
|
status.setCode(HttpServletResponse.SC_BAD_REQUEST);
|
|
status.setMessage("Search language not provided");
|
|
status.setRedirect(true);
|
|
return null;
|
|
}
|
|
nodes = submitSearch(req.getParameter("store"), req.getParameter("q"), req.getParameter("lang"));
|
|
tmplMap.put("results", nodes);
|
|
}
|
|
catch (IOException e)
|
|
{
|
|
status.setCode(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
|
status.setMessage(e.getMessage());
|
|
status.setException(e);
|
|
status.setRedirect(true);
|
|
}
|
|
return tmplMap;
|
|
}
|
|
else if (req.getPathInfo().equals("/slingshot/node/stores"))
|
|
{
|
|
Map<String, Object> model = new HashMap<String, Object>();
|
|
model.put("stores", getStores());
|
|
return model;
|
|
}
|
|
else // Assume we are looking for a node
|
|
{
|
|
Map<String, String> templateVars = req.getServiceMatch().getTemplateVars();
|
|
if (templateVars.get("protocol") == null || templateVars.get("protocol").length() == 0 ||
|
|
templateVars.get("store") == null || templateVars.get("store").length() == 0 ||
|
|
templateVars.get("id") == null || templateVars.get("id").length() == 0)
|
|
{
|
|
status.setCode(HttpServletResponse.SC_BAD_REQUEST);
|
|
status.setMessage("Node not provided");
|
|
status.setRedirect(true);
|
|
return null;
|
|
}
|
|
NodeRef nodeRef = new NodeRef(templateVars.get("protocol"), templateVars.get("store"), templateVars.get("id"));
|
|
|
|
Map<String, Object> permissionInfo = new HashMap<String, Object>(3);
|
|
permissionInfo.put("entries", getPermissions(nodeRef));
|
|
permissionInfo.put("owner", this.getOwnableService().getOwner(nodeRef));
|
|
permissionInfo.put("inherit", this.getInheritPermissions(nodeRef));
|
|
permissionInfo.put("entries", getPermissions(nodeRef));
|
|
permissionInfo.put("storePermissions", getStorePermissionMasks(nodeRef));
|
|
|
|
Map<String, Object> model = new HashMap<String, Object>();
|
|
model.put("node", new Node(nodeRef));
|
|
model.put("properties", getProperties(nodeRef));
|
|
model.put("aspects", getAspects(nodeRef));
|
|
model.put("children", getChildren(nodeRef));
|
|
model.put("parents", getParents(nodeRef));
|
|
model.put("assocs", getAssocs(nodeRef));
|
|
model.put("sourceAssocs", getSourceAssocs(nodeRef));
|
|
model.put("permissions", permissionInfo);
|
|
return model;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Node wrapper class
|
|
*/
|
|
public class Node
|
|
{
|
|
private String qnamePath;
|
|
|
|
private String prefixedQNamePath;
|
|
|
|
private NodeRef nodeRef;
|
|
|
|
private NodeRef parentNodeRef;
|
|
|
|
private QNameBean childAssoc;
|
|
|
|
private QNameBean type;
|
|
|
|
public Node(NodeRef nodeRef)
|
|
{
|
|
this.nodeRef = nodeRef;
|
|
Path path = getNodeService().getPath(nodeRef);
|
|
this.qnamePath = path.toString();
|
|
this.prefixedQNamePath = path.toPrefixString(getNamespaceService());
|
|
this.parentNodeRef = getPrimaryParent(nodeRef);
|
|
ChildAssociationRef ref = getNodeService().getPrimaryParent(nodeRef);
|
|
this.childAssoc = ref.getQName() != null ? new QNameBean(ref.getQName()) : null;
|
|
this.type = new QNameBean(getNodeService().getType(nodeRef));
|
|
}
|
|
|
|
public String getQnamePath()
|
|
{
|
|
return qnamePath;
|
|
}
|
|
|
|
public String getPrefixedQNamePath()
|
|
{
|
|
return prefixedQNamePath;
|
|
}
|
|
|
|
public NodeRef getNodeRef()
|
|
{
|
|
return nodeRef;
|
|
}
|
|
|
|
public String getId()
|
|
{
|
|
return nodeRef.getId();
|
|
}
|
|
|
|
public String getName()
|
|
{
|
|
return childAssoc != null ? childAssoc.getName() : "";
|
|
}
|
|
|
|
public String getPrefixedName()
|
|
{
|
|
return childAssoc != null ? childAssoc.getPrefixedName() : "";
|
|
}
|
|
|
|
public QNameBean getType()
|
|
{
|
|
return type;
|
|
}
|
|
|
|
public void setNodeRef(NodeRef nodeRef)
|
|
{
|
|
this.nodeRef = nodeRef;
|
|
}
|
|
|
|
public NodeRef getParentNodeRef()
|
|
{
|
|
return parentNodeRef;
|
|
}
|
|
|
|
public void setParentNodeRef(NodeRef parentNodeRef)
|
|
{
|
|
this.parentNodeRef = parentNodeRef;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Qname wrapper class
|
|
*/
|
|
public class QNameBean implements Serializable
|
|
{
|
|
private static final long serialVersionUID = 6982292337846270774L;
|
|
|
|
protected QName name;
|
|
|
|
public QNameBean(QName name)
|
|
{
|
|
this.name = name;
|
|
}
|
|
|
|
public String getName()
|
|
{
|
|
return name.toString();
|
|
}
|
|
|
|
public String getPrefixedName()
|
|
{
|
|
try
|
|
{
|
|
return name.toPrefixString(getNamespaceService());
|
|
}
|
|
catch(NamespaceException e)
|
|
{
|
|
return name.getLocalName();
|
|
}
|
|
}
|
|
|
|
public String toString()
|
|
{
|
|
return getName();
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Aspect wrapper class
|
|
*/
|
|
public class Aspect extends QNameBean
|
|
{
|
|
private static final long serialVersionUID = -6448182941386934326L;
|
|
|
|
public Aspect(QName name)
|
|
{
|
|
super(name);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Association wrapper class
|
|
*/
|
|
public class Association
|
|
{
|
|
protected QNameBean name;
|
|
protected QNameBean typeName;
|
|
|
|
public Association(QName name, QName typeName)
|
|
{
|
|
this.name = name != null ? new QNameBean(name) : null;
|
|
this.typeName = new QNameBean(typeName);
|
|
}
|
|
|
|
public QNameBean getName()
|
|
{
|
|
return name;
|
|
}
|
|
|
|
public QNameBean getTypeName()
|
|
{
|
|
return typeName;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Child assoc wrapper class
|
|
*/
|
|
public class ChildAssociation extends Association implements Serializable
|
|
{
|
|
/**
|
|
*
|
|
*/
|
|
private static final long serialVersionUID = -52439282250891063L;
|
|
|
|
protected NodeRef childRef;
|
|
protected NodeRef parentRef;
|
|
protected QNameBean childType;
|
|
protected QNameBean parentType;
|
|
protected boolean primary;
|
|
|
|
// from Association
|
|
protected QNameBean name;
|
|
protected QNameBean typeName;
|
|
|
|
public ChildAssociation(ChildAssociationRef ref)
|
|
{
|
|
super(ref.getQName() != null ? ref.getQName() : null,
|
|
ref.getTypeQName() != null ? ref.getTypeQName() : null);
|
|
|
|
this.childRef = ref.getChildRef();
|
|
this.parentRef = ref.getParentRef(); // could be null
|
|
if (childRef != null)
|
|
this.childType = new QNameBean(getNodeType(childRef));
|
|
if (parentRef != null)
|
|
this.parentType = new QNameBean(getNodeType(parentRef));
|
|
this.primary = ref.isPrimary();
|
|
}
|
|
|
|
public NodeRef getChildRef()
|
|
{
|
|
return childRef;
|
|
}
|
|
|
|
public QNameBean getChildTypeName()
|
|
{
|
|
return childType;
|
|
}
|
|
|
|
public NodeRef getParentRef()
|
|
{
|
|
return parentRef;
|
|
}
|
|
|
|
public QNameBean getParentTypeName()
|
|
{
|
|
return parentType;
|
|
}
|
|
|
|
public boolean isPrimary()
|
|
{
|
|
return primary;
|
|
}
|
|
|
|
public boolean getPrimary()
|
|
{
|
|
return this.isPrimary();
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Peer assoc wrapper class
|
|
*/
|
|
public class PeerAssociation extends Association
|
|
{
|
|
protected NodeRef sourceRef;
|
|
protected NodeRef targetRef;
|
|
protected QNameBean sourceType;
|
|
protected QNameBean targetType;
|
|
|
|
// from Association
|
|
protected QNameBean name;
|
|
protected QNameBean typeName;
|
|
|
|
public PeerAssociation(QName typeName, NodeRef sourceRef, NodeRef targetRef)
|
|
{
|
|
super(null, typeName);
|
|
|
|
this.sourceRef = sourceRef;
|
|
this.targetRef = targetRef;
|
|
if (sourceRef != null)
|
|
this.sourceType = new QNameBean(getNodeType(sourceRef));
|
|
if (targetRef != null)
|
|
this.targetType = new QNameBean(getNodeType(targetRef));
|
|
}
|
|
|
|
public NodeRef getSourceRef()
|
|
{
|
|
return sourceRef;
|
|
}
|
|
|
|
public QNameBean getSourceTypeName()
|
|
{
|
|
return sourceType;
|
|
}
|
|
|
|
public NodeRef getTargetRef()
|
|
{
|
|
return targetRef;
|
|
}
|
|
|
|
public QNameBean getTargetTypeName()
|
|
{
|
|
return targetType;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Property wrapper class
|
|
*/
|
|
public class Property
|
|
{
|
|
private QNameBean name;
|
|
|
|
private boolean isCollection = false;
|
|
|
|
private List<Value> values;
|
|
|
|
private boolean residual;
|
|
|
|
private QNameBean typeName;
|
|
|
|
/**
|
|
* Construct
|
|
*
|
|
* @param name property name
|
|
* @param value property values
|
|
*/
|
|
@SuppressWarnings("unchecked")
|
|
public Property(QName qname, Serializable value)
|
|
{
|
|
this.name = new QNameBean(qname);
|
|
|
|
PropertyDefinition propDef = getDictionaryService().getProperty(qname);
|
|
if (propDef != null)
|
|
{
|
|
QName qn = propDef.getDataType().getName();
|
|
typeName = qn != null ? new QNameBean(propDef.getDataType().getName()) : null;
|
|
residual = false;
|
|
}
|
|
else
|
|
{
|
|
residual = true;
|
|
}
|
|
|
|
// handle multi/single values
|
|
final List<Value> values;
|
|
if (value instanceof Collection)
|
|
{
|
|
Collection<Serializable> oldValues = (Collection<Serializable>) value;
|
|
values = new ArrayList<Value>(oldValues.size());
|
|
isCollection = true;
|
|
for (Serializable multiValue : oldValues)
|
|
{
|
|
values.add(new Value(multiValue instanceof QName ? new QNameBean((QName) multiValue) : multiValue));
|
|
}
|
|
}
|
|
else
|
|
{
|
|
values = Collections.singletonList(new Value(value instanceof QName ? new QNameBean((QName) value) : value));
|
|
}
|
|
this.values = values;
|
|
}
|
|
|
|
/**
|
|
* Gets the property name
|
|
*
|
|
* @return name
|
|
*/
|
|
public QNameBean getName()
|
|
{
|
|
return name;
|
|
}
|
|
|
|
public QNameBean getTypeName()
|
|
{
|
|
return typeName;
|
|
}
|
|
|
|
/**
|
|
* Gets the prefixed property name
|
|
*
|
|
* @return prefixed name
|
|
*/
|
|
public String getPrefixedName()
|
|
{
|
|
return name.getPrefixedName();
|
|
}
|
|
|
|
/**
|
|
* Gets the property value
|
|
*
|
|
* @return value
|
|
*/
|
|
public List<Value> getValues()
|
|
{
|
|
return values;
|
|
}
|
|
|
|
/**
|
|
* Determines whether the property is residual
|
|
*
|
|
* @return true => property is not defined in dictionary
|
|
*/
|
|
public boolean getResidual()
|
|
{
|
|
return residual;
|
|
}
|
|
|
|
/**
|
|
* Determines whether the property is of ANY type
|
|
*
|
|
* @return true => is any
|
|
*/
|
|
public boolean isAny()
|
|
{
|
|
return (getTypeName() == null) ? false : getTypeName().getName().equals(DataTypeDefinition.ANY.toString());
|
|
}
|
|
|
|
/**
|
|
* Determines whether the property is a collection
|
|
*
|
|
* @return true => is collection
|
|
*/
|
|
public boolean isCollection()
|
|
{
|
|
return isCollection;
|
|
}
|
|
|
|
/**
|
|
* Value wrapper
|
|
*/
|
|
public class Value
|
|
{
|
|
private Serializable value;
|
|
|
|
/**
|
|
* Construct
|
|
*
|
|
* @param value value
|
|
*/
|
|
public Value(Serializable value)
|
|
{
|
|
this.value = value;
|
|
}
|
|
|
|
/**
|
|
* Gets the value
|
|
*
|
|
* @return the value
|
|
*/
|
|
public Serializable getValue()
|
|
{
|
|
return value;
|
|
}
|
|
|
|
/**
|
|
* Gets the value datatype
|
|
*
|
|
* @return the value datatype
|
|
*/
|
|
public String getDataType()
|
|
{
|
|
String datatype = null;
|
|
if (Property.this.getTypeName() != null)
|
|
{
|
|
datatype = Property.this.getTypeName().getName();
|
|
}
|
|
if (datatype == null || datatype.equals(DataTypeDefinition.ANY.toString()))
|
|
{
|
|
if (value != null)
|
|
{
|
|
DataTypeDefinition dataTypeDefinition = getDictionaryService().getDataType(value.getClass());
|
|
if (dataTypeDefinition != null)
|
|
{
|
|
datatype = getDictionaryService().getDataType(value.getClass()).getName().toString();
|
|
}
|
|
}
|
|
}
|
|
return datatype;
|
|
}
|
|
|
|
/**
|
|
* Determines whether the value is content
|
|
*
|
|
* @return true => is content
|
|
*/
|
|
public boolean isContent()
|
|
{
|
|
String datatype = getDataType();
|
|
return (datatype == null) ? false : datatype.equals(DataTypeDefinition.CONTENT.toString());
|
|
}
|
|
|
|
/**
|
|
* Determines whether the value is a node ref
|
|
*
|
|
* @return true => is node ref
|
|
*/
|
|
public boolean isNodeRef()
|
|
{
|
|
String datatype = getDataType();
|
|
return (datatype == null) ? false : datatype.equals(DataTypeDefinition.NODE_REF.toString()) || datatype.equals(DataTypeDefinition.CATEGORY.toString());
|
|
}
|
|
|
|
/**
|
|
* Determines whether the value is null
|
|
*
|
|
* @return true => value is null
|
|
*/
|
|
public boolean isNullValue()
|
|
{
|
|
return value == null;
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Permission bean
|
|
*/
|
|
public static class Permission
|
|
{
|
|
private String permission;
|
|
private String authority;
|
|
private String accessStatus;
|
|
|
|
public Permission(String permission, String authority, String accessStatus)
|
|
{
|
|
this.permission = permission;
|
|
this.authority = authority;
|
|
this.accessStatus = accessStatus;
|
|
}
|
|
|
|
public String getPermission()
|
|
{
|
|
return permission;
|
|
}
|
|
|
|
public void setPermission(String permission)
|
|
{
|
|
this.permission = permission;
|
|
}
|
|
|
|
public String getAuthority()
|
|
{
|
|
return authority;
|
|
}
|
|
|
|
public void setAuthority(String authority)
|
|
{
|
|
this.authority = authority;
|
|
}
|
|
|
|
public String getAccessStatus()
|
|
{
|
|
return accessStatus;
|
|
}
|
|
|
|
public void setAccessStatus(String accessStatus)
|
|
{
|
|
this.accessStatus = accessStatus;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Permission representing the fact that "Read Permissions" has not been granted
|
|
*/
|
|
public static class NoReadPermissionGranted extends Permission
|
|
{
|
|
public NoReadPermissionGranted()
|
|
{
|
|
super(PermissionService.READ_PERMISSIONS, "[Current Authority]", "Not Granted");
|
|
}
|
|
}
|
|
|
|
public static class NoStoreMask extends Permission
|
|
{
|
|
public NoStoreMask()
|
|
{
|
|
super("All <No Mask>", "All", "Allowed");
|
|
}
|
|
}
|
|
|
|
}
|