diff --git a/doc/sphinx-guides/source/developers/deployment.rst b/doc/sphinx-guides/source/developers/deployment.rst index 15892a4fef3..cdd8062048b 100755 --- a/doc/sphinx-guides/source/developers/deployment.rst +++ b/doc/sphinx-guides/source/developers/deployment.rst @@ -94,7 +94,7 @@ You must specify the branch with ``-b`` but you can also specify a non-IQSS git If you configured an Ansible file above and want to make use of it, add ``-g main.yml`` (or whatever you named your file) as in the following example. -``bash ~/Downloads/ec2-create-instance.sh -b develop -r https://github.com/scholarsportal/dataverse.git -b main.yml`` +``bash ~/Downloads/ec2-create-instance.sh -b develop -r https://github.com/scholarsportal/dataverse.git -g main.yml`` Now you will need to wait around 15 minutes until the deployment is finished. Eventually, the output should tell you how to access the installation of Dataverse in a web browser or via ssh. It will also provide instructions on how to delete the instance when you are finished with it. Please be aware that AWS charges per minute for a running instance. You can also delete your instance from https://console.aws.amazon.com/console/home?region=us-east-1 . diff --git a/src/main/java/edu/harvard/iq/dataverse/mydata/MyDataFinder.java b/src/main/java/edu/harvard/iq/dataverse/mydata/MyDataFinder.java index 7cea611b06e..c9faf797d57 100644 --- a/src/main/java/edu/harvard/iq/dataverse/mydata/MyDataFinder.java +++ b/src/main/java/edu/harvard/iq/dataverse/mydata/MyDataFinder.java @@ -27,26 +27,26 @@ * Given a user and a set of filters (dvobject type, roles, publication status): * - Use postgres to identify DvObject types * - Format a solr query string - * + * * @author rmp553 */ //@Stateless public class MyDataFinder { - + private static final Logger logger = Logger.getLogger(MyDataFinder.class.getCanonicalName()); private String userIdentifier; MyDataFilterParams filterParams; - + // !! RMP - Excluded by default; don't have cases yet to make this true - private boolean excludeHarvestedData = true; + private boolean excludeHarvestedData = true; //private String searchTerm = "*"; - + // -------------------- private DataverseRolePermissionHelper rolePermissionHelper; private RoleAssigneeServiceBean roleAssigneeService; private DvObjectServiceBean dvObjectServiceBean; - private GroupServiceBean groupService; + private GroupServiceBean groupService; //private RoleAssigneeServiceBean roleService = new RoleAssigneeServiceBean(); //private MyDataQueryHelperServiceBean myDataQueryHelperService; // -------------------- @@ -71,20 +71,20 @@ public class MyDataFinder { private List directDvObjectIds = new ArrayList<>(); // Lists later used to format Solr Queries - // + // // ---------------------------- // POPULATED IN STEP 2 (2nd query) // ---------------------------- private List directDataverseIds = new ArrayList<>(); private List directDatasetIds = new ArrayList<>(); private List directFileIds = new ArrayList<>(); - + private List datasetParentIds = new ArrayList<>(); // dataverse has dataset permissions - private List fileParentIds = new ArrayList<>(); // dataset has file permissions + private List fileParentIds = new ArrayList<>(); // dataset has file permissions private List fileGrandparentFileIds = new ArrayList<>(); // dataverse has file permissions - + public MyDataFinder(DataverseRolePermissionHelper rolePermissionHelper, RoleAssigneeServiceBean roleAssigneeService, DvObjectServiceBean dvObjectServiceBean, GroupServiceBean groupService) { this.rolePermissionHelper = rolePermissionHelper; this.roleAssigneeService = roleAssigneeService; @@ -94,39 +94,39 @@ public MyDataFinder(DataverseRolePermissionHelper rolePermissionHelper, RoleAssi } private void loadHarvestedDataverseIds(){ - + for (Long id : dvObjectServiceBean.getAllHarvestedDataverseIds()){ harvestedDataverseIds.put(id, true); } - + } - + public void setExcludeHarvestedData(boolean val){ - + this.excludeHarvestedData = val; } - + public boolean isHarvestedDataExcluded(){ return excludeHarvestedData; } - + /** * Check if a dvobject id is in the Harvested Id dict * @param id - * @return + * @return */ private boolean isHarvesteDataverseId(Long id){ - + if (id == null){ return false; } - + if (this.harvestedDataverseIds.containsKey(id)){ return true; } return false; } - + public void initFields(){ // ---------------------------- // POPULATED IN STEP 1 (1st query) @@ -139,7 +139,7 @@ public void initFields(){ this.directDvObjectIds = new ArrayList<>(); // Lists later used to format Solr Queries - // + // // ---------------------------- // POPULATED IN STEP 2 (2nd query) // ---------------------------- @@ -149,26 +149,26 @@ public void initFields(){ this.datasetParentIds = new ArrayList<>(); // dataverse has dataset permissions - this.fileParentIds = new ArrayList<>(); // dataset has file permissions + this.fileParentIds = new ArrayList<>(); // dataset has file permissions this.fileGrandparentFileIds = new ArrayList<>(); // dataverse has file permissions - + } - + public DataverseRolePermissionHelper getRolePermissionHelper(){ return this.rolePermissionHelper; } public void runFindDataSteps(MyDataFilterParams filterParams){ - - + + this.filterParams = filterParams; this.userIdentifier = this.filterParams.getUserIdentifier(); - + if (this.filterParams.hasError()){ this.addErrorMessage(filterParams.getErrorMessage()); return; } - + if (!runStep1RoleAssignments()){ return; } @@ -177,36 +177,36 @@ public void runFindDataSteps(MyDataFilterParams filterParams){ } if (!fileGrandparentFileIds.isEmpty()){ runStep3FilePermsAssignedAtDataverse(); - } - + } + } - + public List getSolrFilterQueriesForTotalCounts(){ - + return this.getSolrFilterQueries(true); } - - + + public List getSolrFilterQueries(){ - + return this.getSolrFilterQueries(false); } - + /** * Get the final queries for the Solr Search object - * - * @return + * + * @return */ private List getSolrFilterQueries(boolean totalCountsOnly){ if (this.hasError()){ throw new IllegalStateException("Error encountered earlier. Before calling this method on a MyDataFinder object, first check 'hasError()'"); } - + // init filterQueries list List filterQueries = new ArrayList<>(); // ----------------------------------------------------------------- - // (1) Add entityId/parentId FQ + // (1) Add entityId/parentId FQ // - by entityId (dvObject id) and parentId (dvObject ownerId) // ----------------------------------------------------------------- String dvObjectFQ = this.getSolrDvObjectFilterQuery(); @@ -235,15 +235,15 @@ private List getSolrFilterQueries(boolean totalCountsOnly){ // ----------------------------------------------------------------- filterQueries.add(this.filterParams.getSolrFragmentForPublicationStatus()); //fq=publicationStatus:"Unpublished"&fq=publicationStatus:"Draft" - + return filterQueries; } - - - - - + + + + + public String getSolrDvObjectFilterQuery(){ if (this.hasError()){ @@ -258,19 +258,19 @@ public String getSolrDvObjectFilterQuery(){ if (this.filterParams.areDataversesIncluded()){ entityIds.addAll(this.directDataverseIds); // dv ids - } + } if (this.filterParams.areDatasetsIncluded()){ entityIds.addAll(this.directDatasetIds); // dataset ids parentIds.addAll(this.datasetParentIds); // dv ids that are dataset parents datasetParentIdsForFQ.addAll(this.datasetParentIds); } - - if (this.filterParams.areFilesIncluded()){ + + if (this.filterParams.areFilesIncluded()){ entityIds.addAll(this.directFileIds); // file ids parentIds.addAll(this.fileParentIds); // dataset ids that are file parents fileParentIdsForFQ.addAll(this.fileParentIds); } - + // Remove duplicates by Creating a Set // Set distinctEntityIds = new HashSet<>(entityIds); @@ -281,11 +281,11 @@ public String getSolrDvObjectFilterQuery(){ this.addErrorMessage(DataRetrieverAPI.MSG_NO_RESULTS_FOUND); return null; } - + // See if we can trim down the list of distinctEntityIds // If we have the parent of a distinctEntityId in distinctParentIds, // then we query it via the parent - // + // List finalDirectEntityIds = new ArrayList<>(); for (Long idToCheck : distinctEntityIds){ if (this.childToParentIds.containsKey(idToCheck)){ // Do we have the parent in our map? @@ -296,13 +296,13 @@ public String getSolrDvObjectFilterQuery(){ if (this.directDataverseIds.contains(idToCheck)){ // Add all dataverse ids explicitly finalDirectEntityIds.add(idToCheck); - + } else if (!distinctParentIds.contains(this.childToParentIds.get(idToCheck))){ // Is the parent also in our list of Ids to query? // No, then let's check this id directly // finalDirectEntityIds.add(idToCheck); - } + } } } // Set the distinctEntityIds to the finalDirectEntityIds @@ -318,61 +318,61 @@ public String getSolrDvObjectFilterQuery(){ if (distinctEntityIds.size() > 0){ entityIdClause = sqf.buildIdQuery(distinctEntityIds, SearchFields.ENTITY_ID, null); } - + String parentIdClause = null; if (distinctParentIds.size() > 0){ - parentIdClause = sqf.buildIdQuery(distinctParentIds, SearchFields.PARENT_ID, "datasets OR files"); + parentIdClause = sqf.buildIdQuery(distinctParentIds, SearchFields.PARENT_ID, "datasets OR files"); } - + if ((entityIdClause != null) && (parentIdClause != null)){ return "(" + entityIdClause + " OR " + parentIdClause + ")"; - + } else if (entityIdClause != null){ // only entityIdClause return entityIdClause; - + } else if (parentIdClause != null){ // only parentIdClause return parentIdClause; } // Shouldn't get here... - return null; + return null; } - - - + + + public String getTestString(){ - + if (this.hasError()){ return this.getErrorMessage(); } - + List outputList = new ArrayList<>(); - + // ---------------------- // idsWithDatasetPermissions // ---------------------- List idList = new ArrayList<>(); outputList.add("

dataset ids: " + this.idsWithDatasetPermissions.size() + "

"); - for (Map.Entry pair : this.idsWithDatasetPermissions.entrySet()) { + for (Map.Entry pair : this.idsWithDatasetPermissions.entrySet()) { idList.add(pair.getKey().toString()); } - outputList.add("
" + StringUtils.join(idList, ", ") + "
"); + outputList.add("
" + StringUtils.join(idList, ", ") + "
"); // ---------------------- // datasetParentIds // ---------------------- List idList2 = new ArrayList<>(); outputList.add("

datasetParentIds ids: " + this.datasetParentIds.size() + "

"); - for (Long dpId : this.datasetParentIds) { + for (Long dpId : this.datasetParentIds) { idList2.add(dpId.toString()); } outputList.add("
" + StringUtils.join(idList2, ", ") + "
"); return StringUtils.join(outputList, "
"); } - + public String formatUserIdentifierAsAssigneeIdentifier(String userIdentifier){ if (userIdentifier == null){ @@ -383,44 +383,44 @@ public String formatUserIdentifierAsAssigneeIdentifier(String userIdentifier){ } return "@" + userIdentifier; } - - + + /** * "publication_statuses" : [ name 1, name 2, etc.] - * - * @return + * + * @return */ - public JsonObjectBuilder getSelectedFilterParamsAsJSON(){ - + public JsonObjectBuilder getSelectedFilterParamsAsJSON(){ + JsonObjectBuilder jsonData = Json.createObjectBuilder(); jsonData.add("publication_statuses", this.filterParams.getListofSelectedPublicationStatuses()) .add("role_names", this.getListofSelectedRoles()); - + return jsonData; } - - - + + + /** * "publication_statuses" : [ name 1, name 2, etc.] - * - * @return + * + * @return */ public JsonArrayBuilder getListofSelectedRoles(){ - + JsonArrayBuilder jsonArray = Json.createArrayBuilder(); - + for (Long roleId : this.filterParams.getRoleIds()){ - jsonArray.add(this.rolePermissionHelper.getRoleName(roleId)); + jsonArray.add(this.rolePermissionHelper.getRoleName(roleId)); } - return jsonArray; + return jsonArray; } - - + + private boolean runStep1RoleAssignments(){ - + List results = this.roleAssigneeService.getAssigneeAndRoleIdListFor(filterParams); - + //logger.info("runStep1RoleAssignments results: " + results.toString()); if (results == null){ @@ -432,22 +432,22 @@ private boolean runStep1RoleAssignments(){ this.addErrorMessage("Sorry, you have no assigned roles."); }else{ if (roleNames.size()==1){ - this.addErrorMessage("Sorry, nothing was found for this role: " + StringUtils.join(roleNames, ", ")); + this.addErrorMessage("Sorry, nothing was found for this role: " + StringUtils.join(roleNames, ", ")); }else{ - this.addErrorMessage("Sorry, nothing was found for these roles: " + StringUtils.join(roleNames, ", ")); + this.addErrorMessage("Sorry, nothing was found for these roles: " + StringUtils.join(roleNames, ", ")); } } return false; } - - // Iterate through assigned objects, a single object may end up in + + // Iterate through assigned objects, a single object may end up in // multiple "buckets" for (Object[] ra : results) { Long dvId = (Long)ra[0]; Long roleId = (Long)ra[1]; - - - + + + //---------------------------------- // Is this is a harvested Dataverse? // If so, skip it. @@ -455,7 +455,7 @@ private boolean runStep1RoleAssignments(){ if ((this.isHarvestedDataExcluded())&&(this.isHarvesteDataverseId(dvId))){ continue; } - + //---------------------------------- // Put dvId in 1 or more buckets, depending pn if role // applies to a Dataverse, Dataset, and/or File @@ -470,29 +470,29 @@ private boolean runStep1RoleAssignments(){ this.idsWithFilePermissions.put(dvId, true); } directDvObjectIds.add(dvId); - } + } return true; } - + private boolean runStep2DirectAssignments(){ - + if (this.hasError()){ throw new IllegalStateException("Error encountered earlier. Before calling this method on a MyData object,first check 'hasError()'"); } //msgt("runStep2DirectAssignments"); - + List results = this.dvObjectServiceBean.getDvObjectInfoForMyData(directDvObjectIds); //List results = this.roleAssigneeService.getAssignmentsFor(this.userIdentifier); if (results.isEmpty()){ this.addErrorMessage("Sorry, you have no assigned Dataverses, Datasets, or Files."); return false; } - + Integer dvIdAsInteger; Long dvId; String dtype; Long parentId; - + // ----------------------------------------------- // Iterate through assigned objects // ----------------------------------------------- @@ -501,8 +501,8 @@ private boolean runStep2DirectAssignments(){ dvId = new Long(dvIdAsInteger); dtype = (String)ra[1]; parentId = (Long)ra[2]; - - + + // ----------------------------------------------- // If this object is harvested, then skip it... // ----------------------------------------------- @@ -511,13 +511,13 @@ private boolean runStep2DirectAssignments(){ continue; } } - + this.childToParentIds.put(dvId, parentId); - + switch(dtype){ case(DvObject.DATAVERSE_DTYPE_STRING): //if (this.idsWithDataversePermissions.containsKey(dvId)){ - this.directDataverseIds.add(dvId); // Direct dataverse (no indirect dataverses) + this.directDataverseIds.add(dvId); // Direct dataverse (no indirect dataverses) //} if (this.idsWithDatasetPermissions.containsKey(dvId)){ this.datasetParentIds.add(dvId); // Parent to dataset @@ -532,7 +532,7 @@ private boolean runStep2DirectAssignments(){ break; case(DvObject.DATASET_DTYPE_STRING): //if (this.idsWithDatasetPermissions.containsKey(dvId)){ - this.directDatasetIds.add(dvId); // Direct dataset + this.directDatasetIds.add(dvId); // Direct dataset //} if (this.idsWithFilePermissions.containsKey(dvId)){ this.fileParentIds.add(dvId); // Parent to file @@ -544,34 +544,34 @@ private boolean runStep2DirectAssignments(){ } break; } // end switch - } - + } + // Direct ids no longer needed // this.directDvObjectIds = null; - + return true; } - - + + private boolean runStep3FilePermsAssignedAtDataverse(){ if ((this.fileGrandparentFileIds == null)||(this.fileGrandparentFileIds.isEmpty())){ return true; } - + List results = this.dvObjectServiceBean.getDvObjectInfoByParentIdForMyData(this.fileGrandparentFileIds); /* SEK 07/09 Ticket 2329 Removed failure for empty results - if there are none let it go */ if (results.isEmpty()){ - return true; // RMP, shouldn't throw an error if no results + return true; // RMP, shouldn't throw an error if no results } - + Integer dvIdAsInteger; Long dvId; String dtype; Long parentId; - + // Iterate through object list // for (Object[] ra : results) { @@ -579,18 +579,18 @@ private boolean runStep3FilePermsAssignedAtDataverse(){ dvId = new Long(dvIdAsInteger); dtype = (String)ra[1]; parentId = (Long)ra[2]; - + this.childToParentIds.put(dvId, parentId); - + // Should ALWAYS be a Dataset! - if (dtype.equals(DvObject.DATASET_DTYPE_STRING)){ + if (dtype.equals(DvObject.DATASET_DTYPE_STRING)){ this.fileParentIds.add(dvId); } } - + return true; } - + public boolean hasError(){ return this.errorFound; } diff --git a/src/main/java/edu/harvard/iq/dataverse/util/json/JsonPrinter.java b/src/main/java/edu/harvard/iq/dataverse/util/json/JsonPrinter.java index 8763a3a9ccd..8524cdee77d 100644 --- a/src/main/java/edu/harvard/iq/dataverse/util/json/JsonPrinter.java +++ b/src/main/java/edu/harvard/iq/dataverse/util/json/JsonPrinter.java @@ -600,6 +600,7 @@ public static JsonObjectBuilder json(DataFile df, FileMetadata fileMetadata) { .add("md5", getMd5IfItExists(df.getChecksumType(), df.getChecksumValue())) .add("checksum", getChecksumTypeAndValue(df.getChecksumType(), df.getChecksumValue())) .add("tabularTags", getTabularFileTags(df)) + .add("creationDate", df.getCreateDateFormattedYYYYMMDD()) ; } diff --git a/src/main/java/propertyFiles/Bundle.properties b/src/main/java/propertyFiles/Bundle.properties index 4b409f3f8c7..06ca25a2d81 100755 --- a/src/main/java/propertyFiles/Bundle.properties +++ b/src/main/java/propertyFiles/Bundle.properties @@ -69,6 +69,8 @@ htmlAllowedTags=, ,
,
, , ,
,
,
, < toggleNavigation=Toggle navigation defaultBody=Default Body filter=Filter +to=to +of=of # dataverse_header.xhtml header.noscript=Please enable JavaScript in your browser. It is required to use most of the features of Dataverse. @@ -1578,6 +1580,7 @@ file.dataFilesTab.versions.description.deaccessionedReason=Deaccessioned Reason: file.dataFilesTab.versions.description.beAccessedAt=The dataset can now be accessed at: file.dataFilesTab.versions.viewDetails.btn=View Details file.dataFilesTab.versions.widget.viewMoreInfo=To view more information about the versions of this dataset, and to edit it if this is your dataset, please visit the full version of this dataset at the {2}. +file.dataFilesTab.versions.preloadmessage=(Loading versions...) file.deleteDialog.tip=Are you sure you want to delete this dataset and all of its files? You cannot undelete this dataset. file.deleteDialog.header=Delete Dataset file.deleteDraftDialog.tip=Are you sure you want to delete this draft version? Files will be reverted to the most recently published version. You cannot undelete this draft. @@ -1863,6 +1866,10 @@ mydataFragment.publicationStatus=Publication Status mydataFragment.roles=Roles mydataFragment.resultsByUserName=Results by Username mydataFragment.search=Search my data... +mydata.result=Result +mydata.results=Results +mydata.viewnext=View Next +mydata.more=More file.provenance=Provenance file.editProvenanceDialog=Provenance diff --git a/src/main/webapp/dataset-versions.xhtml b/src/main/webapp/dataset-versions.xhtml index fb37cff8ff6..492e9c17dc3 100644 --- a/src/main/webapp/dataset-versions.xhtml +++ b/src/main/webapp/dataset-versions.xhtml @@ -23,7 +23,7 @@ - diff --git a/src/main/webapp/mydata_fragment.xhtml b/src/main/webapp/mydata_fragment.xhtml index 81990011f9c..55f66943a4c 100644 --- a/src/main/webapp/mydata_fragment.xhtml +++ b/src/main/webapp/mydata_fragment.xhtml @@ -111,11 +111,27 @@ This variable is needed by mydata.js to make the ajax call var RETRIEVE_DATA_API_PATH = '#{MyDataPage.retrieveDataFullAPIPath}'; - - + diff --git a/src/main/webapp/mydata_templates/cards_minimum.html b/src/main/webapp/mydata_templates/cards_minimum.html index 8c32be5b64b..88027b62ca8 100644 --- a/src/main/webapp/mydata_templates/cards_minimum.html +++ b/src/main/webapp/mydata_templates/cards_minimum.html @@ -26,11 +26,11 @@ {{ card_info.name }} {% endif %} - {#({{ loop.index }})#} {% if card_info.is_draft_state %}Draft {% endif %} - {% if card_info.is_in_review_state %}In Review {% endif %} - {% if card_info.is_unpublished_state %}Unpublished {% endif %} - {% if card_info.is_published %} Published {% endif %} - {% if card_info.is_deaccesioned %} Deaccessioned {% endif %} + {#({{ loop.index }})#} {% if card_info.is_draft_state %} {% endif %} + {% if card_info.is_in_review_state %} {% endif %} + {% if card_info.is_unpublished_state %} {% endif %} + {% if card_info.is_published %} {% endif %} + {% if card_info.is_deaccesioned %} {% endif %} {% for role_name in card_info.user_roles %} diff --git a/src/main/webapp/mydata_templates/result_message_only.html b/src/main/webapp/mydata_templates/result_message_only.html index db985116a9f..80ba003dca9 100644 --- a/src/main/webapp/mydata_templates/result_message_only.html +++ b/src/main/webapp/mydata_templates/result_message_only.html @@ -22,12 +22,12 @@ {% if pagination_data.endCardNumber > pagination_data.startCardNumber %} {# {{ pagination_data.startCardNumber }} to {{ pagination_data.endCardNumber }} of #} - 1 to {{ pagination_data.endCardNumber }} of + 1 {{ pagination_data.endCardNumber }} {% endif %} {% if pagination_data.numResults > 1 %} - {{ pagination_data.numResults }} Results + {{ pagination_data.numResults }} {% elif pagination_data.numResults == 1 %} - 1 Result + 1 {% endif %} diff --git a/src/main/webapp/resources/js/mydata.js b/src/main/webapp/resources/js/mydata.js index 36678570acf..182df7cc62f 100644 --- a/src/main/webapp/resources/js/mydata.js +++ b/src/main/webapp/resources/js/mydata.js @@ -2,6 +2,19 @@ var MYDATA_DEBUG_ON = false; // activate to show json, form info, etc var SHOW_PAGINATION = false; // pagination is available var APPEND_CARDS_TO_BOTTOM = false; // always starts as false +// bundle text variables +var mydataresult = ''; +var mydataresults = ''; +var mydataviewnext = ''; +var mydatamore = ''; +var draft = ''; +var inreview = ''; +var unpublished = ''; +var published = ''; +var deaccessioned = ''; +var mydatato = ''; +var mydataof = ''; + function bind_checkbox_labels(){ // This should be generalized to one function....once css is set @@ -305,7 +318,14 @@ function updatePagination(json_data){ $("#div-pagination").html(result_msg_html); } - + + $('#result').html(mydataresult); + $('#results').html(mydataresults); + + $('#to').html(mydatato); + $('#of').html(mydataof); + + // -------------------------------- // If this isn't the last page, show // a "more results" link after the last card @@ -314,12 +334,14 @@ function updatePagination(json_data){ $('#lnk_add_more_cards').attr("rel", pagination_json.nextPageNumber); //console.log("update link to: " + pagination_json.nextPageNumber); $('#div-more-cards-link').show(); - - var result_label = 'Results'; + + var view_next = mydataviewnext; + var more = mydatamore; + var result_label = mydataresults; if (pagination_json.numberNextResults == 1){ - result_label = 'Result'; + result_label = mydataresult; } - $('#lnk_add_more_cards').html('View Next ' + pagination_json.numberNextResults + ' ' + result_label + ' (' + pagination_json.remainingCards + ' More)'); + $('#lnk_add_more_cards').html(view_next + ' ' + pagination_json.numberNextResults + ' ' + result_label + ' (' + pagination_json.remainingCards + ' ' + more +')'); } bindPages(); } @@ -439,7 +461,40 @@ function submit_my_data_search(){ check_card_images(); // bind_filter_remove_tags(); $('#ajaxStatusPanel_start').hide(); - + + + if ($("span.label.draft")) { + var y = $("span.label.draft"); + for (var i = 0; i < y.length; i++) { + y[i].innerHTML = draft; + } + } + if ($("span.label.inreview")) { + var y = $("span.label.inreview"); + for (var i = 0; i < y.length; i++) { + y[i].innerHTML = inreview; + } + } + if ($("span.label.published")) { + var y = $("span.label.published"); + for (var i = 0; i < y.length; i++) { + y[i].innerHTML = published; + } + } + if ($("span.label.unpublished")) { + var y = $("span.label.unpublished"); + for (var i = 0; i < y.length; i++) { + y[i].innerHTML = unpublished; + } + } + if ($("span.label.deaccessioned")) { + var y = $("span.label.deaccessioned"); + for (var i = 0; i < y.length; i++) { + y[i].innerHTML = deaccessioned; + } + } + + // -------------------------------- // (6) Update address bar // --------------------------------