mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
26012: OpenCMIS server bug fixes: PWC properties update and document version delete 26205: - integrated the CMIS Client API project into the build - made the local CMIS client use the Alfresco OpenCMIS Extension - updated OpenCMIS 26300: expose all non-child associations through OpenCMIS and check relationship source and target instead of the relationship type 26356: OpenCMIS update 26378: added more CMIS client examples 26380: added helper methods for CMIS client 26500: - fixed CMIS date aspect property encoding - fixed CMIS rendition filter handling 26519: OpenCMIS update 26523: fixed CMISConnectionManager 26596: renamed CMIS JavaScript root objects (cmis -> cmisserver, cmisclient -> cmis) 26651: removed the cmis-client-api project and replaced it with a jar in 3rd-party 26652: - corrected CMIS samples 26656: - removed cmis-client-api from build 26658: - removed the last bit of cmis-client-api 26663: - added CMIS samples (browser and upload) 26742: CMIS webscripts samples update 26743: CMIS webscripts samples update 26939: removed duplicate commons-fileupload 26942: updated commons-lang to 2.6 26943: updated OpenCMIS (browser binding is now included in the server framework) 26953: refactored OpenCMIS client integration 26974: Update classpath for Florian - OpenCMIS browser bindings are now rolled into the main jar, no need for their own one 26975: removed outdated CMIS browser binding demo page 27048: port of the Spring Surf CMIS browser plus a few new features (create folder, create document, delete object) 27077: bug fix: CMIS id for associations 27079: OpenCMIS update 27085: added check if CMIS is supported 27086: OpenCMIS client bindings update (force JAX-WS RI) 27138: clean up 27764: CMIS default connection handling 27879: OpenCMIS client: moved server definitions to separate config file 27880: OpenCMIS client: removed test repositories from configuration 27918: changed CMIS server configuration tag name to match Spring Surf configuration 27920: enabled relationships in CMIS browser 27924: Updated Spring Surf and added the Spring Surf CMIS framework [Merge note: Kept most recent HEAD jars where conflicts occured] 27926: Updated Spring Surf source jars [Merge note: Kept most recent HEAD jars where conflicts occured] git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28219 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
118 lines
4.5 KiB
Java
118 lines
4.5 KiB
Java
/*
|
|
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
|
*
|
|
* This file is part of Alfresco
|
|
*
|
|
* Alfresco is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU Lesser General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* Alfresco is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
package org.alfresco.opencmis.dictionary;
|
|
|
|
import java.util.Collection;
|
|
|
|
import org.alfresco.cmis.mapping.CMISMapping;
|
|
import org.alfresco.service.cmr.dictionary.AssociationDefinition;
|
|
import org.alfresco.service.cmr.dictionary.ClassDefinition;
|
|
import org.alfresco.service.namespace.QName;
|
|
import org.apache.chemistry.opencmis.commons.enums.BaseTypeId;
|
|
|
|
/**
|
|
* CMIS Dictionary which provides Types that strictly conform to the CMIS
|
|
* specification.
|
|
*
|
|
* That is, only maps types to one of root Document, Folder, Relationship &
|
|
* Policy.
|
|
*
|
|
* @author davidc
|
|
*/
|
|
public class CMISStrictDictionaryService extends CMISAbstractDictionaryService
|
|
{
|
|
|
|
@Override
|
|
protected void createDefinitions(DictionaryRegistry registry)
|
|
{
|
|
createTypeDefs(registry, dictionaryService.getAllTypes());
|
|
createAssocDefs(registry, dictionaryService.getAllAssociations());
|
|
createTypeDefs(registry, dictionaryService.getAllAspects());
|
|
}
|
|
|
|
/**
|
|
* Create Type Definitions
|
|
*
|
|
* @param registry
|
|
* @param classQNames
|
|
*/
|
|
private void createTypeDefs(DictionaryRegistry registry, Collection<QName> classQNames)
|
|
{
|
|
for (QName classQName : classQNames)
|
|
{
|
|
// skip items that are remapped to CMIS model
|
|
if (cmisMapping.isRemappedType(classQName))
|
|
continue;
|
|
|
|
// create appropriate kind of type definition
|
|
ClassDefinition classDef = dictionaryService.getClass(classQName);
|
|
String typeId = null;
|
|
AbstractTypeDefinitionWrapper objectTypeDef = null;
|
|
if (cmisMapping.isValidCmisDocument(classQName))
|
|
{
|
|
typeId = cmisMapping.getCmisTypeId(BaseTypeId.CMIS_DOCUMENT, classQName);
|
|
objectTypeDef = new DocumentTypeDefinitionWrapper(cmisMapping, serviceRegistry, typeId, classDef);
|
|
} else if (cmisMapping.isValidCmisFolder(classQName))
|
|
{
|
|
typeId = cmisMapping.getCmisTypeId(BaseTypeId.CMIS_FOLDER, classQName);
|
|
objectTypeDef = new FolderTypeDefintionWrapper(cmisMapping, serviceRegistry, typeId, classDef);
|
|
} else if (cmisMapping.isValidCmisPolicy(classQName))
|
|
{
|
|
typeId = cmisMapping.getCmisTypeId(BaseTypeId.CMIS_POLICY, classQName);
|
|
objectTypeDef = new PolicyTypeDefintionWrapper(cmisMapping, serviceRegistry, typeId, classDef);
|
|
}
|
|
|
|
if (objectTypeDef != null)
|
|
{
|
|
registry.registerTypeDefinition(objectTypeDef);
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Create Relationship Definitions
|
|
*
|
|
* @param registry
|
|
* @param classQNames
|
|
*/
|
|
private void createAssocDefs(DictionaryRegistry registry, Collection<QName> classQNames)
|
|
{
|
|
// register base type
|
|
String typeId = cmisMapping.getCmisTypeId(BaseTypeId.CMIS_RELATIONSHIP, CMISMapping.RELATIONSHIP_QNAME);
|
|
RelationshipTypeDefintionWrapper objectTypeDef = new RelationshipTypeDefintionWrapper(cmisMapping,
|
|
serviceRegistry, typeId, dictionaryService.getClass(CMISMapping.RELATIONSHIP_QNAME));
|
|
|
|
registry.registerTypeDefinition(objectTypeDef);
|
|
|
|
// register all other relationships
|
|
for (QName classQName : classQNames)
|
|
{
|
|
if (!cmisMapping.isValidCmisRelationship(classQName))
|
|
continue;
|
|
|
|
// create appropriate kind of type definition
|
|
AssociationDefinition assocDef = dictionaryService.getAssociation(classQName);
|
|
typeId = cmisMapping.getCmisTypeId(BaseTypeId.CMIS_RELATIONSHIP, classQName);
|
|
objectTypeDef = new RelationshipTypeDefintionWrapper(cmisMapping, typeId, assocDef);
|
|
|
|
registry.registerTypeDefinition(objectTypeDef);
|
|
}
|
|
}
|
|
}
|