Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Need to use admin index creation function when creating indexes #161

Closed
paxtonhare opened this issue Dec 16, 2013 · 4 comments
Closed

Need to use admin index creation function when creating indexes #161

paxtonhare opened this issue Dec 16, 2013 · 4 comments
Labels

Comments

@paxtonhare
Copy link
Contributor

Right now we are passing in the index xml directly from ml-config.xml into the admin API functions to create indexes:

declare function setup:add-range-element-attribute-indexes-R(
  $admin-config as element(configuration),
  $database as xs:unsignedLong,
  $index-configs as element(db:range-element-attribute-index)*) as element(configuration)
{
  if ($index-configs) then
    setup:add-range-element-attribute-indexes-R(
      admin:database-add-range-element-attribute-index($admin-config, $database, $index-configs[1]),
      $database,
      fn:subsequence($index-configs, 2))
  else
    $admin-config
};

Instead, we need to use the appropriate admin API function to create the index xml prior to calling the create function(s):

admin:database-range-element-attribute-index(...)

This keeps dirty xml from making its way into the server xml configs. If dirty xml gets in there then bad things happen.

@grtjn
Copy link
Contributor

grtjn commented Apr 23, 2014

This would also apply to appserver namespaces, schemas, module-locations, request-blackouts, and potentially more?

I'd expect server-side validation should prevent bad xml entering server configs. Apparently not?

@grtjn
Copy link
Contributor

grtjn commented May 12, 2014

Got caught by this issue as well. If you capture existing indexes in which some namespace-uris are empty, the relevant namespace-uri elements are left out. Current bootstrap injects that XML without complaints, but if you try to view the indexes from the Admin interface, that will show a big error message. The indexes are unavailable as well.

@grtjn
Copy link
Contributor

grtjn commented May 12, 2014

Have a fix, will push after pull request gets merged.

@grtjn
Copy link
Contributor

grtjn commented Feb 23, 2015

This looks fixed, in dev and master..

@grtjn grtjn closed this as completed Feb 23, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants