Package com.esri.gpt.framework.request

Examples of com.esri.gpt.framework.request.ActionResult


* @throws SQLException if a database exception occurs
* @throws CatalogIndexException if a document indexing exception occurs
*/
private void executeAssignCollection(String option, String colUuid, StringSet uuids)
  throws SQLException, CatalogIndexException {
  ActionResult result = getActionResult();
  if (colUuid.length() > 0) {
    CollectionDao colDao = new CollectionDao(this.getRequestContext());
    if (option.equalsIgnoreCase("shareWith")) {
      int nMod = colDao.addMembers(getPublisher(),uuids,colUuid);
      result.setNumberOfRecordsModified(nMod);
    } else if (option.equalsIgnoreCase("dontShareWith")) {
      int nMod = colDao.removeMembers(getPublisher(),uuids,colUuid);
      result.setNumberOfRecordsModified(nMod);
    }
  }
}
View Full Code Here


* @throws SQLException if a database exception occurs
* @throws CatalogIndexException if a document indexing exception occurs
*/
private void executeDelete(ImsMetadataAdminDao adminDao, StringSet uuids)
    throws ImsServiceException, SQLException, CatalogIndexException {
  ActionResult result = getActionResult();
  DeleteMetadataRequest imsRequest;
  imsRequest = new DeleteMetadataRequest(getRequestContext(), getPublisher());
  for (String sUuid : uuids) {
    boolean bOk = imsRequest.executeDelete(sUuid);
    if (bOk) {
      int nMod = (result.getNumberOfRecordsModified() + 1);
      result.setNumberOfRecordsModified(nMod);
    }
  }
}
View Full Code Here

* @throws SQLException if a database exception occurs
*/
private void executeTransfer(ImsMetadataAdminDao adminDao, StringSet uuids,
    String newOwnerName, String newFolderUuid)
  throws ImsServiceException, SQLException {
  ActionResult result = getActionResult();
  TransferOwnershipRequest imsRequest;
  if ((newOwnerName.length() > 0) && (newFolderUuid.length() > 0)) {
    imsRequest = new TransferOwnershipRequest(getRequestContext(),getPublisher());
    for (String sUuid : uuids) {
      boolean bOk = imsRequest.executeTransfer(sUuid,newOwnerName,newFolderUuid);
      if (bOk) {
        int nMod = (result.getNumberOfRecordsModified() + 1);
        result.setNumberOfRecordsModified(nMod);
      }
    }
  }
}
View Full Code Here

* @throws SQLException if a database exception occurs
*/
private void executeAssignAcl(ImsMetadataAdminDao adminDao, StringSet uuids,
    Groups groups, ArrayList<String> selectedGroups)
  throws ImsServiceException, SQLException, CatalogIndexException {
  ActionResult result = getActionResult();
  MetadataAcl acl = null;
  if (selectedGroups != null && selectedGroups.size() > 0) {
    if ((uuids.size() > 0) && (groups.size() > 0)) {
      acl = new MetadataAcl(getRequestContext());
      result.setNumberOfRecordsModified(adminDao.updateAcl(getPublisher(),
          uuids, acl.buildAclGroups(groups, selectedGroups)));
    } else if ((uuids.size() > 0) && (selectedGroups.size() > 0)) {
      if (selectedGroups.get(0).equalsIgnoreCase("unrestricted")) {
        result.setNumberOfRecordsModified(adminDao.updateAcl(getPublisher(),uuids, null));
      } else {
        StringBuilder sbAclXml = new StringBuilder();
        sbAclXml.append("<acl>");
        sbAclXml.append("<principal type=\"groupDn\">");
        sbAclXml.append(selectedGroups.get(0));
        sbAclXml.append("</principal>");
        sbAclXml.append("</acl>");
        result.setNumberOfRecordsModified(adminDao.updateAcl(getPublisher(),uuids, sbAclXml.toString()));
      }
    }
  } else {
    result.setNumberOfRecordsModified(adminDao.updateAcl(getPublisher(),uuids,null));
  }
}
View Full Code Here

TOP

Related Classes of com.esri.gpt.framework.request.ActionResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.