Commit ee9e0eb4 authored by Caleb Weeks's avatar Caleb Weeks

rough attempt at adding support for childMap specification on a query

parent 96caa295
...@@ -297,7 +297,7 @@ module.exports = function restubFromBlQuery(params, cb){ ...@@ -297,7 +297,7 @@ module.exports = function restubFromBlQuery(params, cb){
} }
var templateContentResult = !slingTemplateContent ? templateContent({resourceType, targetPath: sourceMapping ? sourcePath : _path.join(targetPath, curTargetPath), prefix: curTargetPath + jcrContentNode}) : ''; var templateContentResult = !slingTemplateContent ? templateContent({resourceType, targetPath: sourceMapping ? sourcePath : _path.join(targetPath, curTargetPath), prefix: curTargetPath + jcrContentNode, forceChildMap: querySpecification.childMap}) : '';
if(_.isArray(templateContentResult)){ if(_.isArray(templateContentResult)){
allNewNodes = allNewNodes.concat(templateContentResult); allNewNodes = allNewNodes.concat(templateContentResult);
}else{ }else{
...@@ -314,6 +314,8 @@ module.exports = function restubFromBlQuery(params, cb){ ...@@ -314,6 +314,8 @@ module.exports = function restubFromBlQuery(params, cb){
allNewNodes.push({name: pageMode ? _path.join(curTargetPath, "jcr:content", path) : _path.join(curTargetPath, path), value: writeToStubValue}); allNewNodes.push({name: pageMode ? _path.join(curTargetPath, "jcr:content", path) : _path.join(curTargetPath, path), value: writeToStubValue});
}); });
} }
log.debug("creating:", _path.join(targetPath, curTargetPath), " of type ", resourceType); log.debug("creating:", _path.join(targetPath, curTargetPath), " of type ", resourceType);
} }
......
...@@ -15,14 +15,20 @@ module.exports = function templateContent(options){ ...@@ -15,14 +15,20 @@ module.exports = function templateContent(options){
if(!component){return new Error("No component found at: " + resourceType);} if(!component){return new Error("No component found at: " + resourceType);}
var blMap = component.getComponentInheritSettings();
var result={"sling:resourceType":resourceType}; var result={"sling:resourceType":resourceType};
if(!blMap){
return;
}
result["bl:map"]={ci:blMap}; if(options.forceChildMap){
result["bl:map"] = options.forceChildMap;
}else{
var blMap = component.getComponentInheritSettings();
if(!blMap){
return;
}
result["bl:map"]={ci:blMap};
}
// global.bl.fillInComponentTemplateData(template, {noMarking:true}); // global.bl.fillInComponentTemplateData(template, {noMarking:true});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment