Changeset 5578


Ignore:
Timestamp:
08/20/14 11:59:28 (10 years ago)
Author:
Twan Goosen
Message:

Also accepting PID resolver URL's for publication without warning. Added help text explaining PID's.

Location:
VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/wizard/CreateVirtualCollectionWizard$ResourcesStep.html

    r5574 r5578  
    1616                        <h4>Add resource or metadata references</h4>
    1717                        <p>
    18                             Click 'add' to add an individual reference of the
     18                            Click <strong>add</strong> to add an individual reference of the
    1919                            type 'Metadata' or 'Resource' and optionally add a
    2020                            label and/or description.
    2121                        </p>
    22                         <p class="last">
    23                             Click 'add more' to add multiple references (one per
     22                        <p>
     23                            Click <strong>add more</strong> to add multiple references (one per
    2424                            line) of one type without labels or resources.
    2525                            Individual resources can be edited at any stage.
     26                        </p>
     27                        <p class="last">
     28                            It is recommended to only use <em>persistent
     29                            identifiers</em> as references. The following are
     30                            examples of valid persistent identifiers:
     31                            <ul>
     32                                <li>hdl:1839/00-0000-0000-0001-305B-C</li>
     33                                <li>doi:10.10.1038/nphys1170</li>
     34                                <li>http://hdl.handle.net/1839/00-0000-0000-0000-0000-4</li>
     35                                <li>http://dx.doi.org/10.1002/0470841559.ch1</li>
     36                            </ul>
    2637                        </p>
    2738                    </div>
  • VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/ReferenceValidator.java

    r5545 r5578  
    3434public class ReferenceValidator extends AbstractValidator<String> {
    3535
    36     private static final Pattern HANDLE_PATTERN = Pattern.compile("^(hdl|doi):[0-9\\.]+\\/.+$");
     36    private static final String HANDLE_SPECIFIC_PART_PATTERN = "[0-9\\.]+\\/.+$";
     37    private static final Pattern HANDLE_PATTERN = Pattern.compile("^(hdl|doi):" + HANDLE_SPECIFIC_PART_PATTERN);
     38    private static final Pattern HANDLE_RESOLVER_PATTERN = Pattern.compile("^http://(hdl\\.handle\\.net|dx\\.doi\\.org|)/" + HANDLE_SPECIFIC_PART_PATTERN);
    3739    private final IValidator<String> urlValidator = new UrlValidator(UrlValidator.NO_FRAGMENTS);
    3840
     
    5456        return validatable.isValid();
    5557    }
    56    
     58
     59    /**
     60     *
     61     * @param uri
     62     * @return true IFF the expression is a URI consisting of a valid handle
     63     * pattern preceded by a handle scheme expression (hdl: or doi:) OR one of
     64     * the accepted handle resolver base URL's (http://hdl.handle.net or
     65     * http://dx.doi.org)
     66     */
    5767    public static boolean isPid(CharSequence uri) {
    58         return HANDLE_PATTERN.matcher(uri).matches();
     68        return HANDLE_PATTERN.matcher(uri).matches()
     69                || HANDLE_RESOLVER_PATTERN.matcher(uri).matches();
    5970    }
    6071
  • VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/webapp/css/_wizard.scss

    r5574 r5578  
    101101        background-color: #ffffe1;
    102102        color: #666666;
    103     }
     103
     104        h4 {
     105            text-align: center;
     106            padding: 3px 0 3px 0;
     107            margin: 0 0 3px 0;
     108            border-width: 0 0 1px 0;
     109            border-style: solid;
     110            border-color: #666666;
     111            color: #666666;
     112            font-size: 100%;
     113        }
     114
     115        p, ul {
     116            margin: 0em 0em 0.5em 0em;
     117            color: #666666;
     118            font-size: 80%;
     119        }
     120
     121        p.last {
     122            margin: 0em;
     123        }
     124    } //div.notes, div.sidenotes
    104125
    105126    div.notes {
     
    111132        float: right;
    112133        width: 198px;
    113         margin: 0 0 10px 10px;
    114     }
    115 
    116     div.notes h4 {
    117         /*
    118         background-image: url(/images/icon_info.gif);
    119         background-repeat: no-repeat;
    120         background-position: top left;
    121         */
    122         text-align: center;
    123         padding: 3px 0 3px 0; /*27px; */
    124         margin: 0 0 3px 0;
    125         border-width: 0 0 1px 0;
    126         border-style: solid;
    127         border-color: #666666;
    128         color: #666666;
    129         font-size: 100%;
    130     }
    131 
    132     div.notes p {
    133         margin: 0em 0em 0.5em 0em;
    134         color: #666666;
    135         font-size: 80%;
    136     }
    137 
    138     div.notes p.last {
    139         margin: 0em;
     134        margin: 0 0 10px 10px;   
    140135    }
    141136
     
    200195    div.modalDialogContent {
    201196        margin: 10px;
    202        
     197
    203198        p {
    204199            margin: 1em;
  • VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/test/java/eu/clarin/cmdi/virtualcollectionregistry/service/impl/VirtualCollectionPrePublicationValidatorTest.java

    r5545 r5578  
    5454        vc.getResources().add(new Resource(Resource.Type.METADATA, "hdl:1234/5678"));
    5555        vc.getResources().add(new Resource(Resource.Type.METADATA, "doi:1.2.3/456"));
     56        vc.getResources().add(new Resource(Resource.Type.METADATA, "http://hdl.handle.net/1234/5678"));
     57        vc.getResources().add(new Resource(Resource.Type.METADATA, "http://dx.doi.org/1.2.3/456"));
    5658        try {
    5759            instance.validate(vc);
Note: See TracChangeset for help on using the changeset viewer.