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

Make record editable #112

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
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 @@ -1479,6 +1479,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
3 changes: 3 additions & 0 deletions geoportal/src/gpt/resources/gpt.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4276,3 +4276,6 @@ catalog.search.searchSite.dataGov.abstract = Search Data.gov
catalog.search.searchSite.geoDab = GEO DAB
catalog.search.searchSite.geoDab.abstract = Search GEO DAB
catalog.search.resource.details.togglesection = Open/Close section

// 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