Skip to content

Commit

Permalink
Merged pull request #112
Browse files Browse the repository at this point in the history
  • Loading branch information
pandzel committed Apr 13, 2016
2 parents e9b7062 + 2520415 commit b9b457d
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 1 deletion.
36 changes: 36 additions & 0 deletions geoportal/src/com/esri/gpt/catalog/arcims/ImsMetadataAdminDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -1514,6 +1514,42 @@ public void deleteIndex(PublicationRecord record)

}

/**
* Makes the selected records editable, changing the
* publication method in "editor"
*
* @param publisher the publisher executing this request
* @param uuids the set of uuids to update
*/
public int setEditable(Publisher publisher,
StringSet uuids)
throws SQLException, CatalogIndexException {

// update the database publication method
PreparedStatement st = null;
int nRows = 0;
Connection con = returnConnection().getJdbcConnection();
StringBuffer sbSql = new StringBuffer();
try {
String sUuids = uuidsToInClause(uuids);
if (sUuids.length() > 0) {
// execute the update, don't update documents in 'draft' mode
sbSql = new StringBuffer();
sbSql.append("UPDATE ").append(getResourceTableName());
sbSql.append(" SET PUBMETHOD='editor'");
sbSql.append(" WHERE DOCUUID IN (").append(sUuids).append(")");
logExpression(sbSql.toString());
LogUtil.getLogger().log(Level.INFO,sbSql.toString()+" "+sUuids);
st = con.prepareStatement(sbSql.toString());
nRows = st.executeUpdate();
}
} finally {
closeStatement(st);
}

return nRows;
}

/**
* Updates the synchronization status code for a collection of records.
* @param status the synchronization status code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ public void execute() throws Exception {
} else if (sAction.equalsIgnoreCase("setReviewed")) {
nRows = adminDao.updateApprovalStatus(getPublisher(),uuids,MmdEnums.ApprovalStatus.reviewed);
}
/** Action: "SetEditable" **/
else if (sAction.equalsIgnoreCase("setEditable")) {
nRows = adminDao.setEditable(getPublisher(),uuids);
}

getActionResult().setNumberOfRecordsModified(nRows);
this.hadUnalteredDraftDocuments = adminDao.hadUnalteredDraftDocuments();

Expand Down
6 changes: 5 additions & 1 deletion geoportal/src/gpt/resources/gpt.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4286,6 +4286,7 @@ catalog.search.searchSite.geoDab = GEO DAB
catalog.search.searchSite.geoDab.abstract = Search GEO DAB
catalog.search.resource.details.togglesection = Open/Close section

<<<<<<< HEAD
# v1.2.7 ======================================================================

# DCAT Metadata
Expand Down Expand Up @@ -4331,4 +4332,7 @@ catalog.mdParam.schema.dcat.dataQuality = Data Quality
catalog.harvest.manage.edit.protocol.robots.mode.caption = Respect 'robots.txt' if present:
catalog.harvest.manage.edit.protocol.robots.mode.inherit = Inherit
catalog.harvest.manage.edit.protocol.robots.mode.always = Always
catalog.harvest.manage.edit.protocol.robots.mode.never = Never
catalog.harvest.manage.edit.protocol.robots.mode.never = Never

// Action setEditable
catalog.publication.manageMetadata.action.setEditable= Set as Editable
4 changes: 4 additions & 0 deletions geoportal/www/catalog/publication/manageMetadataBody.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,10 @@ function mmdClearAclSelection(){
<f:selectItem
itemValue="transfer"
itemLabel="#{gptMsg['catalog.publication.manageMetadata.action.transfer']}"/>
<%// SetEditable commands%>
<f:selectItem
itemValue="setEditable"
itemLabel="#{gptMsg['catalog.publication.manageMetadata.action.setEditable']}"/>
<f:selectItem
itemValue="delete"
itemLabel="#{gptMsg['catalog.publication.manageMetadata.action.delete']}"/>
Expand Down

0 comments on commit b9b457d

Please sign in to comment.