Ignore:
Timestamp:
04/04/14 13:44:41 (11 years ago)
Author:
Twan Goosen
Message:

added search page link to record page

Location:
vlo/branches/vlo-3.0/vlo-web-app/src/main
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/RecordPage.html

    r4733 r4899  
    4646
    4747                <wicket:container wicket:id="navigation"></wicket:container>
     48
    4849                <h1 wicket:id="name" id="recordtitle">[TITLE]</h1>
     50
    4951                <div id="recorddetails">
    5052                    <a wicket:id="landingPageLink" id="recordlandingpage">Show this record in its original context</a>
    5153                    <wicket:container wicket:id="documentProperties">[PROPERTIES TABLE]</wicket:container>
     54                </div>
     55
     56                <div wicket:id="searchlinks" id="recordsearchpage">
     57                    <h2>Search</h2>
     58                    <ul>
     59                        <li wicket:id="searchPage"><a wicket:id="searchLink">Go to the search page for this record</a></li>
     60                        <!--<li><a href="">Perform a content search in this record</a></li>-->
     61                    </ul>
    5262                </div>
    5363
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/RecordPage.java

    r4872 r4899  
    2525import eu.clarin.cmdi.vlo.wicket.panels.record.ResourceLinksPanel;
    2626import eu.clarin.cmdi.vlo.wicket.components.SolrFieldLabel;
     27import eu.clarin.cmdi.vlo.wicket.model.CollectionListModel;
    2728import eu.clarin.cmdi.vlo.wicket.model.HandleLinkModel;
    2829import eu.clarin.cmdi.vlo.wicket.model.SolrDocumentModel;
     
    4344import org.apache.wicket.markup.html.basic.Label;
    4445import org.apache.wicket.markup.html.link.ExternalLink;
     46import org.apache.wicket.markup.html.list.ListItem;
     47import org.apache.wicket.markup.html.list.ListView;
    4548import org.apache.wicket.model.IModel;
    4649import org.apache.wicket.model.Model;
     
    130133        add(createCmdiContent("cmdi"));
    131134        add(new FieldsTablePanel("technicalProperties", new DocumentFieldsProvider(getModel(), technicalPropertiesFilter)));
     135
     136        createSearchLinks("searchlinks");
    132137    }
    133138
     
    178183    }
    179184
     185    private void createSearchLinks(String id) {
     186        final SolrFieldModel<String> searchPageModel = new SolrFieldModel<String>(getModel(), FacetConstants.FIELD_SEARCHPAGE);
     187        final SolrFieldModel<String> searchServiceModel = new SolrFieldModel<String>(getModel(), FacetConstants.FIELD_SEARCH_SERVICE);
     188        add(new WebMarkupContainer(id) {
     189            {
     190                //add links
     191                add(new ListView<String>("searchPage", new CollectionListModel<String>(searchPageModel)) {
     192
     193                    @Override
     194                    protected void populateItem(ListItem item) {
     195                        item.add(new ExternalLink("searchLink", item.getModel()));
     196                    }
     197                });
     198            }
     199
     200            @Override
     201            protected void onConfigure() {
     202                super.onConfigure();
     203                setVisible(searchPageModel.getObject() != null || searchServiceModel.getObject() != null);
     204            }
     205
     206        });
     207    }
     208
    180209    private Label createCmdiContent(String id) {
    181210        final IModel<String> locationModel = new SolrFieldStringModel(getModel(), FacetConstants.FIELD_FILENAME);
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/record/ResourceLinksPanel.html

    r4872 r4899  
    2424    <body>
    2525        <wicket:panel>
     26            <h2>Resources</h2>
    2627            <wicket:container wicket:id="resource">
    2728                <a class="resourceLink" wicket:id="showResource">
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/webapp/style/vlo-record.css

    r4809 r4899  
    2424}
    2525
     26div#record h2 {
     27    width: 100%;
     28    text-decoration: none;
     29    border-bottom: 1px solid #666;
     30    padding-bottom: 0px;
     31    margin-bottom: 1em;
     32    text-transform: uppercase;
     33}
     34
    2635#recordnavigation p a, #recordcontext p a {
    2736    padding: 0;
     
    119128a.recordattributeinfo:after {
    120129    content: "ℹ";
     130}
     131
     132/* Search links */
     133
     134#recordsearchpage {
     135    margin-top: 1em;
     136}
     137
     138#recordsearchpage li {
     139    display: block;
     140    background: url('search-256.png') no-repeat;
     141    background-size: 32px;
     142    background-position: top left;
     143    height: 40px;
     144    padding-left: 40px;
     145    padding-top: 10px;
    121146}
    122147
Note: See TracChangeset for help on using the changeset viewer.