Extension:  Excel resource XLS file.

Extension:  Excel resource XLS file.

  
Hi

I created an extension titled "Platform_BootStrap", then i inserted the excel file into the resource, and published the extension, the file was added.

I then preceded to created an eSpace with the same name "Platform_BootStrap", added function to import the excel sheets, and referenced the "Platform_BootStrap" extension that I previous created.

When I run the eSpace web application to import the excel data, an error message occurs, apparently the application can not find the excel file at ""http://" + MachineName + GetOwnerURLPath() + "BootStrapData.xls"". So I had a look at the physical directory "C:\Program Files\OutSystems\Platform Server\running\Platform_BootScrap......." it's definitely not there.

So I copied the excel file manually to the directory enlisted above, and ran the eSpace web application again -- everything works fine as expected.

The problem is the "Platform_BootStrap" extension does not copy the excel file to the directory enlisted above.

Did i miss something?
When an eSpace "ExampleApp" referencing an extension with the resource "exampledata.xls"
where is this resource file published to?

http://<machineName>/ExampleApp/exampledata.xls ?

Hi Robert,

When you include a file an extension, via Integration Studio, there are 4 "Deploy Action:"s:
  • Ignore - file won't be included in the extension
  • Copy to binaries directory - file will be deployed next to the other binaries (<Application>/bin/<file> or <Application>/bin2/<file>), these files won't be accessible within a web-request
  • Copy to Application directory - file will be located at the root of the application ( <Application>/<file>)
  • Copy to Images directory - file will be located at the images directory: <Application>/img/<file>.

Regards,
João Portela
Hi joao "Copy to Application directory - file will be located at the root of the application (

Hi Robert,

Follow the steps to set the "Deploy Action" for each extension file:
  • Open the extension with the Integration Studio
  • In the let tree there are 2 tabs: "Extension" and "Resources". Select Resources.
  • Now the left three display the available resource files of the extension
  • Search for the file you want to set the "Deploy Action".
  • Double click on the file
  • On thre right side, a new tab will open. the tab name will have the name of the resource
  • there will be a combo option (named "Deploy Action")
  • Here select the option you want. In this case "Copy to Application Directory". Pressing F1 you'll have additional help information.
  • Publish your extension to your server.
Just another information. You can also add files to the espaces/applications in the Service Studio (5.0, in older Service Studio version you'll have to use another application, named "OmlResources", which add the resources to your espace).

Regards,
João Portela


Thanks Joao

The feature was hidden away, found it now and have made use of it.



How can i use this file in the c# code?
 
Hi Filipe,

You goal is to read a file included in the extension? If so, you need to set the file deploy action to "application directory" or "images directory and used one of the following ways:
  • fetch the file using a http-get function (since the file was deployed to a known path/URL);
  • read the file using HttpRequest.PhysicalApplicationPath method concatenated with the file name.

regards,
João Portela
Hi Filipe,

Another suggestion is that instead of deploying your file, set it as ignore.
Then inside your extension code (in Visual Studio), include it in the project and set it the Build Action of the file to Embebbed Resource.

In your code you can get a stream to that file by using:
typeof(YourClassName).Assembly.GetManifestResourceStream("YourFilename.extension")

This way your file is included inside the dll, instead of you having to worrie about folder and disk paths.

Regards,
João Rosado




João Portela wrote:
Hi Filipe,

You goal is to read a file included in the extension? If so, you need to set the file deploy action to "application directory" or "images directory and used one of the following ways:
  • fetch the file using a http-get function (since the file was deployed to a known path/URL);
  • read the file using HttpRequest.PhysicalApplicationPath method concatenated with the file name.

regards,
João Portela
 
 Solved.Thank you