manifoldcf-dev mailing list archives

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


Kishore Kumar commented on CONNECTORS-1403:

Hi [~daddywri],

Please find the answer in the same order as asked

(1) We are already using a standard framework for UI, which is [Bootstrap|],
with little bit knowledge on how to define [Forms|] in Bootstrarp],
I think this can be achieved. The Access Credentials tab was a bit complex, so I have added
those collapsible panels. The above javascript in (1) only applicable for Access credentials
tab and cannot be used as common for the framework unless we identify such complexity in any
other tab, once identified we can make this code generic and move it to *mcf.js*

(2) I will try to re-indent the velocity code in the vm files. Will try to indent velocity
tags irrespective of html. Do you prefer the indentation to be like below

#set( $SEQPREFIX = 's' + $SEQNUM + '_' )
#if($TABNAME == $ResourceBundle.getString('WebcrawlerConnector.Security') && ${SEQNUM}
<div class="row">
  <div class="col-md-8">
    <ul class="list-group">
  #foreach($TOKEN in $TOKENS)
    #set( $ACCESSDESC = "_" + $foreach.index )
    #set( $ACCESSOPNAME = $SEQPREFIX + "accessop" + $ACCESSDESC )
      <li class="list-group-item">
        <input type="hidden" name="$ACCESSOPNAME" value=""/>
        <input type="hidden" name="${SEQPREFIX}spectoken${ACCESSDESC}" value="$Encoder.attributeEscape($TOKEN)"
        <span class="pull-right">
          <button class="btn btn-xs btn-danger" type="button" onClick='Javascript:${SEQPREFIX}SpecOp("$ACCESSOPNAME","Delete","${SEQPREFIX}token_${foreach.index}")'
class="fa fa-minus-circle fa-fw" aria-hidden="true"></i>$Encoder.attributeEscape($ResourceBundle.getString('WebcrawlerConnector.Delete'))</button>
  #set( $COUNTER = $TOKENS.size() )
  #if($COUNTER == 0)
<div class="row">
  <div class="col-xs-12">
    <div class="alert alert-warning">$Encoder.bodyEscape($ResourceBundle.getString('WebcrawlerConnector.NoAccessTokensPresent'))</div>
<div class="row">
  <div class="col-md-8 form-inline">
    <div class="form-group">
      <input type="hidden" name="${SEQPREFIX}tokencount" value="$COUNTER"/>
      <input type="hidden" name="${SEQPREFIX}accessop" value=""/>
      <label for="${SEQPREFIX}spectoken" class="sr-only">Token:</label>
      <input class="form-control" type="text" name="${SEQPREFIX}spectoken" id="${SEQPREFIX}spectoken"
value="" placeholder="Token" />
    <button class="btn btn-primary" type="button" onClick='Javascript:${SEQPREFIX}SpecAddToken("${SEQPREFIX}token_${COUNTER}")'
class="fa fa-plus-circle fa-fw" aria-hidden="true"></i>$Encoder.attributeEscape($ResourceBundle.getString('WebcrawlerConnector.Add'))</button>
  #foreach($TOKEN in $TOKENS)
    #set( $ACCESSDESC = "_" + $foreach.index )
    #set( $ACCESSOPNAME = $SEQPREFIX + "accessop" + $ACCESSDESC )
<input type="hidden" name="${SEQPREFIX}spectoken${ACCESSDESC}" value="$Encoder.attributeEscape($TOKEN)"
  #set( $COUNTER = $TOKENS.size() )
<input type="hidden" name="${SEQPREFIX}tokencount" value="$COUNTER" />

(3)  I believe .vm is the standard extension used for Velocity templates. By using an extension
specific to velocity helps me differentiating velocity code and errors

(4) Trying to add condition HTML only for page type = form, it was there in the previous code

(5) The connector UI writer should have a little bit of knowledge of Bootstrap framework,
all those div class are standard for each component, The extra div (rows and cols-*-*) are
required to make the application as much responsive as possible on smaller devices.


> 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