manifoldcf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karl Wright (JIRA)" <>
Subject [jira] [Commented] (CONNECTORS-1403) Update WebCrawler Connector HTML String to Velocity Template
Date Tue, 02 May 2017 08:55:04 GMT


Karl Wright commented on CONNECTORS-1403:

[~kishorekumar], I've looked a bit at the code.  Some comments.

(1) Since this is the first connector to use the new UI style, I think we have to be very
careful to make these changes in a manner that other people can easily replicate for other
connectors.  I don't see that this code quite achieves that yet.  Let's work for a while longer
to get it to the point where it meets that goal.  I expect we will be needing to add connector
support in the framework javascript to accomplish it.  As a simple example, this method seems
like it would be something that all connectors would need to do:

<script type="text/javascript">
      $('#accordion-session-access .btn-danger').hover(function(){

      $('.collapse').on('', function () {
        var collapseId = $(this).attr("id");

      //if post-back, open the same collapse
          var collapseId = sessionStorage.getItem("webcrawler_session_collapse");
          if(collapseId) {
              //Remove the previous selected Pane.
            $("#accordion-session-access .in").removeClass("in");

            $('#' + collapseId).collapse("show");

(2) The indentation of the Velocity template commands doesn't line up for me and I'm therefore
having trouble following the code.  I try to have the indent level of the Velocity commands
operate independently of the HTML they are embedded in.  It would help greatly to check the
formatting and adjust this so I can read the code easier.

(3) Switching the extension of the velocity templates from (*.js, *.html)  to (*.js.vm, *.html.vm)
makes my editor (at least) not recognize the code as fundamentally Javascript or HTML.  While
I can reprogram accordingly, I am wondering why you chose to do that?

(4) Looking at editConfiguration_Access.vm.html, there's code that I don't understand here
that also seems like it should somehow be a framework responsibility.  Can you fill me in
on what the purpose is of the following conditional:

        #if($authPageMap["pageType"] == "form")

(5) Most of the <div> classes, and why they are the appropriate ones to use, seem opaque
to me, as does the level of nesting.  Is there any way to abstract from these so that the
connector UI writer has less flexibility but also a lot less to worry about?  For example,
have a look at editConfiguration_Access.html:

      <div class="panel panel-default">
        <div class="panel-body">
          <div class="row">
            <div class="col-md-12">
              <div class="form-group">
                <div class="row">
                  <div class="col-md-4">
                    <label class="control-label" for="${PREFIX}_loginpageregexp">$Encoder.bodyEscape($ResourceBundle.getString('WebcrawlerConnector.LoginURLRegularExpression'))</label>
                    <input class="form-control" type="text" size="30" name="${PREFIX}_loginpageregexp"
id="${PREFIX}_loginpageregexp" value=""/>
                  <div class="col-md-8">
                    <label class="control-label">$Encoder.bodyEscape($ResourceBundle.getString('WebcrawlerConnector.PageType'))</label>
                    <div class="checkbox">
                      <label class="checkbox-inline"><input type="radio" name="${PREFIX}_loginpagetype"
value="form" checked=""/>$Encoder.bodyEscape($ResourceBundle.getString('WebcrawlerConnector.FormName'))</label>
                      <label class="checkbox-inline"><input type="radio" name="${PREFIX}_loginpagetype"
                      <label class="checkbox-inline"><input type="radio" name="${PREFIX}_loginpagetype"
                      <label class="checkbox-inline"><input type="radio" name="${PREFIX}_loginpagetype"

Honestly, this is way more UI detail than you could ever hope to get from a connector author.


> Update WebCrawler Connector HTML String to Velocity Template
> ------------------------------------------------------------
>                 Key: CONNECTORS-1403
>                 URL:
>             Project: ManifoldCF
>          Issue Type: Improvement
>          Components: Web connector
>    Affects Versions: ManifoldCF 2.7
>            Reporter: Kishore Kumar
>            Assignee: Kishore Kumar
>            Priority: Minor
>             Fix For: ManifoldCF 2.8
> Hi,
> I am currently in the process of converting the stringified HTML to Velocity template
for WebCrawler connector. This is the first attempt in updating all the connectors to use
velocity template.
> I don't know when we are planning for the code freeze but will try to complete by next
> Thanks,
> Kishore Kumar

This message was sent by Atlassian JIRA

View raw message