Skip to content

Commit 87c0f64

Browse files
authored
Merge pull request #10026 from bencomp/7138-identifer
Replace "identifer" with "identifier" in docs and code
2 parents e47e016 + d76e494 commit 87c0f64

15 files changed

Lines changed: 91 additions & 46 deletions

File tree

doc/sphinx-guides/source/developers/s3-direct-upload-api.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ The allowed checksum algorithms are defined by the edu.harvard.iq.dataverse.Data
116116
curl -X POST -H "X-Dataverse-key: $API_TOKEN" "$SERVER_URL/api/datasets/:persistentId/add?persistentId=$PERSISTENT_IDENTIFIER" -F "jsonData=$JSON_DATA"
117117
118118
Note that this API call can be used independently of the others, e.g. supporting use cases in which the file already exists in S3/has been uploaded via some out-of-band method. Enabling out-of-band uploads is described at :ref:`file-storage` in the Configuration Guide.
119-
With current S3 stores the object identifier must be in the correct bucket for the store, include the PID authority/identifier of the parent dataset, and be guaranteed unique, and the supplied storage identifer must be prefaced with the store identifier used in the Dataverse installation, as with the internally generated examples above.
119+
With current S3 stores the object identifier must be in the correct bucket for the store, include the PID authority/identifier of the parent dataset, and be guaranteed unique, and the supplied storage identifier must be prefaced with the store identifier used in the Dataverse installation, as with the internally generated examples above.
120120

121121
To add multiple Uploaded Files to the Dataset
122122
---------------------------------------------
@@ -147,7 +147,7 @@ The allowed checksum algorithms are defined by the edu.harvard.iq.dataverse.Data
147147
curl -X POST -H "X-Dataverse-key: $API_TOKEN" "$SERVER_URL/api/datasets/:persistentId/addFiles?persistentId=$PERSISTENT_IDENTIFIER" -F "jsonData=$JSON_DATA"
148148
149149
Note that this API call can be used independently of the others, e.g. supporting use cases in which the files already exists in S3/has been uploaded via some out-of-band method. Enabling out-of-band uploads is described at :ref:`file-storage` in the Configuration Guide.
150-
With current S3 stores the object identifier must be in the correct bucket for the store, include the PID authority/identifier of the parent dataset, and be guaranteed unique, and the supplied storage identifer must be prefaced with the store identifier used in the Dataverse installation, as with the internally generated examples above.
150+
With current S3 stores the object identifier must be in the correct bucket for the store, include the PID authority/identifier of the parent dataset, and be guaranteed unique, and the supplied storage identifier must be prefaced with the store identifier used in the Dataverse installation, as with the internally generated examples above.
151151

152152

153153
Replacing an existing file in the Dataset
@@ -177,7 +177,7 @@ Note that the API call does not validate that the file matches the hash value su
177177
curl -X POST -H "X-Dataverse-key: $API_TOKEN" "$SERVER_URL/api/files/$FILE_IDENTIFIER/replace" -F "jsonData=$JSON_DATA"
178178
179179
Note that this API call can be used independently of the others, e.g. supporting use cases in which the file already exists in S3/has been uploaded via some out-of-band method. Enabling out-of-band uploads is described at :ref:`file-storage` in the Configuration Guide.
180-
With current S3 stores the object identifier must be in the correct bucket for the store, include the PID authority/identifier of the parent dataset, and be guaranteed unique, and the supplied storage identifer must be prefaced with the store identifier used in the Dataverse installation, as with the internally generated examples above.
180+
With current S3 stores the object identifier must be in the correct bucket for the store, include the PID authority/identifier of the parent dataset, and be guaranteed unique, and the supplied storage identifier must be prefaced with the store identifier used in the Dataverse installation, as with the internally generated examples above.
181181

182182
Replacing multiple existing files in the Dataset
183183
------------------------------------------------
@@ -275,4 +275,4 @@ The JSON object returned as a response from this API call includes a "data" that
275275
276276
277277
Note that this API call can be used independently of the others, e.g. supporting use cases in which the files already exists in S3/has been uploaded via some out-of-band method. Enabling out-of-band uploads is described at :ref:`file-storage` in the Configuration Guide.
278-
With current S3 stores the object identifier must be in the correct bucket for the store, include the PID authority/identifier of the parent dataset, and be guaranteed unique, and the supplied storage identifer must be prefaced with the store identifier used in the Dataverse installation, as with the internally generated examples above.
278+
With current S3 stores the object identifier must be in the correct bucket for the store, include the PID authority/identifier of the parent dataset, and be guaranteed unique, and the supplied storage identifier must be prefaced with the store identifier used in the Dataverse installation, as with the internally generated examples above.

doc/sphinx-guides/source/user/dataset-management.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ The "Compute" button on dataset and file pages will allow you to compute on a si
783783
Cloud Storage Access
784784
--------------------
785785

786-
If you need to access a dataset in a more flexible way than the Compute button provides, then you can use the Cloud Storage Access box on the dataset page to copy the dataset's container name. This unique identifer can then be used to allow direct access to the dataset.
786+
If you need to access a dataset in a more flexible way than the Compute button provides, then you can use the Cloud Storage Access box on the dataset page to copy the dataset's container name. This unique identifier can then be used to allow direct access to the dataset.
787787

788788
.. _deaccession:
789789

doc/sphinx-guides/source/user/find-use-data.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ View Files
7171

7272
Files in a Dataverse installation each have their own landing page that can be reached through the search results or through the Files table on their parent dataset's page. The dataset page and file page offer much the same functionality in terms of viewing and editing files, with a few small exceptions.
7373

74-
- In installations that have enabled support for persistent identifers (PIDs) at the file level, the file page includes the file's DOI or handle, which can be found in the file citation and also under the Metadata tab.
74+
- In installations that have enabled support for persistent identifiers (PIDs) at the file level, the file page includes the file's DOI or handle, which can be found in the file citation and also under the Metadata tab.
7575
- Previewers for several common file types are available and can be added by installation administrators.
7676
- The file page's Versions tab gives you a version history that is more focused on the individual file rather than the dataset as a whole.
7777

src/main/java/edu/harvard/iq/dataverse/DatasetVersionServiceBean.java

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -495,10 +495,24 @@ private DatasetVersion getDatasetVersionByQuery(String queryString){
495495
}
496496
} // end getDatasetVersionByQuery
497497

498-
499-
500-
501-
public DatasetVersion retrieveDatasetVersionByIdentiferClause(String identifierClause, String version){
498+
/**
499+
* @deprecated because of a typo; use {@link #retrieveDatasetVersionByIdentifierClause(String, String) retrieveDatasetVersionByIdentifierClause} instead
500+
* @see #retrieveDatasetVersionByIdentifierClause(String, String)
501+
* @param identifierClause
502+
* @param version
503+
* @return a DatasetVersion if found, or {@code null} otherwise
504+
*/
505+
@Deprecated
506+
public DatasetVersion retrieveDatasetVersionByIdentiferClause(String identifierClause, String version) {
507+
return retrieveDatasetVersionByIdentifierClause(identifierClause, version);
508+
}
509+
510+
/**
511+
* @param identifierClause
512+
* @param version
513+
* @return a DatasetVersion if found, or {@code null} otherwise
514+
*/
515+
public DatasetVersion retrieveDatasetVersionByIdentifierClause(String identifierClause, String version) {
502516

503517
if (identifierClause == null){
504518
return null;
@@ -620,7 +634,7 @@ public RetrieveDatasetVersionResponse retrieveDatasetVersionByPersistentId(Strin
620634
identifierClause += " AND ds.identifier = '" + parsedId.getIdentifier() + "'";
621635

622636

623-
DatasetVersion ds = retrieveDatasetVersionByIdentiferClause(identifierClause, version);
637+
DatasetVersion ds = retrieveDatasetVersionByIdentifierClause(identifierClause, version);
624638

625639
if (ds != null){
626640
msg("retrieved dataset: " + ds.getId() + " semantic: " + ds.getSemanticVersion());
@@ -718,7 +732,7 @@ public DatasetVersion getDatasetVersionById(Long datasetId, String version){
718732

719733
String identifierClause = this.getIdClause(datasetId);
720734

721-
DatasetVersion ds = retrieveDatasetVersionByIdentiferClause(identifierClause, version);
735+
DatasetVersion ds = retrieveDatasetVersionByIdentifierClause(identifierClause, version);
722736

723737
return ds;
724738

src/main/java/edu/harvard/iq/dataverse/Shib.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.util.Arrays;
2525
import java.util.Date;
2626
import java.util.List;
27+
import java.util.logging.Level;
2728
import java.util.logging.Logger;
2829
import jakarta.ejb.EJB;
2930
import jakarta.ejb.EJBException;
@@ -62,7 +63,7 @@ public class Shib implements java.io.Serializable {
6263
HttpServletRequest request;
6364

6465
private String userPersistentId;
65-
private String internalUserIdentifer;
66+
private String internalUserIdentifier;
6667
AuthenticatedUserDisplayInfo displayInfo;
6768
/**
6869
* @todo Remove this boolean some day? Now the mockups show a popup. Should
@@ -210,8 +211,8 @@ public void init() {
210211
}
211212

212213
String usernameAssertion = getValueFromAssertion(ShibUtil.usernameAttribute);
213-
internalUserIdentifer = ShibUtil.generateFriendlyLookingUserIdentifer(usernameAssertion, emailAddress);
214-
logger.fine("friendly looking identifer (backend will enforce uniqueness):" + internalUserIdentifer);
214+
internalUserIdentifier = ShibUtil.generateFriendlyLookingUserIdentifier(usernameAssertion, emailAddress);
215+
logger.log(Level.FINE, "friendly looking identifier (backend will enforce uniqueness): {0}", internalUserIdentifier);
215216

216217
String shibAffiliationAttribute = settingsService.getValueForKey(SettingsServiceBean.Key.ShibAffiliationAttribute);
217218
String affiliation = (StringUtils.isNotBlank(shibAffiliationAttribute))
@@ -326,7 +327,7 @@ public String confirmAndCreateAccount() {
326327
AuthenticatedUser au = null;
327328
try {
328329
au = authSvc.createAuthenticatedUser(
329-
new UserRecordIdentifier(shibAuthProvider.getId(), lookupStringPerAuthProvider), internalUserIdentifer, displayInfo, true);
330+
new UserRecordIdentifier(shibAuthProvider.getId(), lookupStringPerAuthProvider), internalUserIdentifier, displayInfo, true);
330331
} catch (EJBException ex) {
331332
/**
332333
* @todo Show the ConstraintViolationException, if any.
@@ -354,7 +355,7 @@ public String confirmAndConvertAccount() {
354355
visibleTermsOfUse = false;
355356
ShibAuthenticationProvider shibAuthProvider = new ShibAuthenticationProvider();
356357
String lookupStringPerAuthProvider = userPersistentId;
357-
UserIdentifier userIdentifier = new UserIdentifier(lookupStringPerAuthProvider, internalUserIdentifer);
358+
UserIdentifier userIdentifier = new UserIdentifier(lookupStringPerAuthProvider, internalUserIdentifier);
358359
logger.fine("builtin username: " + builtinUsername);
359360
AuthenticatedUser builtInUserToConvert = authSvc.canLogInAsBuiltinUser(builtinUsername, builtinPassword);
360361
if (builtInUserToConvert != null) {

src/main/java/edu/harvard/iq/dataverse/api/datadeposit/CollectionListManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public Feed listCollectionContents(IRI iri, AuthCredentials authCredentials, Swo
9494
throw new SwordError(UriRegistry.ERROR_BAD_REQUEST, "Could not find dataverse: " + dvAlias);
9595
}
9696
} else {
97-
throw new SwordError(UriRegistry.ERROR_BAD_REQUEST, "Couldn't determine target type or identifer from URL: " + iri);
97+
throw new SwordError(UriRegistry.ERROR_BAD_REQUEST, "Couldn't determine target type or identifier from URL: " + iri);
9898
}
9999
}
100100

src/main/java/edu/harvard/iq/dataverse/api/datadeposit/MediaResourceManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public void deleteMediaResource(String uri, AuthCredentials authCredentials, Swo
219219
throw new SwordError(UriRegistry.ERROR_BAD_REQUEST, "Unsupported file type found in URL: " + uri);
220220
}
221221
} else {
222-
throw new SwordError(UriRegistry.ERROR_BAD_REQUEST, "Target or identifer not specified in URL: " + uri);
222+
throw new SwordError(UriRegistry.ERROR_BAD_REQUEST, "Target or identifier not specified in URL: " + uri);
223223
}
224224
}
225225

src/main/java/edu/harvard/iq/dataverse/authorization/AuthenticationServiceBean.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ public boolean updateProvider( AuthenticatedUser authenticatedUser, String authe
580580
* {@code userDisplayInfo}, a lookup entry for them based
581581
* UserIdentifier.getLookupStringPerAuthProvider (within the supplied
582582
* authentication provider), and internal user identifier (used for role
583-
* assignments, etc.) based on UserIdentifier.getInternalUserIdentifer.
583+
* assignments, etc.) based on UserIdentifier.getInternalUserIdentifier.
584584
*
585585
* @param userRecordId
586586
* @param proposedAuthenticatedUserIdentifier
@@ -605,20 +605,20 @@ public AuthenticatedUser createAuthenticatedUser(UserRecordIdentifier userRecord
605605
proposedAuthenticatedUserIdentifier = proposedAuthenticatedUserIdentifier.trim();
606606
}
607607
// we now select a username for the generated AuthenticatedUser, or give up
608-
String internalUserIdentifer = proposedAuthenticatedUserIdentifier;
608+
String internalUserIdentifier = proposedAuthenticatedUserIdentifier;
609609
// TODO should lock table authenticated users for write here
610-
if ( identifierExists(internalUserIdentifer) ) {
610+
if ( identifierExists(internalUserIdentifier) ) {
611611
if ( ! generateUniqueIdentifier ) {
612612
return null;
613613
}
614614
int i=1;
615-
String identifier = internalUserIdentifer + i;
615+
String identifier = internalUserIdentifier + i;
616616
while ( identifierExists(identifier) ) {
617617
i += 1;
618618
}
619619
authenticatedUser.setUserIdentifier(identifier);
620620
} else {
621-
authenticatedUser.setUserIdentifier(internalUserIdentifer);
621+
authenticatedUser.setUserIdentifier(internalUserIdentifier);
622622
}
623623
authenticatedUser = save( authenticatedUser );
624624
// TODO should unlock table authenticated users for write here

src/main/java/edu/harvard/iq/dataverse/authorization/UserIdentifier.java

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,31 @@ public class UserIdentifier {
2525
/**
2626
* The String used in the permission system to assign roles, for example.
2727
*/
28-
String internalUserIdentifer;
28+
String internalUserIdentifier;
2929

30-
public UserIdentifier(String lookupStringPerAuthProvider, String internalUserIdentifer) {
30+
public UserIdentifier(String lookupStringPerAuthProvider, String internalUserIdentifier) {
3131
this.lookupStringPerAuthProvider = lookupStringPerAuthProvider;
32-
this.internalUserIdentifer = internalUserIdentifer;
32+
this.internalUserIdentifier = internalUserIdentifier;
3333
}
3434

3535
public String getLookupStringPerAuthProvider() {
3636
return lookupStringPerAuthProvider;
3737
}
3838

39+
/**
40+
* @deprecated because of a typo; use {@link #getInternalUserIdentifier()} instead
41+
* @see #getInternalUserIdentifier()
42+
* @return the internal user identifier
43+
*/
44+
@Deprecated
3945
public String getInternalUserIdentifer() {
40-
return internalUserIdentifer;
46+
return getInternalUserIdentifier();
47+
}
48+
49+
/**
50+
* @return the internal user identifier
51+
*/
52+
public String getInternalUserIdentifier() {
53+
return internalUserIdentifier;
4154
}
4255
}

src/main/java/edu/harvard/iq/dataverse/authorization/providers/shib/ShibUtil.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,24 @@ public static String findSingleValue(String mayHaveMultipleValues) {
133133
return singleValue;
134134
}
135135

136+
/**
137+
* @deprecated because of a typo; use {@link #generateFriendlyLookingUserIdentifier(String, String)} instead
138+
* @see #generateFriendlyLookingUserIdentifier(String, String)
139+
* @param usernameAssertion
140+
* @param email
141+
* @return a friendly-looking user identifier based on the asserted username or email, or a UUID as fallback
142+
*/
143+
@Deprecated
136144
public static String generateFriendlyLookingUserIdentifer(String usernameAssertion, String email) {
145+
return generateFriendlyLookingUserIdentifier(usernameAssertion, email);
146+
}
147+
148+
/**
149+
* @param usernameAssertion
150+
* @param email
151+
* @return a friendly-looking user identifier based on the asserted username or email, or a UUID as fallback
152+
*/
153+
public static String generateFriendlyLookingUserIdentifier(String usernameAssertion, String email) {
137154
if (usernameAssertion != null && !usernameAssertion.isEmpty()) {
138155
return usernameAssertion;
139156
}

0 commit comments

Comments
 (0)