Skip to content

Commit 31cf7f3

Browse files
janiskuljscottdurow
authored andcommitted
Support for RESX WebResources (#297)
DeployWebResourcesTask now supports uploading RESX type of web resource. There is also an option of specifying languagecode.
1 parent e07262d commit 31cf7f3

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

spkl/SparkleXrm.Tasks/Config/WebResource.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ public class WebResourceFile
55
public string uniquename;
66
public string displayname;
77
public string file;
8+
public int? languagecode;
89
public string description;
910
}
1011
}

spkl/SparkleXrm.Tasks/EntitiesTrim.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5443,6 +5443,9 @@ public enum webresource_webresourcetype
54435443

54445444
[System.Runtime.Serialization.EnumMemberAttribute()]
54455445
Vectorformat_SVG = 11,
5446+
5447+
[System.Runtime.Serialization.EnumMemberAttribute()]
5448+
Resourceformat_RESX = 12,
54465449
}
54475450

54485451
/// <summary>

spkl/SparkleXrm.Tasks/Tasks/DeployWebResourcesTask.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ private void DeployWebResource(OrganizationServiceContext ctx, string webresourc
225225
webresource.Description = file.description;
226226
webresource.Content = filecontent;
227227

228+
if (file.languagecode.HasValue)
229+
webresource.LanguageCode = file.languagecode;
230+
228231
if (webresource.Id == Guid.Empty)
229232
{
230233
var webResourceFileInfo = new FileInfo(fullPath);
@@ -267,6 +270,9 @@ private void DeployWebResource(OrganizationServiceContext ctx, string webresourc
267270
case "svg":
268271
filetype = webresource_webresourcetype.Vectorformat_SVG;
269272
break;
273+
case "resx":
274+
filetype = webresource_webresourcetype.Resourceformat_RESX;
275+
break;
270276
default:
271277
_trace.WriteLine("File extension '{0}' unexpected -> '{1}'", webResourceFileInfo.Extension, file.file);
272278
return;

0 commit comments

Comments
 (0)