Include folder structure based on web resource name?

Jun 22, 2011 at 10:53 PM

Proposed: That the name of the Web resource be interpreted as a path for import and export.

Case: Export files: When exporting a web resource named myisv_/FeatureName/Scripts/MyScript.js should be output to a folder:

C:\outputfolder\myisv_\FeatureName\Scripts\MyScript.js

Case: Import Files: If I have a JS Web resource in this folder:

C:\Projects\ProjectName\myIsv_\FeatureName\Scripts\MyScript.js

When I import JS files form this folder I can select the ProjectName folder and a new Web Resource named myisv_/FeatureName/Scripts/MyScript.js would be created.

Coordinator
Jun 24, 2011 at 11:24 AM

Hi tekriter,

Your are not the first to ask this feature but I need some times (or help) to find out how to deal with this feature.

Why ? Because, what will happen if you select the folder "myIsv_" ? Right now, the application will create a new web resource called "FeatureName/Scripts/MyScript.js" instead of "myisv_/FeatureName/Scripts/MyScript.js"...

I could develop an intermediate save dialog that ask for a "Project Name" and prefix it with a double underscore "__" to identify it as a selectable folder for "disk to application" script loading...

What do you think about this behavior? Could it be acceptable?

Coordinator
Jul 19, 2011 at 6:09 AM

Ok, this is done is the latest release

There is still one remaining problem: if the user changes the folder structure or the file name, a new web resource will be created instead of updating the initial one.

Mar 19, 2012 at 12:08 AM

Hi tanguy92,

I have a question regarding this feature.

Description: For example, if I created a javascript file called new_test/test.js and uploaded it to CRM, then in the js web resource manager, I click "export scripts", this file is displayed as test.js under new_test group in the scripts tree view, which is great.

But if I want to edit this file by vs 2011 I have to save this file on the disk first, after saving the file to a folder named "Projects" by clicking "save script to disk", a new_test folder will be created with test.js file in it, then in order to "load the script", I need to select new_test folder so I can see test.js from script tree view.

Problem: I can't publish test.js after editing it, the tool only display 'done!' on the status bar after I click "imports and pulish checked script".

Coordinator
Mar 19, 2012 at 8:15 AM

Hi,

I'm not really sure to understand the steps you perform to reproduce your problem...

How the tool works:

  • When you click on Import (or Import and publish), the tool check if the current checked scripts were saved on the disk.
  • If so, the content of the file is loaded
  • The content is imported (and published, if asked)

So, as far as I understand how you used the tools, editing the file with VS should update the content of the file on disk. Importing it should reload its content and import it to the server...

Mar 19, 2012 at 11:23 PM

Hi tanguy92,

Thanks for the quick reply,

To reproduce my problem

1. Upload a js file to CRM webresource, name like new_test/test.js, with "/" in the name.

2. Use the tool to export this script by click "Export Scripts", then this file is displayed as test.js under "new_test" group in the scripts tree view

3. Right click test.js file and select "edit with VS 2010", the tool will ask you to save the js on the disk before trying to edit it.

4. Save this file on the disk, if I specified a folder called "Project", the tool will create "new_test" folder in the "project" folder and then save the a test.js file in the "new_test" folder.

5. Right click test.js file in the tree view and select "edit with VS 2010" again, the tool still ask you to save the js on the disk before trying to edit it.

6. If use tool to load the test.js file from disk.  It can be edited  with vs 2010, but can't be imported into server.

Hope it makes sense to you. Thanks.


Coordinator
Mar 20, 2012 at 11:02 AM

Hi,

I reproduced the problem and I will post a new version soon.

Thank you for this feedback!