Project

General

Profile

« Previous | Next » 

Revision 3315

Added by barteau over 17 years ago

Initial checkin. This particular form probably won't be used, however, it is provided here as an example of using the new "Delete" API.

View differences:

lib/style/skins/knp/SaeonDelete.jspx
1
<?xml version="1.0" encoding="UTF-8"?>
2
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0">
3
    
4
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
5
    <jsp:directive.page import="edu.ucsb.nceas.metacat.clientview.ClientViewHelper"/>
6
    <jsp:directive.page import="edu.ucsb.nceas.metacat.clientview.ClientView"/>
7
    
8
    <jsp:declaration>
9
        private ClientViewHelper            clientViewHelper;
10
    </jsp:declaration>
11
    
12
    <html xmlns="http://www.w3.org/1999/xhtml">
13
        <head>
14
        </head>
15
        <body>
16
            <jsp:useBean id="clientViewBean" scope="session" class="edu.ucsb.nceas.metacat.clientview.ClientView"/>
17
            <jsp:setProperty name="clientViewBean" property="*"/>
18
            
19
            <jsp:scriptlet>
20
                clientViewHelper = ClientViewHelper.clientViewHelperInstance(request);
21
                clientViewHelper.clientRequest(request, response);
22
                if (clientViewHelper.isLoggedIn()) {
23
            </jsp:scriptlet>
24
            <br/>
25
            <table bgcolor="WhiteSmoke">
26
                <tr>
27
                    <td colspan="3">
28
                        
29
                        <form name="scopeForm" method="post" action="SaeonDelete.jspx">
30
                            <input name="returnfield" type="hidden" value="distinfo/stdorder/digform/digtopt/onlinopt/computer/networka/networkr"/>
31
                            <input name="pathExpr" type="hidden" value="/metadata/distinfo/resdesc"/>
32
                            <jsp:element name="input">
33
                                <jsp:attribute name="name">sessionid</jsp:attribute>
34
                                <jsp:attribute name="type">hidden</jsp:attribute>
35
                                <jsp:attribute name="value"><jsp:getProperty name="clientViewBean" property="sessionid"/></jsp:attribute>
36
                            </jsp:element>
37
                            <p class="regtext">
38
                                <!-- Set the pathValue to the username (the scope) -->
39
                                <jsp:element name="input">
40
                                    <jsp:attribute name="name">pathValue</jsp:attribute>
41
                                    <jsp:attribute name="type">text</jsp:attribute>
42
                                    <jsp:attribute name="value"><jsp:getProperty name="clientViewBean" property="username"/></jsp:attribute>
43
                                    <jsp:attribute name="size">14</jsp:attribute>
44
                                </jsp:element>
45
                                <input name="action" value="Scope" type="submit" class="button_login"/>
46
                                &#xa0;&#xa0;Get a list of existing FGDC data packages for a specified scope.&#xa0;&#xa0;
47
                            </p>
48
                        </form>
49
                        
50
                    </td>
51
                </tr>
52
                
53
                <jsp:scriptlet>
54
                    if (clientViewBean.getMessage(ClientView.SELECT_MESSAGE) != null) {
55
                </jsp:scriptlet>
56
                <tr>
57
                    <td rowspan="3">
58
                        <form name="deleteForm" method="post" action="SaeonDelete.jspx">
59
                            <jsp:element name="input">
60
                                <jsp:attribute name="name">sessionid</jsp:attribute>
61
                                <jsp:attribute name="type">hidden</jsp:attribute>
62
                                <jsp:attribute name="value"><jsp:getProperty name="clientViewBean" property="sessionid"/></jsp:attribute>
63
                            </jsp:element>
64
                            <jsp:expression>clientViewBean.getMessage(ClientView.SELECT_MESSAGE)</jsp:expression>
65
                            <br/>
66
                            <input name="action" type="submit" value="Delete" class="button_login"/>
67
                        </form>
68
                        
69
                    </td>
70
                    <td>
71
                        <p class="regtext">
72
                            Caution: Removes records from metacat server and, if a metadata Doc Id, any associated Doc Id records.
73
                        </p>
74
                    </td>
75
                </tr>
76
                <tr>
77
                    <td>
78
                        <p class="regtext">
79
                            <jsp:scriptlet>if (clientViewBean.getMessage(ClientView.DELETE_MESSAGE) != null) {</jsp:scriptlet>
80
                            <jsp:expression>clientViewBean.getMessage(ClientView.DELETE_MESSAGE)</jsp:expression>
81
                            <jsp:scriptlet>}</jsp:scriptlet>
82
                        </p>
83
                    </td>
84
                </tr>
85
                <jsp:scriptlet>
86
                    }
87
                </jsp:scriptlet>
88
            </table>
89
            
90
            <jsp:scriptlet>
91
                } else {
92
            </jsp:scriptlet>
93
            <span class="regtext">
94
                You must be logged into your user account before deleting a data set.
95
            </span>
96
            <jsp:scriptlet>
97
                }
98
            </jsp:scriptlet>
99
            <p class="regtext">
100
                <form action="SaeonLogin.jspx">
101
                    <input name="action" type="submit" value="Go Back" class="button_login"/>
102
                </form>
103
            </p>
104
            <br/>DEBUG<br/>
105
            action = <jsp:getProperty name="clientViewBean" property="action"/><br/>
106
            qformat = <jsp:getProperty name="clientViewBean" property="qformat"/><br/>
107
            anyfield = <jsp:getProperty name="clientViewBean" property="anyfield"/><br/>
108
            username = <jsp:getProperty name="clientViewBean" property="username"/><br/>
109
            organization = <jsp:getProperty name="clientViewBean" property="organization"/><br/>
110
        </body>
111
    </html>
112
    
113
</jsp:root>
0 114

  

Also available in: Unified diff