Changeset 16541

Show
Ignore:
Timestamp:
19/08/08 16:51:51 (3 months ago)
Author:
watkins
Message:

First step of QB redesign and adding outer join to the interface

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/mnw21/outerjoins_in_the_webapp_16418/intermine/integrate/main/.project

    r11212 r16541  
    2121            </arguments> 
    2222        </buildCommand> 
    23         <buildCommand> 
    24             <name>com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder</name> 
    25             <arguments> 
    26             </arguments> 
    27         </buildCommand> 
    2823    </buildSpec> 
    2924    <natures> 
    3025        <nature>org.eclipse.jdt.core.javanature</nature> 
    31         <nature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</nature> 
    3226    </natures> 
    3327</projectDescription> 
  • branches/mnw21/outerjoins_in_the_webapp_16418/intermine/objectstore/main/.project

    r11211 r16541  
    2121            </arguments> 
    2222        </buildCommand> 
    23         <buildCommand> 
    24             <name>com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder</name> 
    25             <arguments> 
    26             </arguments> 
    27         </buildCommand> 
    2823    </buildSpec> 
    2924    <natures> 
    3025        <nature>org.eclipse.jdt.core.javanature</nature> 
    31         <nature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</nature> 
    3226    </natures> 
    3327</projectDescription> 
  • branches/mnw21/outerjoins_in_the_webapp_16418/intermine/objectstore/main/src/org/intermine/util/StringUtil.java

    r16036 r16541  
    1313import java.util.ArrayList; 
    1414import java.util.Collection; 
     15import java.util.LinkedHashMap; 
    1516import java.util.List; 
     17import java.util.Map; 
    1618import java.util.StringTokenizer; 
    1719import java.util.TreeSet; 
     20 
     21import org.apache.commons.lang.StringUtils; 
    1822 
    1923/** 
     
    436440        return str.length() == 0; 
    437441    } 
     442     
     443    /** 
     444     * Make a Map from the serialized String returned 
     445     * by jQuery.sortable("serialize") 
     446     * @param str the String 
     447     * @return a Map 
     448     */ 
     449    public static Map<String, String> serializedSortOrderToMap(String str) { 
     450        Map returnMap = new LinkedHashMap<String, String>(); 
     451        String[] strArray = str.split("&"); 
     452        for (String path: strArray) { 
     453            returnMap.put(StringUtils.split(path, "[]=")[0], StringUtils.split( 
     454                    path, "[]=")[1]); 
     455        } 
     456        return returnMap; 
     457    } 
     458     
    438459} 
  • branches/mnw21/outerjoins_in_the_webapp_16418/intermine/pathquery/main/.project

    r15986 r16541  
    88        <buildCommand> 
    99            <name>org.eclipse.jdt.core.javabuilder</name> 
    10             <arguments> 
    11             </arguments> 
    12         </buildCommand> 
    13         <buildCommand> 
    14             <name>com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder</name> 
    1510            <arguments> 
    1611            </arguments> 
     
    2924    <natures> 
    3025        <nature>org.eclipse.jdt.core.javanature</nature> 
    31         <nature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</nature> 
    3226    </natures> 
    3327</projectDescription> 
  • branches/mnw21/outerjoins_in_the_webapp_16418/intermine/pathquery/main/src/org/intermine/pathquery/PathQuery.java

    r16473 r16541  
    139139     * @param path a path with the old join style 
    140140     */ 
    141     public void flipJoinStyle(String path) { 
     141    public String flipJoinStyle(String path) { 
    142142        String oldPath = getCorrectJoinStyle(path); 
    143143        if (!oldPath.equals(path)) { 
     
    175175            origNodes.put(transferNode.getPathString(), transferNode); 
    176176        } 
     177        return newPathString; 
    177178    } 
    178179 
  • branches/mnw21/outerjoins_in_the_webapp_16418/intermine/web/main/.project

    r16034 r16541  
    1111            </arguments> 
    1212        </buildCommand> 
    13         <buildCommand> 
    14             <name>com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder</name> 
    15             <arguments> 
    16             </arguments> 
    17         </buildCommand> 
    1813    </buildSpec> 
    1914    <natures> 
    2015        <nature>org.eclipse.jdt.core.javanature</nature> 
    21         <nature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</nature> 
    2216    </natures> 
    2317</projectDescription> 
  • branches/mnw21/outerjoins_in_the_webapp_16418/intermine/web/main/src/org/intermine/dwr/AjaxServices.java

    r16405 r16541  
    1818import java.util.Iterator; 
    1919import java.util.LinkedHashMap; 
     20import java.util.LinkedList; 
    2021import java.util.List; 
    2122import java.util.Map; 
     
    2526import javax.servlet.ServletContext; 
    2627import javax.servlet.http.HttpServletRequest; 
     28import javax.servlet.http.HttpServletResponse; 
    2729import javax.servlet.http.HttpSession; 
    2830 
     
    3133import org.apache.lucene.queryParser.ParseException; 
    3234import org.apache.struts.Globals; 
     35import org.apache.struts.action.ActionForm; 
     36import org.apache.struts.action.ActionForward; 
     37import org.apache.struts.action.ActionMapping; 
    3338import org.apache.struts.util.MessageResources; 
    3439import org.directwebremoting.WebContext; 
     
    4651import org.intermine.objectstore.query.Results; 
    4752import org.intermine.path.Path; 
     53import org.intermine.pathquery.OrderBy; 
    4854import org.intermine.pathquery.PathQuery; 
     55import org.intermine.util.StringUtil; 
    4956import org.intermine.util.TypeUtil; 
    5057import org.intermine.web.autocompletion.AutoCompleter; 
     
    8491import org.intermine.web.logic.widget.config.TableWidgetConfig; 
    8592import org.intermine.web.logic.widget.config.WidgetConfig; 
     93import org.intermine.web.struts.ForwardParameters; 
    8694 
    8795 
     
    10351043    } 
    10361044 
     1045    /** 
     1046     * AJAX request - reorder view. 
     1047     */ 
     1048    public void reorder(String newOrder, String oldOrder) { 
     1049        HttpSession session = WebContextFactory.get().getSession(); 
     1050        List<String> newOrderList = new LinkedList<String>(StringUtil 
     1051                .serializedSortOrderToMap(newOrder).values()); 
     1052        List<String> oldOrderList = new LinkedList<String>(StringUtil 
     1053                .serializedSortOrderToMap(oldOrder).values()); 
     1054 
     1055        List view = SessionMethods.getEditingView(session); 
     1056        ArrayList newView = new ArrayList(); 
     1057 
     1058        for (int i = 0; i < view.size(); i++) { 
     1059            String newi = newOrderList.get(i); 
     1060            int oldi = oldOrderList.indexOf(newi); 
     1061            newView.add(view.get(oldi)); 
     1062        } 
     1063 
     1064        view.clear(); 
     1065        view.addAll(newView); 
     1066    } 
     1067     
     1068    /** 
     1069     * Change a node from outer join to normal and vice-versa. 
     1070     * 
     1071     */ 
     1072    public String setOuterJoin(String pathName) 
     1073    throws Exception { 
     1074        HttpSession session = WebContextFactory.get().getSession(); 
     1075        ServletContext servletContext = session.getServletContext(); 
     1076        ObjectStore os = (ObjectStore) servletContext.getAttribute(Constants.OBJECTSTORE); 
     1077        Model model = os.getModel(); 
     1078        WebConfig webConfig = (WebConfig) servletContext.getAttribute(Constants.WEBCONFIG); 
     1079        List<Path> view = SessionMethods.getEditingView(session); 
     1080        List<OrderBy> sortOrder = SessionMethods.getEditingSortOrder(session); 
     1081        PathQuery query = (PathQuery) session.getAttribute(Constants.QUERY); 
     1082 
     1083        query = query.clone(); 
     1084 
     1085        String newPathString = query.flipJoinStyle(pathName); 
     1086 
     1087        session.setAttribute(Constants.QUERY, query); 
     1088 
     1089        return newPathString; 
     1090    } 
     1091 
    10371092} 
  • branches/mnw21/outerjoins_in_the_webapp_16418/intermine/web/main/src/org/intermine/web/struts/OuterJoinsController.java

    r16473 r16541  
    1313import java.util.Comparator; 
    1414import java.util.HashSet; 
     15import java.util.LinkedHashMap; 
     16import java.util.LinkedList; 
     17import java.util.List; 
    1518import java.util.Map; 
    16 import java.util.Random; 
    1719import java.util.Set; 
    1820import java.util.TreeMap; 
    19  
    20 import org.intermine.web.logic.Constants; 
    21 import org.intermine.path.Path; 
    22 import org.intermine.pathquery.PathNode; 
    23 import org.intermine.pathquery.PathQuery; 
    2421 
    2522import javax.servlet.http.HttpServletRequest; 
     
    3229import org.apache.struts.tiles.ComponentContext; 
    3330import org.apache.struts.tiles.actions.TilesAction; 
     31import org.intermine.path.Path; 
     32import org.intermine.pathquery.PathNode; 
     33import org.intermine.pathquery.PathQuery; 
     34import org.intermine.web.logic.Constants; 
    3435 
    3536/** 
     
    4041public class OuterJoinsController extends TilesAction 
    4142{ 
     43     
     44    private static final String INNER_JOIN = "inner_join"; 
     45    private static final String OUTER_JOIN = "outer_join"; 
     46     
    4247    /** 
    4348     * {@inheritDoc} 
     
    95100        Set<String> clickableNodes = new HashSet<String>(); 
    96101        StringBuffer s = new StringBuffer(); 
    97         Map<String, PathNode> sortedNodes = new TreeMap(comparator); 
    98         sortedNodes.putAll(q.getNodes()); 
    99         for (Map.Entry<String, PathNode> entry : sortedNodes.entrySet()) { 
     102        List<List<PathNode>> rows = new LinkedList<List<PathNode>>(); 
     103        Map<String, String> linkPaths = new LinkedHashMap<String, String>(); 
     104        for (Map.Entry<String, PathNode> entry : q.getNodes().entrySet()) { 
    100105            if (!entry.getValue().isAttribute()) { 
    101106                qNodes.put(entry.getKey(), entry.getValue()); 
    102107                PathNode node = entry.getValue(); 
    103                 if (entry.getKey().indexOf('.') == -1 && entry.getKey().indexOf(':') == -1) { 
    104                     s.append(entry.getKey() + "<BR>"); 
    105                 } else if ((!node.isOuterJoin()) && node.isReference() 
    106                         && ((!node.getConstraints().isEmpty()) 
    107                             || constrainedPaths.contains(entry.getKey()))) { 
    108                     s.append(entry.getKey() + "<BR>"); 
    109                 } else if ((!node.isOuterJoin()) && (!viewAndKids.contains(entry.getKey()))) { 
    110                     s.append(entry.getKey() + "<BR>"); 
     108                // First node 
     109                if (rows.size() == 0) { 
     110                    List<PathNode> row = new LinkedList<PathNode>(); 
     111                    row.add(node); 
     112                    rows.add(row); 
    111113                } else { 
    112                     clickableNodes.add(entry.getKey()); 
    113                     s.append("<A HREF=\"mainChange.do?method=setOuterJoin&amp;path=" 
    114                             + entry.getKey() + "\">" + entry.getKey() + "</A><BR>"); 
     114                    int rowcount = 0; 
     115                    Map<Integer,PathNode> scheduledToAdd = new LinkedHashMap<Integer, PathNode>(); 
     116                    for (List<PathNode> parents : rows) { 
     117                        for (PathNode parent : parents) { 
     118                            if(parent.equals(node.getParent())) { 
     119                                linkPaths.put(node.getPathString().replaceAll(":", "."), node.getParent().getPathString().replaceAll(":", ".")); 
     120                                // Place the node in the next row 
     121                                if(rows.size() <= rowcount) { 
     122                                    List<PathNode> row = new LinkedList<PathNode>(); 
     123                                    row.add(node); 
     124                                    rows.add(row); 
     125                                } else { 
     126                                    scheduledToAdd.put(rowcount+1, node); 
     127//                                  List<PathNode> row = rows.get(rowcount++); 
     128//                                  row.add(node); 
     129                                } 
     130                            } 
     131                        } 
     132                        rowcount++; 
     133                    } 
     134                    for (Integer index : scheduledToAdd.keySet()) { 
     135                        if(rows.size() > index) { 
     136                            rows.get(index).add(scheduledToAdd.get(index)); 
     137                        } else { 
     138                            List<PathNode> row = new LinkedList<PathNode>(); 
     139                            row.add(node); 
     140                            rows.add(row); 
     141                        } 
     142                    } 
    115143                } 
     144                //                if (entry.getKey().indexOf('.') == -1 && entry.getKey().indexOf(':') == -1) { 
     145//                    s.append(entry.getKey() + "<BR>"); 
     146//                } else if ((!node.isOuterJoin()) && node.isReference() 
     147//                        && ((!node.getConstraints().isEmpty()) 
     148//                            || constrainedPaths.contains(entry.getKey()))) { 
     149//                    s.append(entry.getKey() + "<BR>"); 
     150//                } else { 
     151//                    clickableNodes.add(entry.getKey()); 
     152//                    s.append("<A HREF=\"mainChange.do?method=setOuterJoin&amp;path=" 
     153//                            + entry.getKey() + "\">" + entry.getKey() + "</A><BR>"); 
     154//                } 
     155                 
    116156            } 
    117157        } 
    118158 
     159 
     160        request.setAttribute("rows", rows); 
     161        request.setAttribute("linkPaths", linkPaths); 
     162         
    119163        request.setAttribute("outerJoinAllNodes", qNodes); 
    120164        request.setAttribute("outerJoinClickableNodes", clickableNodes); 
  • branches/mnw21/outerjoins_in_the_webapp_16418/intermine/web/main/src/org/intermine/web/struts/QueryBuilderChange.java

    r16485 r16541  
    571571 
    572572    /** 
    573      * Change a node from outer join to normal and vice-versa. 
    574      * 
    575      * @param mapping The ActionMapping used to select this instance 
    576      * @param form The optional ActionForm bean for this request (if any) 
    577      * @param request The HTTP request we are processing 
    578      * @param response The HTTP response we are creating 
    579      * @return an ActionForward object defining where control goes next 
    580      * @exception Exception if the application business logic throws 
    581      */ 
    582     public ActionForward setOuterJoin(ActionMapping mapping, 
    583                                    @SuppressWarnings("unused") ActionForm form, 
    584                                    HttpServletRequest request, 
    585                                    @SuppressWarnings("unused") HttpServletResponse response) 
    586     throws Exception { 
    587         HttpSession session = request.getSession(); 
    588         ServletContext servletContext = session.getServletContext(); 
    589         ObjectStore os = (ObjectStore) servletContext.getAttribute(Constants.OBJECTSTORE); 
    590         Model model = os.getModel(); 
    591         WebConfig webConfig = (WebConfig) servletContext.getAttribute(Constants.WEBCONFIG); 
    592         List<Path> view = SessionMethods.getEditingView(session); 
    593         List<OrderBy> sortOrder = SessionMethods.getEditingSortOrder(session); 
    594         String pathName = request.getParameter("path"); 
    595         PathQuery query = (PathQuery) session.getAttribute(Constants.QUERY); 
    596  
    597         query = query.clone(); 
    598  
    599         query.flipJoinStyle(pathName); 
    600  
    601         session.setAttribute(Constants.QUERY, query); 
    602  
    603         return new ForwardParameters(mapping.findForward("query")).addAnchor(pathName).forward(); 
    604     } 
    605  
    606     /** 
    607573     * AJAX request - expand 
    608574     * 
  • branches/mnw21/outerjoins_in_the_webapp_16418/intermine/web/main/src/org/intermine/web/struts/QueryBuilderPathsController.java

    r15963 r16541  
    1111 */ 
    1212 
     13import java.util.HashSet; 
     14import java.util.LinkedHashMap; 
     15import java.util.List; 
     16import java.util.Map; 
     17import java.util.Set; 
     18 
    1319import javax.servlet.http.HttpServletRequest; 
    1420import javax.servlet.http.HttpServletResponse; 
     
    2026import org.apache.struts.tiles.ComponentContext; 
    2127import org.apache.struts.tiles.actions.TilesAction; 
     28import org.intermine.path.Path; 
     29import org.intermine.pathquery.PathNode; 
    2230import org.intermine.pathquery.PathQuery; 
    2331import org.intermine.web.logic.Constants; 
     
    4755        HttpSession session = request.getSession(); 
    4856        PathQuery query = (PathQuery) session.getAttribute(Constants.QUERY); 
     57        // First merge the query and the view 
     58        PathQuery q = query.clone(); 
     59        Map<String, PathNode> qNodes = q.getNodes(); 
     60        for (Path p : q.getView()) { 
     61            String path = p.toStringNoConstraints(); 
     62            if (!qNodes.containsKey(path)) { 
     63                q.addNode(path); 
     64            } 
     65        } 
     66         
     67        Set<String> constrainedPaths = new HashSet<String>(); 
     68        for (Map.Entry<String, PathNode> entry : q.getNodes().entrySet()) { 
     69            if (entry.getValue().isAttribute()) { 
     70                PathNode node = entry.getValue(); 
     71                if (!node.getConstraints().isEmpty()) { 
     72                    constrainedPaths.add(node.getPrefix()); 
     73                } 
     74            } 
     75        } 
     76         
     77        Set<String> clickableNodes = new HashSet<String>(); 
     78        for (Map.Entry<String, PathNode> entry : q.getNodes().entrySet()) { 
     79            PathNode node = entry.getValue(); 
     80            if (!entry.getValue().isAttribute()) { 
     81                if (entry.getKey().indexOf('.') == -1 
     82                        && entry.getKey().indexOf(':') == -1) { 
     83                } else if ((!node.isOuterJoin()) 
     84                        && node.isReference() 
     85                        && ((!node.getConstraints().isEmpty()) || constrainedPaths 
     86                                .contains(entry.getKey()))) { 
     87                } else { 
     88                    clickableNodes.add(entry.getKey()); 
     89                } 
     90            } 
     91        } 
     92         
     93        request.setAttribute("clickableNodes", clickableNodes); 
     94        request.setAttribute("qNodes", q.getNodes()); 
    4995        request.setAttribute("constraintDisplayValues", MainHelper.makeConstraintDisplayMap(query)); 
    5096    } 
  • branches/mnw21/outerjoins_in_the_webapp_16418/intermine/webapp/main/resources/webapp/WEB-INF/classes/InterMineWebApp.properties

    r16216 r16541  
    127127add summary of fields to the results table or on <img border=0 src=images/show.gif alt=show /> links to add individual \ 
    128128fields to the results. Use <img border=0 src=images/constrain.gif alt=constrain /> links to constrain a value in the query. 
    129 query.currentquery = Constraints on the current query 
     129query.currentquery = Query Overview 
    130130query.currentquery.detail = Click on a class name below to view its fields 
    131131query.empty = no fields constrained 
  • branches/mnw21/outerjoins_in_the_webapp_16418/intermine/webapp/main/resources/webapp/css/query.css

    r12923 r16541  
    5050  border: none;} 
    5151 
    52 table.query td.modelbrowse { 
     52div.modelbrowse { 
    5353  border-right: 1px solid #888;} 
     54   
     55/* Outer Joins diagram */ 
     56li.block { 
     57  list-style:none; 
     58} 
     59 
     60.block { 
     61  border: 2px solid #0090DF; 
     62  background-color: #68BFEF; 
     63  width: 150px;  
     64  height: 70px; 
     65  margin: 10px; 
     66} 
     67 
     68.canvas { 
     69  position: absolute; 
     70  z-index: -10; 
     71} 
     72 
     73.viewTitle { 
     74  background:#1863B8; 
     75  color:white; 
     76} 
     77 
     78.constraintTitle { 
     79  background:#B12A2A; 
     80  color:white; 
     81} 
     82 
     83.currentTitle { 
     84  background:#008000; 
     85  color:white; 
     86} 
  • branches/mnw21/outerjoins_in_the_webapp_16418/intermine/webapp/main/resources/webapp/htmlHead.jsp

    r15438 r16541  
    2727<link rel="stylesheet" type="text/css" href="<html:rewrite page='/theme/theme.css'/>"/> 
    2828 
     29<script src="js/jquery-1.2.6.js" type="text/javascript" ></script> 
     30<script src="js/jquery-ui-personalized-1.5.2.min.js" type="text/javascript"></script> 
     31<script type="text/javascript"> 
     32  jQuery.noConflict(); 
     33</script> 
     34 
    2935<script type="text/javascript" src="<html:rewrite page='/js/prototype.js'/>"></script> 
    30 <script type="text/javascript" src="<html:rewrite page='/js/scriptaculous.js'/>"></script
     36<!-- <script type="text/javascript" src="<html:rewrite page='/js/scriptaculous.js'/>"></script> --
    3137 
    3238<script type="text/javascript" src="<html:rewrite page='/dwr/interface/AjaxServices.js'/>"></script> 
  • branches/mnw21/outerjoins_in_the_webapp_16418/intermine/webapp/main/resources/webapp/js/imdwr.js

    r16177 r16541  
    737737   }); 
    738738} 
     739 
     740function switchJoin(element, pathName) { 
     741   AjaxServices.setOuterJoin(pathName,function(newPathName){ 
     742     jQuery(element).attr('onClick','switchJoin(this,\''+newPathName+'\');'); 
     743   }); 
     744   if(jQuery(element).attr('src').indexOf('hollow')>-1) { 
     745     jQuery(element).attr('src','images/join_full.png'); 
     746   } else { 
     747     jQuery(element).attr('src','images/join_hollow.png'); 
     748   } 
     749} 
  • branches/mnw21/outerjoins_in_the_webapp_16418/intermine/webapp/main/resources/webapp/main.jsp

    r16420 r16541  
    1414 
    1515<script type="text/javascript" src="js/autocompleter.js"></script> 
     16 
    1617<link rel="stylesheet" href="css/autocompleter.css" type="text/css" /> 
    1718 
    18 <table class="query" width="100%" cellspacing="0"> 
     19<%--<table class="query" width="100%" cellspacing="0"> 
    1920  <tr> 
    20     <td rowspan="2" valign="top" width="50%" class="modelbrowse"> 
    21       <tiles:insert page="/mainBrowser.jsp"/> 
    22     </td> 
     21    <td rowspan="2" valign="top" width="50%" class="modelbrowse">--%> 
     22      <div id="mainBrowser" class="modelbrowse" style="float:left;width:50%;margin-right:10px;"><tiles:insert page="/mainBrowser.jsp"/></div> 
     23<div id="viewcol" style="margin-left:50%"> 
     24<%--    </td> 
    2325 
    24     <td valign="top"> 
     26    <td valign="top">--%> 
    2527      <div id="main-paths"> 
    2628        <tiles:insert name="mainPaths.tile"/> 
    2729      </div> 
    28       <tiles:insert page="/mainLogic.jsp"/> 
    29     </td> 
    30   </tr> 
    31  
     30<%--    </td> 
     31  </tr>--%> 
    3232  <a name="constraint-editor"></a> 
    33     <tr> 
    34       <td valign="top"> 
     33<%--    <tr> 
     34      <td valign="top">--%> 
    3535        <div id="mainConstraint"> 
    36           <c:if test="${editingNode != null}"> 
    3736            <tiles:insert name="mainConstraint.tile"/> 
    38           </c:if> 
    3937        </div> 
    40       </td> 
     38<%--      </td> 
    4139    </tr> 
    4240</table> 
     41--%> 
     42<tiles:get name="view.tile"/> 
    4343 
    44 <tiles:insert name="outerjoins.tile"/> 
     44</div> 
     45<%--<tiles:insert name="outerjoins.tile"/>--%> 
    4546 
    4647<!-- /main.jsp --> 
  • branches/mnw21/outerjoins_in_the_webapp_16418/intermine/webapp/main/resources/webapp/mainBrowserLine.jsp

    r16473 r16541  
    6868            <c:set var="fieldNameClass" value="${fieldNameClass} nullReferenceField"/> 
    6969          </c:if> 
    70           <span class="${fieldNameClass}"
     70          <span class="${fieldNameClass}" id="${node.pathString}"
    7171            <c:out value="${node.fieldName}"/> 
    7272          </span> 
  • branches/mnw21/outerjoins_in_the_webapp_16418/intermine/webapp/main/resources/webapp/mainConstraint.jsp

    r15802 r16541  
    2929  swapInputs('bag'); 
    3030} 
     31 
     32jQuery(document).ready(function(){ 
     33  jQuery(".attributeField").draggable({ 
     34         opacity: 0.5, 
     35         revert:true 
     36  }); 
     37 
     38  jQuery("#constraintDrop").droppable({ 
     39    accept: ".attributeField", 
     40    activeClass: 'droppable-active', 
     41    hoverClass: 'droppable-hover', 
     42    drop: function(ev, ui) { 
     43        addConstraint(jQuery(ui.draggable).attr('id')); 
     44    } 
     45  }); 
     46   
     47  jQuery("#viewDrop").droppable({ 
     48    accept: ".attributeField", 
     49    activeClass: 'droppable-active', 
     50    hoverClass: 'droppable-hover', 
     51    drop: function(ev, ui) { 
     52        //addConstraint(jQuery(ui.draggable).attr('id')); 
     53    } 
     54  }); 
     55}); 
    3156</script> 
     57<style> 
     58  .droppable-hover { 
     59    background-color:#6EFFD5; 
     60    border:2px solid #000000; 
     61  } 
     62   
     63  .droppable-active { 
     64    background-color:#67FFAA; 
     65    border:2px solid #00CC99; 
     66  } 
     67   
     68  #constraintDrop { 
     69    min-height:100px; 
     70  } 
     71</style> 
    3272 
    3373 
     
    3777 
    3878<html:form action="/mainAction" styleId="mainForm"> 
    39  
    4079  <html:hidden property="path" value="${editingNode.pathString}"/> 
    4180  <html:hidden property="editingConstraintEditable" value="${editingConstraintEditable}"/> 
     
    5190  <c:if test="${!editingTemplateConstraint}"> 
    5291 
    53     <div class="heading"> 
     92    <div class="heading constraintTitle"> 
    5493      <fmt:message key="query.constrain"/><%--Constraint--%> 
    5594    </div> 
    56  
    57     <div class="body"> 
    58  
     95     
     96    <div class="body" id="constraintDrop"> 
     97  <c:choose> 
     98    <c:when test="${editingNode != null}"> 
    5999      <c:if test="${editingConstraintIndex == null && fn:length(QUERY.allConstraints) > 0}"> 
    60100 
     
    463503      //--> 
    464504      </script> 
     505      </c:when> 
     506      <c:otherwise><i>Drag attributes here to constrain them</i></c:otherwise> 
     507      </c:choose> 
    465508    </div> 
    466509 
    467510  </c:if> 
    468  
    469511</html:form> 
    470512 
  • branches/mnw21/outerjoins_in_the_webapp_16418/intermine/webapp/main/resources/webapp/mainLogic.jsp

    r12787 r16541  
    99 
    1010<html:xhtml/> 
    11 <div class="heading"> 
    12   <fmt:message key="query.constraintLogic"/> 
    13 </div> 
    14 <div class="body"> 
     11<div style="margin-top:10px"> 
     12<strong><fmt:message key="query.constraintLogic"/>:</strong> 
    1513  <c:choose> 
    1614    <c:when test="${param.editExpression != null}"> 
     
    5048  </c:choose> 
    5149</div> 
    52  
    5350<!-- /mainLogic.jsp --> 
  • branches/mnw21/outerjoins_in_the_webapp_16418/intermine/webapp/main/resources/webapp/mainPaths.jsp

    r13116 r16541  
    2424</script> 
    2525 
    26 <div class="heading"> 
     26<div class="heading currentTitle"> 
    2727  <fmt:message key="query.currentquery"/> 
    2828</div> 
     
    3333<br/> 
    3434<c:choose> 
    35   <c:when test="${empty QUERY.nodes}"> 
     35  <c:when test="${empty qNodes}"> 
    3636    <div class="smallnote altmessage"><fmt:message key="query.empty"/></div> 
    3737  </c:when> 
    3838  <c:otherwise> 
    39     <c:forEach var="entry" items="${QUERY.nodes}" varStatus="status"> 
     39    <c:forEach var="entry" items="${qNodes}" varStatus="status"> 
    4040      <div> 
    4141        <div style="white-space: nowrap"> 
    42           <div> 
     42          <div>  
    4343            <c:set var="node" value="${entry.value}"/> 
    4444            <c:if test="${node.indentation > 0}"> 
     
    4646                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    4747              </c:forEach> 
     48            </c:if> 
     49            <c:set var="isClickable" value="false"/> 
     50            <c:forEach items="${clickableNodes}" var="clickable"> 
     51              <c:if test="${node.pathString == clickable}"> 
     52                 <c:set var="isClickable" value="true"/> 
     53              </c:if> 
     54            </c:forEach> 
     55            <c:if test="${isClickable == 'true'}"> 
     56               <img src="images/join_hollow.png" alt="Switch join" title="Switch join" style="v-align:bottom;cursor:pointer" onClick="switchJoin(this,'${node.pathString}');"/> 
    4857            </c:if> 
    4958            <im:viewableSpan path="${node.pathString}" viewPaths="${viewPaths}" test="${!empty node.fieldName}" idPrefix="query"> 
     
    93102                <fmt:param value="${node.fieldName}"/> 
    94103              </fmt:message> 
    95               <html:link action="/mainChange?method=removeNode&amp;path=${node.pathString}" 
    96                          title="${removeNodeTitle}"> 
    97                 <img border="0" src="images/cross.gif" width="13" height="13" 
    98                      title="Remove this constraint"/> 
    99               </html:link> 
     104             <c:choose> 
     105              <%-- View only --%> 
     106              <c:when test="${empty node.constraints}"> 
     107                <html:link action="/viewChange?method=removeFromView&amp;path=${node.pathString}" 
     108                           title="${removeNodeTitle}"> 
     109                  <img border="0" src="images/cross.gif" width="13" height="13" 
     110                       title="Remove this constraint"/> 
     111                </html:link> 
     112              </c:when> 
     113              <%-- Constraint --%> 
     114              <c:otherwise> 
     115                <html:link action="/mainChange?method=removeNode&amp;path=${node.pathString}" 
     116                           title="${removeNodeTitle}"> 
     117                  <img border="0" src="images/cross.gif" width="13" height="13" 
     118                       title="Remove this constraint"/> 
     119                </html:link> 
     120              </c:otherwise> 
     121             </c:choose> 
    100122            </c:if> 
    101123            <c:if test="${lockedPaths[node.pathString]}"> 
     
    199221  </c:otherwise> 
    200222</c:choose> 
     223<tiles:insert page="/mainLogic.jsp"/> 
    201224</div> 
    202225 
  • branches/mnw21/outerjoins_in_the_webapp_16418/intermine/webapp/main/resources/webapp/outerjoins.jsp

    r16420 r16541  
    22<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %> 
    33<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 
     4<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 
     5 
    46<!-- outerjoins.jsp --> 
     7<script src="js/jquery.flydom-3.1.1.js" type="text/javascript" ></script> 
    58 
    6 ${outerJoinText} 
     9<script type="text/javascript" charset="utf-8"> 
     10function drawLine(node1,node2) { 
     11   node1 = '#' + node1.replace('\.','\\.'); 
     12   node2 = '#' + node2.replace('\.','\\.'); 
     13   //$('.block').bind("mousemove", function(){ 
     14   // $('#result').html("top:"+$(this).offset({scroll:false}).top+" left:" + +$(this).offset({scroll:false}).left); 
     15   var x1 = jQuery(node1).offset().left; 
     16   var y1 = jQuery(node1).offset().top; 
     17   //alert(x1+" "+y1); 
     18