cancel
Showing results for 
Search instead for 
Did you mean: 

ALFRESCO .NET scrivere file e dati

lucagavelli
Champ in-the-making
Champ in-the-making
Buongiorno,
dovrei usare un client creato in VB.NET per scrivere un file e dei dati nell'applicazione ALFRESCO.
Potreste indicarmi qualche esempio o qualche link? Grazie

Luca
2 REPLIES 2

lucagavelli
Champ in-the-making
Champ in-the-making
Tramite dei vostri esempi in C# ho creato uno script in VB.NET per scrivere un file nell'applicazione ALFRESCO, adesso mi servirebbe un aiutino su come passare dei dati (nome, cognome,ecc.ecc.) oltre che il file.

Ecco il pezzo di script in questione:
        Dim parameters As New Dictionary(Of String, String)()
        parameters(SessionParameter.BindingType) = BindingType.AtomPub
        parameters(SessionParameter.AtomPubUrl) = "http://nomerserver/service/cmis"
        parameters(SessionParameter.User) = "admin"
        parameters(SessionParameter.Password) = "admin"
        Dim factory As SessionFactory = SessionFactory.NewInstance()
        Dim session As ISession = factory.GetRepositories(parameters)(0).CreateSession()
        Dim folder As IFolder = session.GetRootFolder()
        Dim properties As IDictionary(Of String, Object) = New Dictionary(Of String, Object)()
        properties(PropertyIds.Name) = "Hello World Document"
        properties(PropertyIds.ObjectTypeId) = "cmis:document"
        Dim content As Byte() = System.Text.UTF8Encoding.UTF8.GetBytes("Hello World!")
        Dim contentStream As New DotCMIS.Data.Impl.ContentStream()
        contentStream.FileName = "hello-world.txt"
        contentStream.MimeType = "text/plain"
        contentStream.Length = content.Length
        contentStream.Stream = New MemoryStream(content)
        Dim doc As IDocument = Folder.CreateDocument(properties, contentStream, Nothing)

Grazie
Luca

mturatti
Champ in-the-making
Champ in-the-making
Luca, le mie competenze .NET sono limitate, ma il seguente libro ha un capitolo interamente dedicato a client .NET verso Alfresco:

http://www.packtpub.com/alfresco-3-web-services-building-applications-using-webscripts-and-cmis/book

Prova a dargli una occhiata, il libro è ottimamente scritto.

Ciao
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.