pict 1.0.147 → 1.0.148

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -776,7 +776,7 @@ _this13.connectFable(_assertThisInitialized(_this13));// --> Bootstrapping of fa
776
776
  // They will then be available in the Default service provider set as well.
777
777
  _this13.connectPreinitServiceProviderInstance(_this13.UUID);_this13.connectPreinitServiceProviderInstance(_this13.Logging);_this13.connectPreinitServiceProviderInstance(_this13.SettingsManager);// Initialize and instantiate the default baked-in Data Arithmatic service
778
778
  _this13.addAndInstantiateServiceType('EnvironmentData',require('./services/Fable-Service-EnvironmentData.js'));_this13.addServiceType('Template',require('./services/Fable-Service-Template.js'));_this13.addServiceType('MetaTemplate',require('./services/Fable-Service-MetaTemplate.js'));_this13.addServiceType('Anticipate',require('./services/Fable-Service-Anticipate.js'));_this13.addAndInstantiateServiceType('Dates',require('./services/Fable-Service-DateManipulation.js'));_this13.addAndInstantiateServiceType('DataFormat',require('./services/Fable-Service-DataFormat.js'));_this13.addAndInstantiateServiceType('DataGeneration',require('./services/Fable-Service-DataGeneration.js'));_this13.addAndInstantiateServiceType('Utility',require('./services/Fable-Service-Utility.js'));_this13.addServiceType('Operation',require('./services/Fable-Service-Operation.js'));_this13.addServiceType('RestClient',require('./services/Fable-Service-RestClient.js'));_this13.addServiceType('CSVParser',require('./services/Fable-Service-CSVParser.js'));_this13.addServiceType('Manifest',require('manyfest'));_this13.addServiceType('ObjectCache',require('cachetrax'));_this13.addServiceType('FilePersistence',require('./services/Fable-Service-FilePersistence.js'));return _this13;}/* State Accessors */_createClass2(Fable,[{key:"isFable",get:function get(){return true;}},{key:"settings",get:function get(){return this.SettingsManager.settings;}},{key:"settingsManager",get:function get(){return this.SettingsManager;}// For backwards compatibility
779
- },{key:"getUUID",value:function getUUID(){return this.UUID.getUUID();}/* Service Manager Methods */},{key:"addServiceType",value:function addServiceType(pServiceType,pServiceClass){if(this.servicesMap.hasOwnProperty(pServiceType)){// TODO: Check if any services are running?
779
+ },{key:"getUUID",value:function getUUID(){return this.UUID.getUUID();}},{key:"newAnticipate",value:function newAnticipate(){return this.instantiateServiceProviderWithoutRegistration('Anticipate');}/* Service Manager Methods */},{key:"addServiceType",value:function addServiceType(pServiceType,pServiceClass){if(this.servicesMap.hasOwnProperty(pServiceType)){// TODO: Check if any services are running?
780
780
  this.log.warn("Adding a service type [".concat(pServiceType,"] that already exists."));}else{// Add the container for instantiated services to go in
781
781
  this.servicesMap[pServiceType]={};// Add the type to the list of types
782
782
  this.serviceTypes.push(pServiceType);}// Using the static member of the class is a much more reliable way to check if it is a service class than instanceof
@@ -3492,7 +3492,7 @@ if(pApplicationPrototype.hasOwnProperty('default_configuration')){tmpOptions=thi
3492
3492
  var fEntityRender=function fEntityRender(pHash,pData,fCallback){var tmpHash=pHash.trim();var tmpData=_typeof(pData)==='object'?pData:{};var tmpCallback=typeof fCallback==='function'?fCallback:function(){return'';};if(_this58.LogNoisiness>4){_this58.log.trace("PICT Template [fEntityRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(_this58.LogNoisiness>0){_this58.log.trace("PICT Template [fEntityRender]::[".concat(tmpHash,"]"));}var tmpEntity=false;var tmpEntityID=false;var tmpEntityTemplate=false;// This expression requires 2 parts -- a third is optional, and, if present, is the template to render to.
3493
3493
  var tmpAddressParts=tmpHash.split('^');if(tmpAddressParts.length<2){_this58.log.warn("Pict: Entity Render: Entity or entity ID not resolved for [".concat(tmpHash,"]"));return tmpCallback(Error("Pict: Entity Render: Entity or entity ID not resolved for [".concat(tmpHash,"]")),'');}tmpEntity=tmpAddressParts[0].trim();tmpEntityID=tmpAddressParts[1].trim();tmpEntityTemplate=tmpAddressParts[2].trim();if(!isNaN(tmpEntityID)){tmpEntityID=parseInt(tmpEntityID);}else{// This is an address, so we need to get the value at the address
3494
3494
  tmpEntityID=_this58.manifest.getValueByHash({AppData:_this58.AppData,Bundle:_this58.Bundle,Record:tmpData},tmpEntityID);}// No Entity or EntityID
3495
- if(!tmpEntity||!tmpEntityID){_this58.log.warn("Pict: Entity Render: Entity or entity ID not resolved for [".concat(tmpHash,"] Entity: ").concat(tmpEntity," ID: ").concat(tmpEntityID));return tmpCallback(Error("Pict: Entity Render: Entity or entity ID not resolved for [".concat(tmpHash,"] Entity: ").concat(tmpEntity," ID: ").concat(tmpEntityID)),'');}_this58.log.trace("Pict: Entity Render: Entity [".concat(tmpEntity,"] with ID [").concat(tmpEntityID,"] as template [").concat(tmpEntityTemplate,"] from [").concat(tmpHash,"]"));// Now try to get the entity
3495
+ if(!tmpEntity||!tmpEntityID){_this58.log.warn("Pict: Entity Render: Entity or entity ID not resolved for [".concat(tmpHash,"] Entity: ").concat(tmpEntity," ID: ").concat(tmpEntityID));return tmpCallback(Error("Pict: Entity Render: Entity or entity ID not resolved for [".concat(tmpHash,"] Entity: ").concat(tmpEntity," ID: ").concat(tmpEntityID)),'');}if(_this58.LogNoisiness>3){_this58.log.trace("Pict: Entity Render: Entity [".concat(tmpEntity,"] with ID [").concat(tmpEntityID,"] as template [").concat(tmpEntityTemplate,"] from [").concat(tmpHash,"]"));}// Now try to get the entity
3496
3496
  _this58.EntityProvider.getEntity(tmpEntity,tmpEntityID,function(pError,pRecord){if(pError){this.log.error("Pict: Entity Render: Error getting entity [".concat(tmpEntity,"] with ID [").concat(tmpEntityID,"] for [").concat(tmpHash,"]: ").concat(pError),pError);return tmpCallback(pError,'');}// Now render the template
3497
3497
  if(tmpEntityTemplate){return this.parseTemplateByHash(tmpEntityTemplate,pRecord,tmpCallback);}else{return tmpCallback(null,'');}}.bind(_this58));};this.MetaTemplate.addPatternAsync('{~E:','~}',fEntityRender);this.MetaTemplate.addPatternAsync('{~Entity:','~}',fEntityRender);// {~T:Template:AddressOfData~}
3498
3498
  var fTemplateRender=function fTemplateRender(pHash,pData){var tmpHash=pHash.trim();var tmpData=_typeof(pData)==='object'?pData:{};if(_this58.LogNoisiness>4){_this58.log.trace("PICT Template [fTemplateRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(_this58.LogNoisiness>0){_this58.log.trace("PICT Template [fTemplateRender]::[".concat(tmpHash,"]"));}var tmpTemplateHash=false;var tmpAddressOfData=false;// This is just a simple 2 part hash (the entity and the ID)