root/lex/trunk/jsp/export.jsp

Revision 26, 1.9 kB (checked in by chris, 5 years ago)

Imported sources

Line 
1 <%@ page import="java.util.*" %>
2 <%@ page import="java.util.regex.*" %>
3 <%@ page import="java.sql.*" %>
4 <%@ page import="jemdros.*" %>
5 <%@ page import="com.qwirx.lex.*" %>
6 <%@ page import="com.qwirx.lex.emdros.*" %>
7 <%@ page import="com.qwirx.lex.sql.*" %>
8 <% response.setContentType("text/plain"); %>
9 <%
10
11         /*
12         if (request.getParameter("features") != null) {
13                 List features = Lex.getNewFeatures();
14                 for (Iterator i = features.iterator(); i.hasNext(); ) {
15                         FeatureInfo f = (FeatureInfo)( i.next() );
16 %>
17 UPDATE OBJECT TYPE [
18         <%= f.objectType %>
19         ADD <%= f.featureName %> : <%= f.featureType %>;
20 ] GO
21 <%
22                 }
23         }
24         */
25        
26         String user = request.getRemoteUser() + "@" + request.getRemoteAddr();
27         SqlDatabase    db     = Lex.getSqlDatabase   (user);
28         EmdrosDatabase emdros = Lex.getEmdrosDatabase(user);
29         int min_m = emdros.getMinM(), max_m = emdros.getMaxM();
30
31         {
32                 Sheaf clauseSheaf = emdros.getSheaf
33                         ("SELECT ALL OBJECTS IN {1-"+max_m+"} "+
34                          "WHERE [clause GET logical_struct_id]");
35                          
36                 SheafConstIterator sci = clauseSheaf.const_iterator();
37                 while (sci.hasNext()) {
38                         Straw straw = sci.next();
39                         MatchedObject clause = straw.const_iterator().next();
40                                
41                         int thisLogicalStructId =
42                                 clause.getEMdFValue("logical_struct_id").getInt();
43                        
44 %>
45 UPDATE OBJECT BY ID_D = <%= clause.getID_D() %>
46 [clause logical_struct_id := <%= thisLogicalStructId %>;]
47 GO
48 <%
49                 }
50         }
51
52         {       
53                 Sheaf phraseSheaf = emdros.getSheaf
54                         ("SELECT ALL OBJECTS IN {1-"+max_m+"} "+
55                          "WHERE [phrase GET argument_name, type_id]");
56                
57                 SheafConstIterator sci = phraseSheaf.const_iterator();
58                 while (sci.hasNext()) {
59                         Straw straw = sci.next();
60                         MatchedObject phrase = straw.const_iterator().next();
61                                
62                         String argName =
63                                 phrase.getEMdFValue("argument_name").getString();
64                         int typeId =
65                                 phrase.getEMdFValue("type_id").getInt();
66                        
67 %>
68 UPDATE OBJECT BY ID_D = <%= phrase.getID_D() %>
69 [phrase
70         argument_name := "<%= argName %>";
71         type_id       := <%= typeId %>;
72 ]
73 GO
74 <%
75                 }
76         }
77 %>
Note: See TracBrowser for help on using the browser.