Results 1 to 2 of 2

Thread: Problem with "domain-name" class

  1. #1

    Default Problem with "domain-name" class

    According to specification found at:
    http://apsstandard.org/doc/package-f...rvice.settings

    You can create a select box filled with user domains by using something like this:
    <setting id="domains" type="domain-name" class="domain-name" >
    <name>Domain</name>
    </setting>
    Apparently it doesn't work, it just generates simple input box. Any ideas?



  2. #2
    Bit Poster
    Join Date
    May 2012
    Location
    Boston
    Posts
    1

    Default

    oh man...I feel your pain...completely undocumented...guess I will take the liberty:

    You want to define like this:

    <name>domain</name>
    <setting type="list" id="domain_name"
    class="domain-name" element-type="domain-name">
    <name>Secondary Domain</name>
    </setting>


    and here's how you would access any selected domains in your install script via php ( they are renamed to domain_name_1, domain_name_2, etc... this can get annoying if you need the user to select a primary domain so my work-around was to have the user select only one domain at first, to define the primary, then select the others by adding more domains after a successful application install - adding more domains will trigger the configure script so you will need to add logic to handle the additional domains in your configure script if you do this and it's definitely a hack...if anyone knows of alternatives please share! ):


    for($i = 1; getenv('SETTINGS_domain_name_' . $i); $i++)
    {
    $domainName = strtolower(trim(getenv('SETTINGS_domain_name_' . $i)));
    // your code here
    }


    two notes:

    1.) I'm not sure if this will still also show an input box or not - if so, you can have this field as hidden and you will still see the domain selection on the client control panel and will still be able to access the user's selected domains in code.

    2.) There's a HUGE gotcha here if you're using the POA XML-RPC API (at least for version 5.3) for the pem.provideApplicationInstance method - I tried providing an array of domain_name and this failed indicating it was expecting a string - so it seems the only thing I could pass in to domain_name via the RPC call was a single domain name value e.g. name = "domain_name" value = "contoso.com". Note that you would still access the value of this parameter using 'SETTINGS_domain_name_1'.

    I hope this helps. Please let me know if I can clarify anything.



Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •