You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by José Luís Vaquero <jl...@gmail.com> on 2012/04/25 11:02:22 UTC

DotCMIS Document's Name and FileName.

Hi. I'm creating a Doc in alfresco with Name = "Hello World" and FileName
"hello-world.txt"

           Dim properties As IDictionary(Of String, Object) = New
Dictionary(Of String, Object)()
            properties(PropertyIds.Name) = "Hello World"
            properties(PropertyIds.ObjectTypeId) =
Enums.CmisValue.GetCmisValue(Enums.BaseTypeId.CmisDocument)
            Dim contentStream As Data.Impl.ContentStream = New
Data.Impl.ContentStream()
            contentStream.FileName = "hello-world.txt"
            contentStream.MimeType = "text/plain"
            contentStream.Length = content.Length
            contentStream.Stream = new Filestream("hello-world.txt",
FileMode.Open)
            folder.CreateDocument(properties, contentStream, Nothing)

But when I fetch the Document by Id

Re: DotCMIS Document's Name and FileName.

Posted by Florian Müller <fm...@apache.org>.
 Hi José,

 That depends on the repository. Some repository preserve the filename, 
 others don't.


 - Florian


>>
>> Hi. I'm creating a Doc in alfresco with Name = "Hello World" and 
>> FileName
>> "hello-world.txt"
>>
>>            Dim properties As IDictionary(Of String, Object) = New
>> Dictionary(Of String, Object)()
>>             properties(PropertyIds.Name) = "Hello World"
>>             properties(PropertyIds.ObjectTypeId) =
>> Enums.CmisValue.GetCmisValue(Enums.BaseTypeId.CmisDocument)
>>             Dim contentStream As Data.Impl.ContentStream = New
>> Data.Impl.ContentStream()
>>             contentStream.FileName = "hello-world.txt"
>>             contentStream.MimeType = "text/plain"
>>             contentStream.Length = content.Length
>>             contentStream.Stream = new Filestream("hello-world.txt",
>> FileMode.Open)
>>             folder.CreateDocument(properties, contentStream, 
>> Nothing)
>>
>> But when I fetch the Document by Id I get "Hello World" in both 
>> fields.
>> FileName is lost...
>>


Re: DotCMIS Document's Name and FileName.

Posted by José Luís Vaquero <jl...@gmail.com>.
>
> Hi. I'm creating a Doc in alfresco with Name = "Hello World" and FileName
> "hello-world.txt"
>
>            Dim properties As IDictionary(Of String, Object) = New
> Dictionary(Of String, Object)()
>             properties(PropertyIds.Name) = "Hello World"
>             properties(PropertyIds.ObjectTypeId) =
> Enums.CmisValue.GetCmisValue(Enums.BaseTypeId.CmisDocument)
>             Dim contentStream As Data.Impl.ContentStream = New
> Data.Impl.ContentStream()
>             contentStream.FileName = "hello-world.txt"
>             contentStream.MimeType = "text/plain"
>             contentStream.Length = content.Length
>             contentStream.Stream = new Filestream("hello-world.txt",
> FileMode.Open)
>             folder.CreateDocument(properties, contentStream, Nothing)
>
> But when I fetch the Document by Id I get "Hello World" in both fields.
> FileName is lost...
>