Source Code Cross Referenced for DeleteMetadataFieldsConfirm.java in  » Content-Management-System » dspace » org » dspace » app » xmlui » aspect » administrative » registries » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Content Management System » dspace » org.dspace.app.xmlui.aspect.administrative.registries 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * DeleteMetadataFieldsConfirm.java
003:         *
004:         * Version: $Revision: 1.0 $
005:         *
006:         * Date: $Date: 2006/07/13 23:20:54 $
007:         *
008:         * Copyright (c) 2002, Hewlett-Packard Company and Massachusetts
009:         * Institute of Technology.  All rights reserved.
010:         *
011:         * Redistribution and use in source and binary forms, with or without
012:         * modification, are permitted provided that the following conditions are
013:         * met:
014:         *
015:         * - Redistributions of source code must retain the above copyright
016:         * notice, this list of conditions and the following disclaimer.
017:         *
018:         * - Redistributions in binary form must reproduce the above copyright
019:         * notice, this list of conditions and the following disclaimer in the
020:         * documentation and/or other materials provided with the distribution.
021:         *
022:         * - Neither the name of the Hewlett-Packard Company nor the name of the
023:         * Massachusetts Institute of Technology nor the names of their
024:         * contributors may be used to endorse or promote products derived from
025:         * this software without specific prior written permission.
026:         *
027:         * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
028:         * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
029:         * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
030:         * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
031:         * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
032:         * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
033:         * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
034:         * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
035:         * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
036:         * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
037:         * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
038:         * DAMAGE.
039:         */
040:        package org.dspace.app.xmlui.aspect.administrative.registries;
041:
042:        import java.sql.SQLException;
043:        import java.util.ArrayList;
044:
045:        import org.dspace.app.xmlui.cocoon.AbstractDSpaceTransformer;
046:        import org.dspace.app.xmlui.wing.Message;
047:        import org.dspace.app.xmlui.wing.WingException;
048:        import org.dspace.app.xmlui.wing.element.Body;
049:        import org.dspace.app.xmlui.wing.element.Division;
050:        import org.dspace.app.xmlui.wing.element.PageMeta;
051:        import org.dspace.app.xmlui.wing.element.Para;
052:        import org.dspace.app.xmlui.wing.element.Row;
053:        import org.dspace.app.xmlui.wing.element.Table;
054:        import org.dspace.authorize.AuthorizeException;
055:        import org.dspace.content.MetadataField;
056:        import org.dspace.content.MetadataSchema;
057:
058:        /**
059:         * Prompt the user with a list of to-be-deleted metadata fields and
060:         * ask the user if they are sure they want them deleted.
061:         * 
062:         * @author Scott phillips
063:         */
064:        public class DeleteMetadataFieldsConfirm extends
065:                AbstractDSpaceTransformer {
066:
067:            /** Language Strings */
068:            private static final Message T_dspace_home = message("xmlui.general.dspace_home");
069:            private static final Message T_submit_delete = message("xmlui.general.delete");
070:            private static final Message T_submit_cancel = message("xmlui.general.cancel");
071:            private static final Message T_title = message("xmlui.administrative.registries.DeleteMetadataFieldsConfirm.title");
072:            private static final Message T_metadata_registry_trail = message("xmlui.administrative.registries.general.metadata_registry_trail");
073:            private static final Message T_trail = message("xmlui.administrative.registries.DeleteMetadataFieldsConfirm.trail");
074:            private static final Message T_head = message("xmlui.administrative.registries.DeleteMetadataFieldsConfirm.head");
075:            private static final Message T_para1 = message("xmlui.administrative.registries.DeleteMetadataFieldsConfirm.para1");
076:            private static final Message T_warning = message("xmlui.administrative.registries.DeleteMetadataFieldsConfirm.warning");
077:            private static final Message T_para2 = message("xmlui.administrative.registries.DeleteMetadataFieldsConfirm.para2");
078:            private static final Message T_column1 = message("xmlui.administrative.registries.DeleteMetadataFieldsConfirm.column1");
079:            private static final Message T_column2 = message("xmlui.administrative.registries.DeleteMetadataFieldsConfirm.column2");
080:            private static final Message T_column3 = message("xmlui.administrative.registries.DeleteMetadataFieldsConfirm.column3");
081:
082:            public void addPageMeta(PageMeta pageMeta) throws WingException {
083:                pageMeta.addMetadata("title").addContent(T_title);
084:                pageMeta.addTrailLink(contextPath + "/", T_dspace_home);
085:                pageMeta.addTrailLink(contextPath + "/admin/metadata-registry",
086:                        T_metadata_registry_trail);
087:                pageMeta.addTrail().addContent(T_trail);
088:            }
089:
090:            public void addBody(Body body) throws WingException, SQLException,
091:                    AuthorizeException {
092:                // Get all our parameters
093:                String idsString = parameters.getParameter("fieldIDs", null);
094:
095:                ArrayList<MetadataField> fields = new ArrayList<MetadataField>();
096:                for (String id : idsString.split(",")) {
097:                    MetadataField field = MetadataField.find(context, Integer
098:                            .valueOf(id));
099:                    fields.add(field);
100:                }
101:
102:                // DIVISION: metadata-field-confirm-delete
103:                Division deleted = body.addInteractiveDivision(
104:                        "metadata-field-confirm-delete", contextPath
105:                                + "/admin/metadata-registry",
106:                        Division.METHOD_POST,
107:                        "primary administrative metadata-registry");
108:                deleted.setHead(T_head);
109:                deleted.addPara(T_para1);
110:                Para warning = deleted.addPara();
111:                warning.addHighlight("bold").addContent(T_warning);
112:                warning.addContent(T_para2);
113:
114:                Table table = deleted.addTable("field-confirm-delete", fields
115:                        .size() + 1, 3);
116:                Row header = table.addRow(Row.ROLE_HEADER);
117:                header.addCell().addContent(T_column1);
118:                header.addCell().addContent(T_column2);
119:                header.addCell().addContent(T_column3);
120:
121:                for (MetadataField field : fields) {
122:                    if (field == null)
123:                        continue;
124:
125:                    String fieldID = String.valueOf(field.getFieldID());
126:                    String fieldEelement = field.getElement();
127:                    String fieldQualifier = field.getQualifier();
128:
129:                    MetadataSchema schema = MetadataSchema.find(context, field
130:                            .getSchemaID());
131:                    String schemaName = schema.getName();
132:
133:                    String fieldName = schemaName + "." + fieldEelement;
134:                    if (fieldQualifier != null && fieldQualifier.length() > 0)
135:                        fieldName += "." + fieldQualifier;
136:
137:                    String fieldScopeNote = field.getScopeNote();
138:
139:                    Row row = table.addRow();
140:                    row.addCell().addContent(fieldID);
141:                    row.addCell().addContent(fieldName);
142:                    row.addCell().addContent(fieldScopeNote);
143:                }
144:                Para buttons = deleted.addPara();
145:                buttons.addButton("submit_confirm").setValue(T_submit_delete);
146:                buttons.addButton("submit_cancel").setValue(T_submit_cancel);
147:
148:                deleted.addHidden("administrative-continue").setValue(
149:                        knot.getId());
150:            }
151:        }
w_ww_._ja___va2___s__._c_o_m_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.