如何在 Apache Chemistry CMIS API 中设置字符集?
How to set charset in Apache Chemistry CMIS API?
我正在尝试通过如下路径获取文件夹 ID:
Folder folder = (Folder) getCmisSession().getObjectByPath(folderPath);
我请求的路径是:
/SIGAP/2011/DIRECCIÓN GENERAL DE PRUEBAS/SIN EXPEDIENTE/2010001231
如您所见,字符串中有一个特殊字符 Ó
,
引发化学反应的错误是:
STACK TRACE:
org.cmis.ws.CmisException: Not found an object for the specific path: /SIGAP/2011/DIRECCIÃ?N GENERAL DE PRUEBAS/OFICIOS
at com.emc.documentum.fs.cmis.impl.dfs.utils.CmisExceptionFactory.create(CmisExceptionFactory.java:24)
at com.emc.documentum.fs.cmis.impl.dfs.utils.CmisExceptionBuilder.build(CmisExceptionBuilder.java:31)
at com.emc.documentum.fs.cmis.impl.dfs.action.GetObjectByPathAction.getNonCabinetObjectByPath(GetObjectByPathAction.java:170)
它将字符串从 DIRECCIÓN
更改为 DIRECCIÃ?N
,
如何将会话的字符集设置为 utf-8?或者我必须如何对路径进行编码?
更新 1:
正如@FlorianMüller 所说,在 SoapUI 的帮助下,我尝试通过如下路径请求相同的文件夹:
<soapenv:Body>
<ns:getObjectByPath>
<ns:repositoryId>LHD_ECM</ns:repositoryId>
<ns:path>/SIGAP/2011/DIRECCIÓN GENERAL DE PRUEBAS/SIN EXPEDIENTE/2010001231</ns:path>
</ns:getObjectByPath>
</soapenv:Body>
让服务器搞定:
<S:Body>
<ns2:getObjectByPathResponse xmlns="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:ns2="http://docs.oasis-open.org/ns/cmis/messaging/200908/">
<ns2:object>
<properties>
<propertyString queryName="cmis:name" displayName="Name" localName="object_name" propertyDefinitionId="cmis:name">
<value>2010001231</value>
</propertyString>
<propertyId queryName="cmis:objectTypeId" displayName="Object Type ID" localName="r_object_type" propertyDefinitionId="cmis:objectTypeId">
<value>sigapfolio</value>
</propertyId>
<propertyId queryName="cmis:baseTypeId" displayName="Base Type Id" localName="" propertyDefinitionId="cmis:baseTypeId">
<value>cmis:folder</value>
</propertyId>
<propertyId queryName="cmis:objectId" displayName="Object Id" localName="r_object_id" propertyDefinitionId="cmis:objectId">
<value>0b00020280080815</value>
</propertyId>
<propertyString queryName="cmis:createdBy" displayName="Created By" localName="r_creator_name" propertyDefinitionId="cmis:createdBy">
<value>dmadmin</value>
</propertyString>
<propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="r_creation_date" propertyDefinitionId="cmis:creationDate">
<value>2016-04-05T04:54:44.000-05:00</value>
</propertyDateTime>
<propertyString queryName="cmis:lastModifiedBy" displayName="Last Modified By" localName="r_modifier" propertyDefinitionId="cmis:lastModifiedBy">
<value>dmadmin</value>
</propertyString>
<propertyDateTime queryName="cmis:lastModificationDate" displayName="Last Modification Date" localName="r_modify_date" propertyDefinitionId="cmis:lastModificationDate">
<value>2016-04-05T04:54:44.000-05:00</value>
</propertyDateTime>
<propertyString queryName="cmis:changeToken" displayName="Change Token" localName="i_vstamp" propertyDefinitionId="cmis:changeToken">
<value>1</value>
</propertyString>
<propertyId queryName="cmis:parentId" displayName="Parent Id" localName="i_folder_id" propertyDefinitionId="cmis:parentId">
<value>0b00020280005a3b</value>
</propertyId>
<propertyString queryName="cmis:path" displayName="Folder Path" localName="r_folder_path" propertyDefinitionId="cmis:path">
<value>/SIGAP/2011/DIRECCIÓN GENERAL DE PRUEBAS/SIN EXPEDIENTE/2010001231</value>
</propertyString>
<propertyId queryName="cmis:allowedChildObjectTypeIds" displayName="Allowed Child Object Type IDs" localName="" propertyDefinitionId="cmis:allowedChildObjectTypeIds">
<value>cmis:folder</value>
<value>cmis:document</value>
</propertyId>
</properties>
</ns2:object>
</ns2:getObjectByPathResponse>
</S:Body>
</S:Envelope>
所以 Apache Chemistry 肯定有问题:(
所以问题出在绑定上,从 AtomPub 切换到 Webservices,问题就消失了。
parameter.put(SessionParameter.BINDING_TYPE, BindingType.WEBSERVICES.value());
我正在尝试通过如下路径获取文件夹 ID:
Folder folder = (Folder) getCmisSession().getObjectByPath(folderPath);
我请求的路径是:
/SIGAP/2011/DIRECCIÓN GENERAL DE PRUEBAS/SIN EXPEDIENTE/2010001231
如您所见,字符串中有一个特殊字符 Ó
,
引发化学反应的错误是:
STACK TRACE:
org.cmis.ws.CmisException: Not found an object for the specific path: /SIGAP/2011/DIRECCIÃ?N GENERAL DE PRUEBAS/OFICIOS
at com.emc.documentum.fs.cmis.impl.dfs.utils.CmisExceptionFactory.create(CmisExceptionFactory.java:24)
at com.emc.documentum.fs.cmis.impl.dfs.utils.CmisExceptionBuilder.build(CmisExceptionBuilder.java:31)
at com.emc.documentum.fs.cmis.impl.dfs.action.GetObjectByPathAction.getNonCabinetObjectByPath(GetObjectByPathAction.java:170)
它将字符串从 DIRECCIÓN
更改为 DIRECCIÃ?N
,
如何将会话的字符集设置为 utf-8?或者我必须如何对路径进行编码?
更新 1:
正如@FlorianMüller 所说,在 SoapUI 的帮助下,我尝试通过如下路径请求相同的文件夹:
<soapenv:Body>
<ns:getObjectByPath>
<ns:repositoryId>LHD_ECM</ns:repositoryId>
<ns:path>/SIGAP/2011/DIRECCIÓN GENERAL DE PRUEBAS/SIN EXPEDIENTE/2010001231</ns:path>
</ns:getObjectByPath>
</soapenv:Body>
让服务器搞定:
<S:Body>
<ns2:getObjectByPathResponse xmlns="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:ns2="http://docs.oasis-open.org/ns/cmis/messaging/200908/">
<ns2:object>
<properties>
<propertyString queryName="cmis:name" displayName="Name" localName="object_name" propertyDefinitionId="cmis:name">
<value>2010001231</value>
</propertyString>
<propertyId queryName="cmis:objectTypeId" displayName="Object Type ID" localName="r_object_type" propertyDefinitionId="cmis:objectTypeId">
<value>sigapfolio</value>
</propertyId>
<propertyId queryName="cmis:baseTypeId" displayName="Base Type Id" localName="" propertyDefinitionId="cmis:baseTypeId">
<value>cmis:folder</value>
</propertyId>
<propertyId queryName="cmis:objectId" displayName="Object Id" localName="r_object_id" propertyDefinitionId="cmis:objectId">
<value>0b00020280080815</value>
</propertyId>
<propertyString queryName="cmis:createdBy" displayName="Created By" localName="r_creator_name" propertyDefinitionId="cmis:createdBy">
<value>dmadmin</value>
</propertyString>
<propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="r_creation_date" propertyDefinitionId="cmis:creationDate">
<value>2016-04-05T04:54:44.000-05:00</value>
</propertyDateTime>
<propertyString queryName="cmis:lastModifiedBy" displayName="Last Modified By" localName="r_modifier" propertyDefinitionId="cmis:lastModifiedBy">
<value>dmadmin</value>
</propertyString>
<propertyDateTime queryName="cmis:lastModificationDate" displayName="Last Modification Date" localName="r_modify_date" propertyDefinitionId="cmis:lastModificationDate">
<value>2016-04-05T04:54:44.000-05:00</value>
</propertyDateTime>
<propertyString queryName="cmis:changeToken" displayName="Change Token" localName="i_vstamp" propertyDefinitionId="cmis:changeToken">
<value>1</value>
</propertyString>
<propertyId queryName="cmis:parentId" displayName="Parent Id" localName="i_folder_id" propertyDefinitionId="cmis:parentId">
<value>0b00020280005a3b</value>
</propertyId>
<propertyString queryName="cmis:path" displayName="Folder Path" localName="r_folder_path" propertyDefinitionId="cmis:path">
<value>/SIGAP/2011/DIRECCIÓN GENERAL DE PRUEBAS/SIN EXPEDIENTE/2010001231</value>
</propertyString>
<propertyId queryName="cmis:allowedChildObjectTypeIds" displayName="Allowed Child Object Type IDs" localName="" propertyDefinitionId="cmis:allowedChildObjectTypeIds">
<value>cmis:folder</value>
<value>cmis:document</value>
</propertyId>
</properties>
</ns2:object>
</ns2:getObjectByPathResponse>
</S:Body>
</S:Envelope>
所以 Apache Chemistry 肯定有问题:(
所以问题出在绑定上,从 AtomPub 切换到 Webservices,问题就消失了。
parameter.put(SessionParameter.BINDING_TYPE, BindingType.WEBSERVICES.value());