Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement request - action to dump xml output from ConfigurationLoader #17

Open
danizen opened this issue Jan 19, 2018 · 2 comments
Open

Comments

@danizen
Copy link
Contributor

danizen commented Jan 19, 2018

Apache Velocity is a much easier template engine than many others, but there is still the issue of whether this works:

      <crawlDataStoreFactory class="com.norconex.collector.http.data.store.impl.mongo.MongoCrawlDataStoreFactory">
        <host>$mongo_host</host>
        <dbname>$mongo_dbname</dbname>
        <username>$mongo_username</username>
        <password>$mongo_password</password>
        <mechanism>SCRAM-SHA-1</mechanism>
        #if( $mongo_cached )<cachedCollectionName>$mongo_cached</cachedCollectionName>#endif
        #if ( $mongo_refs )<referencesCollectionName>$mongo_refs</referencesCollectionName>#endif
      </crawlDataStoreFactory>```

Indeed it does not, because the end for directives is #end, but it required some work to figure out what was going on.

@essiembre
Copy link
Contributor

You mean as a command-line option? It has been in the HTTP Collector project internal TODO file for some time now. :-) Could definitely be useful. Marking it.

@danizen
Copy link
Contributor Author

danizen commented Jan 23, 2018

In my implementation, I had the code dump the configuration after loadString, but before conversion to XMLConfiguration. Because of this, I had to re-implement your regular expression thing to strip out DOCTYPE and xml declaration. As a feature, it could even be a dump out of the pretty printed XMLConfiguration after loading as an CollectorConfig with whichever collector contains main() ...

What I'm saying is that I'm not sure what level of validation should be done, before dump out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants