Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update beta branch to 5/6 #4

Merged
merged 74 commits into from
May 6, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
187aaa1
Updated unpublished terminology and Edit Dataverse section
May 2, 2014
b7521e2
Updated Publish dataverse
May 2, 2014
e302f5a
Add Validation for Date, Float, Int, Url, Email, etc.
sekmiller May 2, 2014
7807843
Hided the view tab and moved up other tabs, need clean up. (#3830)
xyang02 May 2, 2014
eebcbc7
SPSS ingest plugins, SAV and POR formats.
landreev May 5, 2014
7d2764f
Fixed a test case (closes #3918)
michbarsinai May 5, 2014
522642b
index files based on *version*, not dataset itself #3795
pdurbin May 5, 2014
d38b91c
Converted the Edit Account button from a Primefaces component to a Bo…
May 5, 2014
ac31111
Cleaned up the Advanced Search layout by adding the Primefaces select…
May 5, 2014
c9ba78a
Can now delete a dataset (closes #3544)
michbarsinai May 5, 2014
d339c35
Merge branch 'master' of github.com:IQSS/dataverse
michbarsinai May 5, 2014
84d73b8
Added a command to destroy a dataset. Not connected to any UI at the …
michbarsinai May 5, 2014
e586d71
bug 3770: test metadata block fix on IE. Small test on edit/cancel. …
raprasad May 5, 2014
ce25ab0
Merge branch 'master' of github.com:IQSS/dataverse
raprasad May 5, 2014
ca954c3
Missing semicolon from last commit
raprasad May 5, 2014
ad53cd0
validation anotation is now used by both DatasetField (to test for re…
scolapasta May 5, 2014
64aa054
JAI (java advanced imaging) jars added to the pom.xml. (this is for h…
landreev May 5, 2014
44c6d59
validation anotation is now used by both DatasetField (to test for re…
scolapasta May 5, 2014
fc720b8
validation anotation is now used by both DatasetField (to test for re…
scolapasta May 5, 2014
80c62d3
validation anotation is now used by both DatasetField (to test for re…
scolapasta May 5, 2014
a54bae5
validation anotation is now used by both DatasetField (to test for re…
scolapasta May 5, 2014
89ca22a
validation anotation is now used by both DatasetField (to test for re…
scolapasta May 5, 2014
af431e8
validation anotation is now used by both DatasetField (to test for re…
scolapasta May 5, 2014
909ce46
for a workaround around hibernate issue had to rename overloaded meth…
scolapasta May 5, 2014
841aef2
for a workaround around hibernate issue had to rename overloaded meth…
scolapasta May 5, 2014
103c746
for a workaround around hibernate issue had to rename overloaded meth…
scolapasta May 5, 2014
9545893
Merge origin/master
scolapasta May 5, 2014
724fd90
added validation message for individual datasetFields and datasetFiel…
scolapasta May 5, 2014
464f3c2
added validation message for individual datasetFields and datasetFiel…
scolapasta May 5, 2014
46e1495
moved replicationFor javascript into the ui fragment, so it only gets…
scolapasta May 5, 2014
caf4262
renamed this to DatasetFieldValieValidator
scolapasta May 5, 2014
16d96f3
Add "Select One" to controlled vocab
sekmiller May 5, 2014
43a2e38
put dates on cards, use new file date methods #3701
pdurbin May 5, 2014
50cf23a
added Publication Date facet for files #3925
pdurbin May 5, 2014
a8839da
Additional javascript functions for editing metadata/files to rebind …
raprasad May 5, 2014
1f69d2b
Merge branch 'master' of github.com:IQSS/dataverse
raprasad May 5, 2014
1e3c484
Add 'email' as datasetfieldtype
sekmiller May 5, 2014
791037c
Added "Draft" labels to the title on the Dataset pg. Styled new butto…
May 5, 2014
348635c
Merge origin/master
May 5, 2014
af7b9f6
changed EditMode = INFO to be a null editMode (to match others and fi…
scolapasta May 5, 2014
efefbb3
changed EditMode = INFO to be a null editMode (to match others and fi…
scolapasta May 5, 2014
ce83885
changed EditMode = INFO to be a null editMode (to match others and fi…
scolapasta May 5, 2014
41611e8
Add Helper Methods to getCitation that don't require "isOnlineVersion…
sekmiller May 5, 2014
6bc6478
Merge branch 'master' of github.com:IQSS/dataverse_temp
landreev May 5, 2014
a81cec8
Code for pdf previews, in dataset views and search results.
landreev May 5, 2014
8805dd1
Updates for bug #3770 - edit dataset, metadata sections not closing o…
raprasad May 6, 2014
8a883b0
Fix for bug #3797, ajax update changed from @all to @form. Checked on…
raprasad May 6, 2014
96c98c6
disable dropdown choices for moving dataverses
raprasad May 6, 2014
181f9a1
Bug #3919: Do not allow a dataverse to be moved. Replace dropdown wi…
raprasad May 6, 2014
0fb75fc
only assign "now" as a last resort for files #3701
pdurbin May 6, 2014
ad40883
Added new screenshot for Dataverse Schematic diagram
posixeleni May 6, 2014
7030e9a
Added new digram of Dataverse
May 6, 2014
dbe681a
Fixed Link for "View Unpublished Version" button
sekmiller May 6, 2014
caea2f1
stop indexing citation, get from dataset version #3795
pdurbin May 6, 2014
e2f1611
Return logic for displaying publish buttons
sekmiller May 6, 2014
2163534
Fix Render of secondary edit buttons on Dataset Page
sekmiller May 6, 2014
81a1d1c
Bug #3797, fix for re-binding tool tips
raprasad May 6, 2014
17a056d
published file was showing draft dataset title #3795
pdurbin May 6, 2014
bd23b4b
allows for multiple terms (and quotes) #3798
pdurbin May 6, 2014
59014f3
removed advanced search and changed call for search view action (to s…
scolapasta May 6, 2014
fd98861
added onlyDataRelatedToMe boolean
scolapasta May 6, 2014
7422f96
added onlyDataRelatedToMe boolean
scolapasta May 6, 2014
6f9e7ab
index all dvObjects for the creator group (eventually will be based o…
scolapasta May 6, 2014
7e7a9e5
Added validation to ensure that alias is unique. (#3532)
xyang02 May 6, 2014
a83e6fe
Added validation to ensure that alias is unique. (#3532)
xyang02 May 6, 2014
7ccdeea
citation no longer indexed as of caea2f1, fix expected output
pdurbin May 6, 2014
6da2273
Merge origin/master
May 6, 2014
58c9b93
Additional clean up of the dataset pg UI. Improved action button spac…
May 6, 2014
dd5c8bb
Minor fix for the installer; if the domain is not running, it'll try …
landreev May 6, 2014
0f94925
for searchRedirect changed from boolean to String (value of redirect …
scolapasta May 6, 2014
02c4d7d
for searchRedirect changed from boolean to String (value of redirect …
scolapasta May 6, 2014
3d73a27
for searchRedirect changed from boolean to String (value of redirect …
scolapasta May 6, 2014
4994952
for searchRedirect changed from boolean to String (value of redirect …
scolapasta May 6, 2014
55e1813
Merge origin/master
scolapasta May 6, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions doc/Sphinx/source/User/dataverse-management.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,40 @@ Creating a dataverse is easy but first you must be a registered user (see Create
#. Once on the "New Dataverse" page fill in the following fields:
* Enter the name of your Dataverse.
* **Host Dataverse**: select which dataverse you would like this new dataverse to belong to. By default it will be a child dataverse of the parent you clicked from.
* **Dataverse Alias**: This is an abbreviation, usually lower-case, that becomes part of the URL for the new dataverse. Special characters (~,\`, !, @, #, $, %, ^, &, and \*) and spaces are not allowed. **Note**: if you change the Dataverse Alias field, the URL for your Dataverse changes (http//.../dv/'alias'), which affects links to this page.
* **Alias**: This is an abbreviation, usually lower-case, that becomes part of the URL for the new dataverse. Special characters (~,\`, !, @, #, $, %, ^, &, and \*) and spaces are not allowed. **Note**: if you change the Dataverse Alias field, the URL for your Dataverse changes (http//.../dv/'alias'), which affects links to this page.
* **E-mail**: This is the email address you will receive notifications for this particular Dataverse.
* **Affiliation**: Add any Affiliation that can be associated to this particular dataverse (e.g., project name, institute name, department name, journal name, etc).
* **Description**: Provide a description of this dataverse (max. 1000 characters). This will display on the home page of your dataverse and in the search result list.
* **Choose the sets of Metadata Elements for datasets in this Dataverse**: by default the metadata elements will be from the host dataverse that this new dataverse is created in.
3. Click "Create Dataverse" button and you're done! An email will be sent to you with more information, including the URL to access your new dataverse.

\*Required information can vary depending on site policy. Required fields are noted with a red asterisk.
\*Required fields are denoted by a red asterisk.

Edit Dataverse
=================

To edit your Dataverse, navigate to your Dataverse homepage and select the "Edit Dataverse" button.
To edit your Dataverse, navigate to your Dataverse homepage and select the "Edit Dataverse" button,
where you will be presented with the following editing options.

- **General Information**: edit name, host dataverse, alias, email, description, and affilitation for your dataverse.
- **General Information**: edit name, host dataverse, alias, email,
description, affilitation, and Metadata Elements for your dataverse.
- **Roles + Permissions** for this particular dataverse
- **Setup**: Edit the Metadata elements and Facets you want to associate with your dataverse. Note: facets will appear in the order shown on the list.
- **Setup**: Update the Facets you want to associate with your dataverse.
Note: facets will appear in the order shown on the list.


Publish Your Dataverse
=================================================================

Once your dataverse is ready to go public, go to your dataverse page, click on the "Private" button on the right
Once your dataverse is ready to go public, go to your dataverse page, click on the "Unpublished" button on the right
hand side of the page which should indicate:
"This dataverse is Private. To make it public click 'Publish dataverse' link."
"This dataverse is Unpublished. To publish it click 'Publish dataverse' link." Once you click "Publish dataverse" it
will be made public.

**Important Note**: Once a dataverse is made public it can no longer be un-published.
**Important Note**: Once a dataverse is made public it can no longer be unpublished.


.. |image1| image:: ./img/Dataverses-Datasets.png
.. |image1| image:: ./img/Dataverse-Diagram.png



Expand Down
Binary file added doc/Sphinx/source/User/img/Dataverse-Diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 24 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
<name>PrimeFaces Maven Repository</name>
<url>http://repository.primefaces.org</url>
<layout>default</layout>
</repository>
<!-- Geo Toolkit repository is need to obtain the JAI (advanced imaging) libraries; since Oracle kind of abandoned that project, the jars seem to have disappeared from the central repository as well. -->
<repository>
<id>geotk-repo</id>
<name>Geo Toolkit Maven Repository</name>
<url>http://maven.geotoolkit.org</url>
<layout>default</layout>
</repository>
<repository>
<id>central-repo</id>
Expand Down Expand Up @@ -66,7 +73,6 @@
<version>7.0</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
Expand Down Expand Up @@ -169,6 +175,23 @@
<artifactId>jhove-handler</artifactId>
<version>1.11.0</version>
</dependency>
<!-- JAI (Java Advanced Imaging) jars: -->
<dependency>
<groupId>javax.media</groupId>
<artifactId>jai_imageio</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>javax.media</groupId>
<artifactId>jai_core</artifactId>
<version>1.1.3</version>
</dependency>
<dependency>
<groupId>javax.media</groupId>
<artifactId>jai_codec</artifactId>
<version>1.1.3</version>
</dependency>

</dependencies>

<build>
Expand Down
16 changes: 15 additions & 1 deletion scripts/installer/install
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ print "FOR EXAMPLE, IF A CONFIGURATION SETTING THAT WE ARE TRYING\n";
print "TO CREATE ALREADY EXISTS; OR IF A JVM OPTION THAT WE ARE\n";
print "DELETING DOESN'T. THESE \"FAILURES\" ARE NORMAL!\n";
print "*********************\n\n";
print "When asadmin asks you to \"Enter admin user name\",\n";
print "When/if asadmin asks you to \"Enter admin user name\",\n";
print "it should be safe to hit return and accept the default\n";
print "(which is \"admin\").\n";

Expand All @@ -838,6 +838,20 @@ system "stty cbreak </dev/tty >/dev/tty 2>&1";
system "stty -cbreak </dev/tty >/dev/tty 2>&1";
print "\n";

# start domain, if not running:

my $DOMAIN_DOWN=`$CONFIG_DEFAULTS{'GLASSFISH_DIRECTORY'}/bin/asadmin list-domains | grep "$DOMAIN " | grep "not running"`;
print STDERR $DOMAIN_DOWN . "\n";
if ($DOMAIN_DOWN)
{
print "Trying to start domain up...\n";
system ($CONFIG_DEFAULTS{'GLASSFISH_DIRECTORY'}."/bin/asadmin start-domain domain1");
}
else
{
print "domain appears to be up...\n";
}

# create asadmin login, so that the user doesn't have to enter
# the username and password for every asadmin command, if
# access to :4848 is password-protected:
Expand Down
30 changes: 18 additions & 12 deletions scripts/search/tests/dataset-versioning04
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
#!/bin/bash
# We assume you've done everything in scripts/search/tests/dataset-versioning03
# There should now be two Solr documents with different titles:
# There should now be two Solr documents for the same dataset with different titles:
#
# Version 1.0 has the published title and a single published file
# Title: Rings of Trees and Other Observations
# to
# files: 18:trees.png
#
# The version that is post 1.0 has a different title
# Title: Rings of Conifers and Other Observations
# files: 18:trees.png
#
# Now let's add a second file to the unpublished version of the study:
#
# http://localhost:8080/dataset.xhtml?id=17
#
# The new file should be named trees2.png and have a description of
# "Another tree image."
#
# anon should be able to see the published 1.0 version but not the new draft (no change from dataset-versioning02anon)
#diff -u <(curl -s 'http://localhost:8080/api/search?q=trees&showrelevance=true') scripts/search/tests/expected/dataset-versioning02anon
# pete should be able to see the published version 1.0 with published=true (same as anon)
#diff -u <(curl -s 'http://localhost:8080/api/search?q=trees&key=pete&published=true') scripts/search/tests/expected/dataset-versioning03pete-published-only
# pete should be able to see the newer draft version with unpublished=true
#diff -u <(curl -s 'http://localhost:8080/api/search?q=trees&key=pete&unpublished=true') scripts/search/tests/expected/dataset-versioning03pete-unpublished-only
# pete should see just the published version by default
diff -u <(curl -s 'http://localhost:8080/api/search?q=trees&key=pete') scripts/search/tests/expected/dataset-versioning03pete-published-only
# here's the solr doc for the dataset
#diff -u scripts/search/tests/expected/dataset-versioning02dataset_17solr <(curl -s 'http://localhost:8983/solr/collection1/select?rows=100&wt=json&indent=true&q=id:dataset_17') | egrep -v '_version_|release_or_create_date_dt'
# anon should be able to see the published 1.0 version but not the new draft and not the new file
# (no change from dataset-versioning02anon)
diff -u <(curl -s 'http://localhost:8080/api/search?q=trees&showrelevance=true') scripts/search/tests/expected/dataset-versioning02anon
# pete should be able to see the new unpublished file
diff -u <(curl -s 'http://localhost:8080/api/search?q=trees&key=pete') scripts/search/tests/expected/dataset-versioning04pete
24 changes: 24 additions & 0 deletions scripts/search/tests/dataset-versioning05
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
# We assume you've done everything in scripts/search/tests/dataset-versioning04
# There should now be two Solr documents for datasets with different titles.
#
# Version 1.0 has a single file
# Title: Rings of Trees and Other Observations
# files: 18:trees.png
#
# The version that is post 1.0 but unpublished has two files
# Title: Rings of Conifers and Other Observations
# files: 18:trees.png, 19:trees2.png
#
# Now let's change the description of the published file (18:trees.png) from
# "Trees are lovely."
# to
# "The first picture of trees I uploaded."
#
# anon should be able to see the published 1.0 version but not the new draft and not the new file
# and not the change in description
# (no change from dataset-versioning02anon)
diff -u <(curl -s 'http://localhost:8080/api/search?q=trees&showrelevance=true') scripts/search/tests/expected/dataset-versioning02anon
# What about pete? should he see multiple cards for the two versions
# (with different descriptions) of 18:trees.png? Right now there is only one
# card per file and for published files it always shows the published information.
7 changes: 1 addition & 6 deletions scripts/search/tests/expected/dataset-versioning02anon
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
{
"id":"dataset_17",
"matched_fields":"[dsDescription, title, citation_t, notesText, authorAffiliation, authorName, keyword, contributorName]",
"matched_fields":"[dsDescription, title, notesText, authorAffiliation, authorName, keyword, contributorName]",
"detailsArray":[
{
"dsDescription":[
Expand All @@ -38,11 +38,6 @@
"Rings of <span class=\"search-term-match\">Trees</span> and Other Observations"
]
},
{
"citation_t":[
"<span class=\"search-term-match\">Tree</span>, Tony, 2014, \"Rings of Trees and Other Observations\", http://dx.doi.org/10.5072/FK2/17, Root"
]
},
{
"notesText":[
"Many notes have been taken about <span class=\"search-term-match\">trees</span> over the years."
Expand Down
10 changes: 10 additions & 0 deletions scripts/search/tests/expected/dataset-versioning04pete
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

{
"q":"trees",
"fq_provided":"[]",
"fq_actual":"[({!join from=groups_s to=perms_ss}id:group_public OR {!join from=groups_s to=perms_ss}id:group_user1)]",
"total_count":7,
"start":0,
"count_in_response":7,
"items":"[datafile_18:trees.png:18, datafile_19:trees2.png:19, dataset_17:Rings of Trees and Other Observations:17, dataset_17_draft:Rings of Conifers and Other Observations:17, dataverse_10:Birds:10, dataverse_11:Trees:11, dataverse_16:Chestnut Trees:16]"
}
7 changes: 1 addition & 6 deletions scripts/search/tests/expected/highlighting-nick-trees
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
{
"id":"dataset_17_draft",
"matched_fields":"[dsDescription, title, citation_t, notesText, authorAffiliation, authorName, keyword, contributorName]",
"matched_fields":"[dsDescription, title, notesText, authorAffiliation, authorName, keyword, contributorName]",
"detailsArray":[
{
"dsDescription":[
Expand All @@ -38,11 +38,6 @@
"Rings of <span class=\"search-term-match\">Trees</span> and Other Observations"
]
},
{
"citation_t":[
"<span class=\"search-term-match\">Tree</span>, Tony, 2014, \"Rings of Trees and Other Observations\", http://dx.doi.org/10.5072/FK2/17, Root"
]
},
{
"notesText":[
"Many notes have been taken about <span class=\"search-term-match\">trees</span> over the years."
Expand Down
7 changes: 1 addition & 6 deletions scripts/search/tests/expected/highlighting-pete-trees
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
{
"id":"dataset_17_draft",
"matched_fields":"[dsDescription, title, citation_t, notesText, authorAffiliation, authorName, keyword, contributorName]",
"matched_fields":"[dsDescription, title, notesText, authorAffiliation, authorName, keyword, contributorName]",
"detailsArray":[
{
"dsDescription":[
Expand All @@ -38,11 +38,6 @@
"Rings of <span class=\"search-term-match\">Trees</span> and Other Observations"
]
},
{
"citation_t":[
"<span class=\"search-term-match\">Tree</span>, Tony, 2014, \"Rings of Trees and Other Observations\", http://dx.doi.org/10.5072/FK2/17, Root"
]
},
{
"notesText":[
"Many notes have been taken about <span class=\"search-term-match\">trees</span> over the years."
Expand Down
5 changes: 0 additions & 5 deletions scripts/search/tests/highlighting
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@
# Type: Data Collector
# Name: Edward Trees Jr.
#
# Until https://redmine.hmdc.harvard.edu/issues/3778 is complete:
# Add the following
# Production Date: 2014-05-02
# (Otherwise you won't be able to publish your dataset.)
#
# We assume you add a file called "trees.png" to this dataset
# with a description of "Trees are lovely."
#
Expand Down
64 changes: 51 additions & 13 deletions src/main/java/edu/harvard/iq/dataverse/AdvancedSearchPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,40 +128,78 @@ public String find() throws IOException {
* see also https://redmine.hmdc.harvard.edu/issues/3745
*/
if (!dvFieldName.isEmpty()) {
queryBuilder = new StringBuilder();
queryBuilder.append(SearchFields.DATAVERSE_NAME + ":" + dvFieldName);
queryBuilder = constructQuery(SearchFields.DATAVERSE_NAME, dvFieldName);
}

if (!dvFieldAffiliation.isEmpty()) {
queryBuilder = new StringBuilder();
queryBuilder.append(SearchFields.DATAVERSE_AFFILIATION + ":" + dvFieldAffiliation);
queryBuilder = constructQuery(SearchFields.DATAVERSE_AFFILIATION, dvFieldAffiliation);
}

if (!dvFieldDescription.isEmpty()) {
queryBuilder = new StringBuilder();
queryBuilder.append(SearchFields.DATAVERSE_DESCRIPTION + ":" + dvFieldDescription);
queryBuilder = constructQuery(SearchFields.DATAVERSE_DESCRIPTION, dvFieldDescription);
}

if (!fileFieldName.isEmpty()) {
queryBuilder = new StringBuilder();
queryBuilder.append(SearchFields.FILE_NAME + ":" + fileFieldName);
queryBuilder = constructQuery(SearchFields.FILE_NAME, fileFieldName);
}

if (!fileFieldDescription.isEmpty()) {
queryBuilder = new StringBuilder();
queryBuilder.append(SearchFields.FILE_DESCRIPTION + ":" + fileFieldDescription);
queryBuilder = constructQuery(SearchFields.FILE_DESCRIPTION, fileFieldDescription);
}

if (!fileFieldFiletype.isEmpty()) {
queryBuilder = new StringBuilder();
queryBuilder.append(SearchFields.FILE_TYPE_SEARCHABLE + ":" + fileFieldFiletype);
queryBuilder = constructQuery(SearchFields.FILE_TYPE_SEARCHABLE, fileFieldFiletype);
}

}

return "/dataverse.xhtml?q=" + queryBuilder.toString().trim() + "faces-redirect=true";
}



/**
* @todo have the code that operates on dataset fields call into this?
*/
private StringBuilder constructQuery(String solrField, String userSuppliedQuery) {

StringBuilder queryBuilder = new StringBuilder();
String delimiter = "[\"]+";

List<String> queryStrings = new ArrayList();

if (userSuppliedQuery != null && !userSuppliedQuery.equals("")) {
if (userSuppliedQuery.contains("\"")) {
String[] tempString = userSuppliedQuery.split(delimiter);
for (int i = 1; i < tempString.length; i++) {
if (!tempString[i].equals(" ") && !tempString[i].isEmpty()) {
queryStrings.add(solrField + ":" + "\"" + tempString[i].trim() + "\"");
}
}
} else {
StringTokenizer st = new StringTokenizer(userSuppliedQuery);
while (st.hasMoreElements()) {
queryStrings.add(solrField + ":" + st.nextElement());
}
}
}

if (queryStrings.size() > 1) {
queryBuilder.append("(");
}

for (int i = 0; i < queryStrings.size(); i++) {
if (i > 0) {
queryBuilder.append(" ");
}
queryBuilder.append(queryStrings.get(i));
}

if (queryStrings.size() > 1) {
queryBuilder.append(")");
}

return queryBuilder;
}

public Dataverse getDataverse() {
return dataverse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ public class ControlledVocabularyValueConverter implements Converter {
DatasetFieldServiceBean datasetFieldService;

public Object getAsObject(FacesContext facesContext, UIComponent component, String submittedValue) {
ControlledVocabularyValue cvv = datasetFieldService.findControlledVocabularyValue(new Long(submittedValue));
return cvv;
if (submittedValue == null || submittedValue.equals("")) {
return "";
} else {
ControlledVocabularyValue cvv = datasetFieldService.findControlledVocabularyValue(new Long(submittedValue));
return cvv;
}
}

public String getAsString(FacesContext facesContext, UIComponent component, Object value) {
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/edu/harvard/iq/dataverse/DataFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,9 @@ public boolean isImage() {
if ("image/fits".equalsIgnoreCase(contentType)) {
return false;
}
return (contentType != null && contentType.startsWith("image/"));
// a pdf file is an "image" for practical purposes (we will attempt to
// generate thumbnails and previews for them)
return (contentType != null && (contentType.startsWith("image/") || contentType.equalsIgnoreCase("application/pdf")));
}

public boolean isIngestScheduled() {
Expand Down
Loading