Help get this topic noticed by sharing it on Twitter, Facebook, or email.

blobAdapterConfig setting

In my controller the blob adapter has a config section. See image.

In my application I need to accommodate the Path-Template changing. The changes are caused by third parties dealing with network changes, new servers, server names etc.

I need to make the Path-Template easily changed (soft coded). I do not know how to do this. I would need some form of an override and read the value from a web.config file and pass it to the code file.

Any suggestion about this being done in a controller xml file or is there another place I can make the change. Perhaps some form of an override....

1 person has
this question
+1
Reply
  • COT allows you to specify where controllers are located. COT looks for a controller where you've specified first and if the controller isn't found it looks for it in the default folder.

    You could specify a folder and put the controller with the blobadaptor in that folder.
    You could then get the Path-Template detail and change that data in the controller xml file.

    I create xml controllers on the fly for use with my bespoke reporting. I've added this to the end of my SharedBusinessRules: (This obviously includes my namespace)

    namespace SHSStudents.Data
    {
    public partial class Controller
    {
    public override Stream GetDataControllerStream(string controller)
    {
    string fileName = String.Format(@"C:\Database\controllers\{0}.xml", controller);
    if (File.Exists(fileName))
    return new MemoryStream(File.ReadAllBytes(fileName));
    return DefaultDataControllerStream;
    }
    }
    }

    (VB syntax is in COT example below)

    You could set up some code that runs at the start of the app and reads the blobadaptor details from web.config or a json file etc. and then change the data in the controller.
    There's lots of info on the internet that explains how to change data in an xml file.

    COT have an example using virtualisation here:

    https://codeontime.com/learn/data-con...

    It's not quite what you want but it might help put you in the right direction.

    Peter
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly happy, confident, thankful, excited indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • Peter - thanks for the suggestion of overwriting that line in the controller at run time. I had a fleeting about it a few days back and then lost it. I am thinking that I should run down that path and see if it gets me what the customer would like/need.

    In theory it should be simple but in practice I do not know. I think the controller files are compiled when published and I may not be able to get to them to do this. Worth trying though. My fingers are crossed...
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly happy, confident, thankful, excited indifferent, undecided, unconcerned sad, anxious, confused, frustrated