You are viewing limited content. For full access, please sign in.

Question

Question

Using SDK, How can I export from LF to Windows to another computer with login and password?

asked on March 19, 2018

Hi all,

Using SDK Script, I'm trying to export PDF from Laserfiche to Windows.

On localhost (Server Laserfiche), no problem. Now I'm trying to export the PDF to another server (Server NAS), but without success.

 

The error is :

"Logon failure: unknown user name or incorrect password"

 

and that's normal!

My question what do I do to export to another computer?

 

This is my SDK.

namespace WorkflowActivity.Scripting.ScriptSDKExport
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Data.SqlClient;
    using System.Text;
    using Laserfiche.RepositoryAccess;
    using Laserfiche.DocumentServices;

    /// <summary>
    /// Offre une ou plusieurs méthodes qui peuvent être exécutées au moment de l'exécution de l'activité de scriptage du flux de travail.
    /// </summary>
    public class Script1 : RAScriptClass92
    {
        /// <summary>
        /// Cette méthode est exécutée quand l'activité est effectuée.
        /// </summary>
        protected override void Execute()
        {
            // Rédigez votre code ici. La propriété BoundEntryInfo accèdera à l'entrée, RASession obtiendra la section de Repository Access
            Laserfiche.DocumentServices.DocumentExporter DocEx = new Laserfiche.DocumentServices.DocumentExporter();
            DocumentInfo DI = Document.GetDocumentInfo(this.BoundEntryId, RASession);
            DocEx.ExportElecDoc(DI, Convert.ToString(GetTokenValue("NomFichier")));
        }
    }
}

Localhost : NomFichier = "C:\\Users\\copyr\\Desktop\\File.pdf" (working)

Nas : NomFichier = "\\\\192.168.1.12\\OneDrive\\File.pdf" (not working).

 

Thanks in advance.

Regards

 

0 0

Answer

SELECTED ANSWER
replied on March 30, 2018

When a Workflow accesses resources outside of itself, it does so as the user that the Workflow Service is set to Log On As

By default it is set to Local System.  To access resources that are somewhere other than the local machine, the Workflow service needs to run as a Domain user that has permissions to the external resource.

2 0

Replies

replied on April 3, 2018

I do not believe that using OneDrive with Workflow will conform to MS guidelines.  In the MS OneDrive Live SDK API documentation, it states:

Apps that interact with OneDrive must conform to these principles:

1.)  Upload files to OneDrive only in response to an explicit user request or choice. Your apps must always ensure that a user intentionally chooses to save any new data to OneDrive. Apps must not upload files to OneDrive automatically without a user making an explicit choice to upload those files.
- Here are some examples of conforming apps:
  A.)  Apps that display an "Upload to OneDrive" or "Share on OneDrive" button that a user must click before each upload of a photo, video, document, or other file.
  B.)  Document-editing apps that require a user to click an "Upload to OneDrive" button initially, so that the app can save that document later without further user interaction.
- Here are some examples of nonconforming apps:
  A.)  Apps that automatically upload to OneDrive any file added to a specific location on a user’s devices.
  B.)  Apps that automatically back up files or folders to OneDrive.
2.)  Use OneDrive for the things that it’s good at. OneDrive includes features both for high-quality document viewing and editing, and for creating and sharing beautiful photo albums. If possible, have your apps take advantage of these features.
3.)  Don't undermine trust in OneDrive. Over the years that OneDrive has been available, users have come to trust it. Preserving that trust is critical and your apps must not undermine it by doing things that users don’t expect, especially with regard to data privacy.
- Here are some examples of conforming apps:
  A.)  Apps that upload documents or photos to OneDrive with user-only access as the default.
  B.)  Apps that warn users that, when the users send a link to their content stored on OneDrive, anyone who receives that link can read the associated files.
- Here's an example of a nonconforming app:
  A.)  An app that makes all shared files in OneDrive publicly accessible by default, without clearly communicating this behavior to users.

 

1 0
replied on March 30, 2018

What is not working? Is the "OneDrive" folder shared so it's visible to the service user specified in the Workflow Server's service login?

0 0
replied on April 3, 2018

@Miruna,

The "OneDrive" folder is shared and visible from Windows but I need to login first. In my mind, using workflow, I need to login too. I don't know how to do this step in my script.

 

@████████

Thank you, i'm going to try this solution.

0 0
replied on March 8, 2019

Where do you reference the information for the library:  Laserfiche.DocumentServices?

I was looking in the Laserfiche Workflow SDK Documentation but it only contains Laserfiche.Workflow.Objects information.

I know there are a couple other libraries not listed in this documentation as well for just using the SDK Script in Laserfiche Workflow.

Just want a clean way to view these libraries and classes much like we do the full SDK version.

You are not allowed to follow up in this post.

Sign in to reply to this post.