cancel
Showing results for 
Search instead for 
Did you mean: 

Syntax assistance with a Unity Script and Archiving/Storing a document from file with Unity API

Ryan_Wakefield
World-Class Innovator
World-Class Innovator

So I am attempting to follow the Programmers Guide here on how to Archive/Store New Documents. However, when I add the sample code from the very first step, it doesn't build. It has no clue what "unityApplication.Core.Storage" is. I found a version of that string of code by typing in "Hyland.Unity.Storage", but that errored out saying "'Storage' is a type, which is not valid in the given context".

 

So here is what the documentation says to write (which doesn't work):

Storage storage = unityApplication.Core.Storage;

 

And here is what I wrote (which errors out with the error above):

Storage storage = Hyland.Unity.Storage;

 

So with all of that being said, how do I initialize the Storage object so that I can store a document from a file?

 

Thanks!

1 ACCEPTED ANSWER

Alexander_Tsike
Champ on-the-rise
Champ on-the-rise

Is unityApplication the name of your Hyland.Unity.Application object in your code?  If you're using a Unity Script the default name would be "app", so it would be "Storage storage = app.Core.Storage".

View answer in original post

4 REPLIES 4

Alexander_Tsike
Champ on-the-rise
Champ on-the-rise

Is unityApplication the name of your Hyland.Unity.Application object in your code?  If you're using a Unity Script the default name would be "app", so it would be "Storage storage = app.Core.Storage".

Ok, that is the piece that I was missing. I just needed to change "unityApplication" to "app". I just never thought about doing that.

 

Seems like Hyland needs to make some updates to their SDK site. lol

Hi Ryan,

What Unity script are you using?  The Application object name will change depending on the Unity Script that is being used.  The code in the API Documentation are examples and should not be 1:1 copied into a working environment as configurations may vary from system to system.

 

For example, the IWorkViewExecuteActionButtonScript uses the "unityApplication" so I believe the sample code was pulled from this or a similar Unity script.

 

public class MyUIActionCloseObject : Hyland.Unity.WorkView.IWorkViewExecuteActionButtonScript
{

#region IWorkViewExecuteActionButtonScript
/// <summary>
/// Implementation of <see cref="IWorkViewExecuteActionButtonScript.OnWorkViewExecuteActionButtonScript" />.
/// <seealso cref="IWorkViewExecuteActionButtonScript" />
/// </summary>
/// <param name="unityApplication"></param>
/// <param name="args"></param>
public void OnWorkViewExecuteActionButtonScript(Hyland.Unity.Application unityApplication, Hyland.Unity.WorkView.WorkViewExecuteActionButtonScriptEventArgs args)
{
args.AddUIActionCloseObject(args.Object.Class.ID, args.Object.ID);
}
#endregion
}

Hello @Daniel Quill ,

 

I am using an "IWorkflowScript" Unity Script. And if the name changes between script types, then that just isn't confusing as all get out.

 

[Personal Note] The point of a Programmers Guide is that you can copy and paste the code into your IDE and it should work out the gate. However, it appears that this isn't the case for the Hyland SDK for the Unity API. I guess I just need to be more careful/aware in what I am coding/developing to make sure I am using the proper syntax/naming conventions in that script since they can (and will) potentially change between Unity Script types.

 

Thanks.

Getting started

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.