Changeset 1019
- Timestamp:
- 12/23/10 14:43:21 (13 years ago)
- Location:
- VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/Application.properties
r933 r1019 1 State.PUBLIC: public 2 State.PUBLIC_PENDING: publishing 3 State.PRIVATE: private 4 State.DELETED: deleted 5 State.DEAD: dead 6 Type.EXTENSIONAL: extensional 7 Type.INTENSIONAL: intensional 8 Purpose.RESEARCH: research 9 Purpose.REFERENCE: reference 10 Purpose.SAMPLE: sample 11 Purpose.FUTURE_USE: future-use 12 Reproducibility.INTENDED: intended 13 Reproducibility.FLUCTUATING: fluctuating 14 Reproducibility.UNTENDED: untended 15 Type.METADATA: Metadata 16 Type.RESOURCE: Resource 1 17 collections.publishconfirm: Do you really want to publish "${name}"?\nThe \ 2 18 virtual collection will then be publicly available and you will not be able \ -
VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/VirtualCollectionDetailsPage.html
r1002 r1019 8 8 <wicket:extend> 9 9 <div wicket:id="generalBorder"> 10 <div >10 <div class="property"> 11 11 <label>Name</label> 12 12 <div wicket:id="name"></div> 13 13 </div> 14 <div >14 <div class="property"> 15 15 <label>Type</label> 16 16 <div wicket:id="type"></div> 17 17 </div> 18 <div >18 <div class="property"> 19 19 <label>Creation Date</label> 20 20 <div wicket:id="creationDate"></div> 21 21 </div> 22 22 <wicket:enclosure child="description"> 23 <div >23 <div class="property"> 24 24 <label>Description</label> 25 25 <div wicket:id="description"></div> … … 27 27 </wicket:enclosure> 28 28 <wicket:enclosure child="purpose"> 29 <div >29 <div class="property"> 30 30 <label>Purpose</label> 31 31 <div wicket:id="purpose"></div> … … 33 33 </wicket:enclosure> 34 34 <wicket:enclosure child="reproducibility"> 35 <div >35 <div class="property"> 36 36 <label>Reproducibility</label> 37 37 <div wicket:id="reproducibility"></div> … … 39 39 </wicket:enclosure> 40 40 <wicket:enclosure child="reproducibilityNotice"> 41 <div >41 <div class="property"> 42 42 <label>Reproducibility Notice</label> 43 43 <div wicket:id="reproducibilityNotice"></div> … … 45 45 </wicket:enclosure> 46 46 <wicket:enclosure child="keywords"> 47 <div >47 <div class="property"> 48 48 <label>Keywords</label> 49 49 <div> 50 <ul ><li wicket:id="keywords"><span wicket:id="keyword"></span></li></ul>50 <ul class="keywords"><li wicket:id="keywords"><span wicket:id="keyword"></span></li></ul> 51 51 </div> 52 52 </div> … … 55 55 56 56 <div wicket:id="creatorsBorder"> 57 <ul >57 <ul class="creators"> 58 58 <li wicket:id="creators"> 59 <div >59 <div class="property"> 60 60 <label>Person</label> 61 61 <div wicket:id="person"></div> 62 62 </div> 63 63 <wicket:enclosure child="address"> 64 <div >64 <div class="property"> 65 65 <label>Address</label> 66 66 <div wicket:id="address"></div> … … 68 68 </wicket:enclosure> 69 69 <wicket:enclosure child="email"> 70 <div >70 <div class="property"> 71 71 <label>Email</label> 72 72 <div wicket:id="email"></div> … … 74 74 </wicket:enclosure> 75 75 <wicket:enclosure child="organisation"> 76 <div >76 <div class="property"> 77 77 <label>Organisation</label> 78 78 <div wicket:id="organisation"></div> … … 80 80 </wicket:enclosure> 81 81 <wicket:enclosure child="telephone"> 82 <div >82 <div class="property"> 83 83 <label>Telephone</label> 84 84 <div wicket:id="telephone"></div> … … 86 86 </wicket:enclosure> 87 87 <wicket:enclosure child="website"> 88 <div >88 <div class="property"> 89 89 <label>Website</label> 90 90 <div><a wicket:id="website"></a></div> … … 92 92 </wicket:enclosure> 93 93 <wicket:enclosure child="role"> 94 <div >94 <div class="property"> 95 95 <label>Role</label> 96 96 <div wicket:id="role"></div> … … 106 106 107 107 <div wicket:id="generatedByBorder"> 108 <div >108 <div class="property"> 109 109 <label>Description</label> 110 110 <div wicket:id="generatedBy.description"></div> 111 111 </div> 112 112 <wicket:enclosure child="generatedBy.uri"> 113 <div >113 <div class="property"> 114 114 <label>URI</label> 115 115 <div wicket:id="generatedBy.uri"></div> … … 117 117 </wicket:enclosure> 118 118 <wicket:enclosure child="generatedBy.query.profile"> 119 <div >119 <div class="property"> 120 120 <label>Profile</label> 121 121 <div wicket:id="generatedBy.query.profile"></div> … … 123 123 </wicket:enclosure> 124 124 <wicket:enclosure child="generatedBy.query.value"> 125 <div >125 <div class="property"> 126 126 <label>Value</label> 127 127 <div wicket:id="generatedBy.query.value"></div> … … 130 130 </div> 131 131 132 <a wicket:id="back" href="#">[return to previous page]</a> 132 <div class="collectionDetails buttons"> 133 <a wicket:id="back" href="#">[return to previous page]</a> 134 </div> 133 135 </wicket:extend> 134 136 </body> -
VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/pages/VirtualCollectionDetailsPage.java
r1001 r1019 1 1 package eu.clarin.cmdi.virtualcollectionregistry.gui.pages; 2 2 3 import java. util.ArrayList;3 import java.sql.Date; 4 4 import java.util.Collection; 5 5 import java.util.Iterator; 6 6 import java.util.LinkedList; 7 7 import java.util.List; 8 8 import java.util.Locale; 9 10 import org.apache.commons.lang.time.FastDateFormat; 11 import org.apache.wicket.Application; 9 12 import org.apache.wicket.Component; 10 13 import org.apache.wicket.Page; 11 14 import org.apache.wicket.behavior.AbstractBehavior; 12 15 import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable; 16 import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator; 13 17 import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable; 14 18 import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn; 15 19 import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn; 16 20 import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider; 21 import org.apache.wicket.markup.ComponentTag; 17 22 import org.apache.wicket.markup.html.basic.Label; 18 23 import org.apache.wicket.markup.html.basic.MultiLineLabel; … … 23 28 import org.apache.wicket.markup.html.list.ListItem; 24 29 import org.apache.wicket.markup.html.list.ListView; 30 import org.apache.wicket.markup.html.list.OddEvenListItem; 31 import org.apache.wicket.markup.repeater.Item; 25 32 import org.apache.wicket.model.ComponentPropertyModel; 26 33 import org.apache.wicket.model.CompoundPropertyModel; 27 34 import org.apache.wicket.model.IModel; 28 35 import org.apache.wicket.model.Model; 36 import org.apache.wicket.util.convert.IConverter; 37 import org.apache.wicket.util.string.Strings; 29 38 30 39 import eu.clarin.cmdi.virtualcollectionregistry.gui.border.AjaxToggleBorder; … … 37 46 @SuppressWarnings("serial") 38 47 public class VirtualCollectionDetailsPage extends BasePage { 39 private static final String CSS_CLASS = "collectionsDetails"; 48 private static final IConverter convEnum = new IConverter() { 49 @Override 50 public String convertToString(Object o, Locale locale) { 51 final Enum<?> enumObj = (Enum<?>) o; 52 final String key = 53 enumObj.getDeclaringClass().getSimpleName() + "." + 54 enumObj.name(); 55 final String value = Application.get().getResourceSettings() 56 .getLocalizer().getString(key, null); 57 return Strings.escapeMarkup(value).toString(); 58 } 59 60 @Override 61 public Object convertToObject(String s, Locale locale) { 62 return null; 63 } 64 }; 65 private static final IConverter convDate = new IConverter() { 66 @Override 67 public String convertToString(Object o, Locale locale) { 68 return FastDateFormat.getInstance("yyyy-MM-dd") 69 .format((Date) o); 70 } 71 72 @Override 73 public Object convertToObject(String s, Locale locale) { 74 return null; 75 } 76 }; 77 private static final String CSS_CLASS = "collectionDetails"; 40 78 41 79 /* … … 74 112 components.clear(); 75 113 } 76 } 114 } // class VirtualCollectionDetailsPage.HideIfEmptyBehavior 115 116 private static class CustomLabel extends Label { 117 118 public CustomLabel(String id) { 119 super(id); 120 } 121 122 @Override 123 public IConverter getConverter(Class<?> type) { 124 if (VirtualCollection.Type.class.isAssignableFrom(type) || 125 VirtualCollection.Purpose.class.isAssignableFrom(type) || 126 VirtualCollection.Reproducibility.class.isAssignableFrom(type)) { 127 return convEnum; 128 } 129 if (Date.class.isAssignableFrom(type)) { 130 return convDate; 131 } 132 return super.getConverter(type); 133 } 134 } // class VirtualCollectionDetailsPage.TypeLabel 77 135 78 136 79 137 private final HideIfEmptyBehavior hideIfEmpty = new HideIfEmptyBehavior(); 80 138 81 139 82 140 public VirtualCollectionDetailsPage(final IModel<VirtualCollection> model, 83 141 final Page previousPage) { … … 98 156 add(general); 99 157 general.add(new Label("name")); 100 general.add(new Label("type"));101 general.add(new Label("creationDate"));158 general.add(new CustomLabel("type")); 159 general.add(new CustomLabel("creationDate")); 102 160 general.add(new MultiLineLabel("description").add(hideIfEmpty)); 103 general.add(new Label("purpose").add(hideIfEmpty));104 general.add(new Label("reproducibility").add(hideIfEmpty));161 general.add(new CustomLabel("purpose").add(hideIfEmpty)); 162 general.add(new CustomLabel("reproducibility").add(hideIfEmpty)); 105 163 general.add(new Label("reproducibilityNotice").add(hideIfEmpty)); 106 164 final ListView<String> keywords = new ListView<String>("keywords") { … … 138 196 return new CompoundPropertyModel<Creator>(creators.get(index)); 139 197 } 198 199 @Override 200 protected ListItem<Creator> newItem(int index) { 201 final IModel<Creator> model = 202 getListItemModel(getModel(), index); 203 return new OddEvenListItem<Creator>(index, model) { 204 @Override 205 protected void onComponentTag(ComponentTag tag) { 206 super.onComponentTag(tag); 207 if (getIndex() == 0) { 208 tag.append("class", "first", " "); 209 } 210 } 211 }; 212 } 140 213 }); 141 214 142 215 final Border resources = new AjaxToggleBorder("resourcesBorder", 143 new Model<String>("Resources"), CSS_CLASS );216 new Model<String>("Resources"), CSS_CLASS + " resources"); 144 217 add(resources); 145 218 146 219 final VirtualCollection vc = model.getObject(); 147 final List<IColumn<Resource>> cols = new ArrayList<IColumn<Resource>>(); 148 149 cols.add(new PropertyColumn<Resource>(new Model<String>("Type"), "type")); 150 cols.add(new PropertyColumn<Resource>(new Model<String>("Reference"), "ref")); 151 220 @SuppressWarnings("rawtypes") 221 final IColumn[] cols = new IColumn[2]; 222 cols[0] = new PropertyColumn<Resource>( 223 new Model<String>("Type"), "type") { 224 @Override 225 public void populateItem(Item<ICellPopulator<Resource>> item, 226 String componentId, IModel<Resource> model) { 227 final Resource.Type type = model.getObject().getType(); 228 item.add(new Label(componentId, 229 convEnum.convertToString(type, getLocale()))); 230 } 231 }; 232 cols[1] = new PropertyColumn<Resource>( 233 new Model<String>("Reference"), "ref"); 234 235 @SuppressWarnings("unchecked") 152 236 final DataTable<Resource> resourcesTable = 153 237 new AjaxFallbackDefaultDataTable<Resource>("resourcesTable", -
VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/table/VirtualCollectionTable.properties
r981 r1019 4 4 column.description: Description 5 5 column.created: Created 6 Type.EXTENSIONAL: extensional7 Type.INTENSIONAL: intensional8 State.PUBLIC: public9 State.PUBLIC_PENDING: publishing10 State.PRIVATE: private11 State.DELETED: deleted12 State.DEAD: dead13 6 Relation.LT: less-than 14 7 Relation.LE: less-than or equals -
VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/CreateVirtualCollectionWizard.properties
r906 r1019 1 Type.EXTENSIONAL: extensional2 Type.INTENSIONAL: intensional3 Purpose.RESEARCH: research4 Purpose.REFERENCE: reference5 Purpose.SAMPLE: sample6 Purpose.FUTURE_USE: future-use7 Reproducibility.INTENDED: intended8 Reproducibility.FLUCTUATING: fluctuating9 Reproducibility.UNTENDED: untended10 Type.METADATA: Metadata11 Type.RESOURCE: Resource12 1 keywords.deleteconfirm: Do you really want to delete "{0}"? 13 2 creators.deleteconfirm: Do you really want to delete "${person}"? -
VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/webapp/css/vcr.css
r1015 r1019 213 213 } 214 214 215 form.wizard fieldset, div.wizard div.fieldset { 215 form.wizard fieldset, 216 div.wizard div.fieldset { 216 217 clear: both; 217 218 font-size: 100%; … … 250 251 */ 251 252 252 form.wizard div, div.editDialog div { 253 form.wizard div, 254 div.editDialog div { 253 255 clear: left; 254 256 display: block; … … 304 306 margin: 0 0 5px 0; 305 307 text-align: right; 306 }307 308 div.optional label{309 308 font-weight: normal; 310 309 } 311 310 312 div.required label, label.required { 313 font-weight: bold; 311 div.required label, 312 label.required { 313 font-weight: bold !important; 314 314 } 315 315 … … 692 692 table.collectionsTable.private th.name, 693 693 table.collectionsTable.private td.name { 694 width: 73 6px;694 width: 732px; 695 695 } 696 696 … … 731 731 732 732 table.collectionsTable td.name div.actions { 733 margin: 4px 0 ;733 margin: 4px 0 2px 0; 734 734 } 735 735 … … 864 864 color: #AE0000; 865 865 } 866 867 868 div.collectionDetails div.property { 869 clear: both; 870 font-size: 100%; 871 border: none; 872 padding: 0 10px 0 10px; 873 margin: 0 0 4px 0; 874 } 875 876 div.collectionDetails div label { 877 display: block; 878 float: left; 879 width: 140px; 880 padding: 0px 2px; 881 margin: 0; 882 text-align: right; 883 font-weight: normal; 884 } 885 886 div.collectionDetails div label:after { 887 content: ':'; 888 } 889 890 div.collectionDetails div div { 891 display: block; 892 clear: none; 893 padding: 0px 2px; 894 margin-left: 144px; 895 } 896 897 div.collectionDetails ul.keywords { 898 margin: 0 0 0 16px; 899 padding: 0; 900 list-style: square; 901 } 902 903 div.collectionDetails ul.creators { 904 margin: 0; 905 padding: 0; 906 list-style: none; 907 } 908 909 div.collectionDetails ul.creators li { 910 border-top: 1px dotted #000000; 911 margin-top: 4px; 912 padding-top: 4px; 913 } 914 915 div.collectionDetails ul.creators li.first { 916 border-top: none; 917 margin-top: 0; 918 padding-top: 0; 919 } 920 921 div.collectionDetails.resources { 922 padding: 0 !important; 923 } 924 925 div.collectionDetails.resources table { 926 width: 100%; 927 } 928 929 div.collectionDetails.buttons { 930 margin: 10px 0 10px 0; 931 text-align: center; 932 } 933
Note: See TracChangeset
for help on using the changeset viewer.