Package com.esri.gpt.framework.security.principal

Examples of com.esri.gpt.framework.security.principal.Publisher


        // skip if still no native resource
        if (nativeResource!=null) {
          String content = nativeResource.getContent();
          String sourceUri = nativeResource.getSourceUri().asString();

          Publisher publisher = createPublisherOfRepository();

          PublicationRequest publicationRequest = createPublicationRequest(publisher, content, sourceUri);

          publicationRequest.publish();
        }
View Full Code Here


private Publisher createPublisherOfRepository()
  throws SQLException, CredentialsDeniedException, NotAuthorizedException, IdentityException, ImsServiceException {

  LocalDao localDao = new LocalDao(getRequestContext());
  String uDN = localDao.readDN(getRepository().getOwnerId());
  Publisher publisher = new Publisher(getRequestContext(), uDN);

  return publisher;
}
View Full Code Here

  public boolean execute() throws Exception {
    RequestContext context = getRequestContext();

    SelectablePublishers selectablePublishers = new SelectablePublishers();
    selectablePublishers.build(context, isAdministrator(context));
    Publisher user = selectablePublishers.selectedAsPublisher(context, isAdministrator(context));

    RoleSet roleSet = new RoleSet();
    roleSet.add("gptAdministrator");
    roleSet.add("gptPublisher");
    user.getAuthenticationStatus().authorizeAction(roleSet);

    boolean hostUrlChanged = true;
    boolean titleChanged = true;
    boolean findableChanged = true;

    boolean creating = !UuidUtil.isUuid(record.getUuid());
    if (!creating) {
      HrSelectRequest select = new HrSelectRequest(context, record.getUuid());
      select.execute();
      HrRecords records = select.getQueryResult().getRecords();
      if (records.size() > 0) {
        HrRecord oldRecord = records.get(0);
        if (user.getLocalID()!=oldRecord.getOwnerId()) {
          if (!user.getIsAdministrator()) {
            throw new NotAuthorizedException("Not authorized.");
          }
        }
        if (record.getHostUrl().equals(oldRecord.getHostUrl())) {
          hostUrlChanged = false;
View Full Code Here

  public void handleXML(OperationContext context, Node root, XPath xpath)
    throws Exception {
   
    // initialize
    LOGGER.finer("Handling csw:Transaction/csw:Insert request XML...");
    Publisher publisher = new Publisher(context.getRequestContext());
   
    // find all the Insert nodes
    String locator = "csw:Insert";
    NodeList nlActions = (NodeList)xpath.evaluate(locator,root,XPathConstants.NODESET);
    if (nlActions != null) {
View Full Code Here

  public void handleXML(OperationContext context, Node root, XPath xpath)
    throws Exception {
   
    // initialize
    LOGGER.finer("Handling csw:Transaction/csw:Update request XML...");
    Publisher publisher = new Publisher(context.getRequestContext());;
   
    // find all the Update nodes
    String locator = "csw:Update";
    NodeList nlActions = (NodeList)xpath.evaluate(locator,root,XPathConstants.NODESET);
    if (nlActions != null) {
View Full Code Here

  if (actionCriteria.getSelectedRecordIdSet().size() == 0 && applyToAll==false) {
    msgBroker.addErrorMessage("catalog.publication.manageMetadata.action.err.noneSelected");
  } else {

    // check the publisher
    Publisher publisherForAction = publisher;
    if (!publisher.getIsAdministrator()) {
      String sOwner = getQueryCriteria().getOwner();
      if (sOwner.length() == 0) {
        sOwner = publisher.getKey();
      }
      if (!sOwner.equalsIgnoreCase(publisher.getKey())) {
        if (!Publisher.buildSelectablePublishers(context, true).containsKey(sOwner)) {
          throw new NotAuthorizedException("Not authorized.");
        } else {
          publisherForAction = new Publisher(context, sOwner);
        }
      }
    }

    // execute the request
View Full Code Here

  // check for a page cursor navigation event
  getPageCursorPanel().checkActionEvent(event, true);

  // prepare the publisher
  Publisher publisher = new Publisher(context);

  // determine and execute the command
  UIComponent component = event.getComponent();
  String sCommand = Val.chkStr((String) component.getAttributes().get("command"));
  if (sCommand.equals("")) {
   
  // set the sort option
  } else if (sCommand.equals("sort")) {
    String sCol = (String) component.getAttributes().get("column");
    String sDir = (String) component.getAttributes().get("defaultDirection");
    getQueryCriteria().getSortOption().setColumnKey(sCol, true, sDir);

    // execute an action
  } else if (sCommand.equals("executeAction")) {
    String sAction = actionCriteria.getActionKey();
    boolean applyToAll = Val.chkBool((String) component.getAttributes().get("applyToAll"), false);
    boolean bRequiresAdmin = sAction.equalsIgnoreCase("transfer")
        || sAction.equalsIgnoreCase("setApproved")
        || sAction.equalsIgnoreCase("setDisapproved")
        || sAction.equalsIgnoreCase("setReviewed")
        || applyToAll;
    if (bRequiresAdmin && !publisher.getIsAdministrator()) {
      throw new NotAuthorizedException("Not authorized.");
    }
    executeAction(event, context, actionCriteria, publisher, applyToAll);
  } else if (sCommand.equals("synchronize")) {
    executeSynchronization(event, context, actionCriteria);
View Full Code Here

    throws Exception {
   
    // initialize
    LOGGER.finer("Handling csw:Transaction/csw:Delete request XML...");
    TransactionOptions tOptions = context.getRequestOptions().getTransactionOptions();
    Publisher publisher = new Publisher(context.getRequestContext());
   
    // find all the Delete nodes
    String locator = "csw:Delete";
    NodeList nlActions = (NodeList)xpath.evaluate(locator,root,XPathConstants.NODESET);
    if (nlActions != null) {
View Full Code Here

* Creates new processing context.
* @param requestContext request context
* @return processing context
*/
private ProcessingContext newProcessingContext(RequestContext requestContext) {
  Publisher publisher = null;
  HttpClientRequest httpClient = HttpClientRequest.newRequest();
  httpClient.setCredentialProvider(info.newCredentialProvider());
  ProcessingContext processingContext = new ProcessingContext(requestContext, publisher, httpClient, null, false);

  FacesContextBroker contextBroker = new FacesContextBroker();
View Full Code Here

        Credentials credentials = getCredentials(request);
        if (credentials != null) {
          this.authenticate(context,credentials);
        }
      }
      Publisher publisher = new Publisher(context);

      // executeUpdate the appropriate action
      if (method.equals("GET")) {
        this.executeGet(request,response,context,publisher);
      } else if (method.equals("POST")) {
View Full Code Here

TOP

Related Classes of com.esri.gpt.framework.security.principal.Publisher

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.