Package org.alfresco.repo.transaction

Examples of org.alfresco.repo.transaction.RetryingTransactionHelper


        final FacesContext fc = FacesContext.getCurrentInstance();

        if (id != null && id.length() != 0) {
            try {
                final NodeRef ref = new NodeRef(Repository.getStoreRef(), id);
                RetryingTransactionHelper txnHelper = Repository.getRetryingTransactionHelper(fc);
                RetryingTransactionCallback<Object> callback = new RetryingTransactionCallback<Object>() {
                    public Object execute() throws Throwable {

                        ActionImpl action = new ActionImpl(ref, BaseExecuter.NAME, null);
                        action.setParameterValue(BaseExecuter.PARAM_ACTIVE, activeFlag);
                        BaseExecuter actionExecuter = (BaseExecuter) FacesContextUtils.getWebApplicationContext(fc).getBean(BaseExecuter.NAME);
                        actionExecuter.execute(action, ref);

                        String msg = Application.getMessage(fc, MSG_SUCCESS_WEB_SET_ACTIVE);
                        FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_INFO, msg, msg);
                        String formId = Utils.getParentForm(fc,
                                event.getComponent()).getClientId(fc);
                        fc.addMessage(formId + ':' + PANEL_ID_SPACE_PROPS, facesMsg);
                        return null;
                    }
                };
                txnHelper.doInTransaction(callback);

                this.browseBean.getDocument().reset();

            } catch (InvalidNodeRefException refErr) {
                Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
View Full Code Here


  /* Main FrameworkService operations */

  @Override
  public void restartFramework() {
    final RetryingTransactionHelper transactionHelper = getTransactionService().getRetryingTransactionHelper();
    transactionHelper.doInTransaction(new RetryingTransactionCallback<Void>() {

      @Override
      public Void execute() throws Throwable {
        return AuthenticationUtil.runAs(new RunAsWork<Void>() {

View Full Code Here

TOP

Related Classes of org.alfresco.repo.transaction.RetryingTransactionHelper

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.