Skip to content
This repository was archived by the owner on Jan 22, 2024. It is now read-only.

Commit e8d8a2c

Browse files
committed
adding extra -file for certain file components
1 parent f95e525 commit e8d8a2c

4 files changed

Lines changed: 22 additions & 1 deletion

File tree

dashboard.tar.gz

-5 Bytes
Binary file not shown.

digexp-wcm-design/wcmHelper.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ var authRequest = require('./lib/wcm-authenticated-request'),
4747
curSecure = false,
4848
curPullLibrary = undefined,
4949
cElementsDir = '-elements',
50+
cFile = '-file',
5051
cAuthoringTemplates = 'Authoring Templates';
5152

5253
/**
@@ -307,6 +308,10 @@ init = function(host, port, contentPath, user, password, secure, wcmDir) {
307308
if(dir.indexOf(cElementsDir) != -1){
308309
itemType = wcmRequests.wcmTypes.element;
309310
}
311+
else if (name.indexOf(cFile) != -1){
312+
name = name.substring(0, name.indexOf(cFile));
313+
itemType = wcmRequests.wcmTypes.fileComponent;
314+
}
310315
else if (ext == ".htm" || ext == ".html") {
311316
if (dir.indexOf(libTitle + Path.sep + "Presentation Templates") != -1)
312317
itemType = wcmRequests.wcmTypes.presentationTemplate;
@@ -550,8 +555,24 @@ function updateLocalFile(options, libTitle, data, extension, map){
550555
if(cData.resourceUri && cData.resourceUri.value){
551556
var extStart = cData.resourceUri.value.lastIndexOf('.');
552557
var extEnd = cData.resourceUri.value.lastIndexOf('?');
553-
if(extStart != -1 && (extEnd-extStart != 1))
558+
if(extStart != -1 && (extEnd-extStart != 1))
554559
extension = cData.resourceUri.value.substring(extStart,extEnd);
560+
if(extension != undefined){
561+
var ext = extension;
562+
if (ext == ".htm" || ext == ".html") {
563+
extension = cFile + ext;
564+
} else if (ext== ".css") {
565+
extension = cFile + ext;
566+
} else if (ext == ".txt") {
567+
extension = cFile + ext;
568+
} else if (ext == ".rtf") {
569+
extension = cFile + ext;
570+
} else if (ext == ".png" || ext == ".jpg") {
571+
extension = cFile + ext;
572+
} else if (ext == ".json") {
573+
extension = cFile + ext;
574+
}
575+
}
555576
}
556577
fs.writeFileSync(path + extension, cData.value, "binary");
557578
}

release/digexp-toolkit.zip

427 Bytes
Binary file not shown.

wcm-design.tar.gz

433 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)