gpt4 book ai didi

org.hippoecm.repository.api.WorkflowDescriptor类的使用及代码示例

转载 作者:知者 更新时间:2024-03-26 16:51:05 28 4
gpt4 key购买 nike

本文整理了Java中org.hippoecm.repository.api.WorkflowDescriptor类的一些代码示例,展示了WorkflowDescriptor类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorkflowDescriptor类的具体详情如下:
包路径:org.hippoecm.repository.api.WorkflowDescriptor
类名称:WorkflowDescriptor

WorkflowDescriptor介绍

暂无

代码示例

代码示例来源:origin: org.onehippo.cms7/hippo-repository-engine

RemoteWorkflowDescriptor(WorkflowDescriptor workflowDescriptor, String category, String identifier) throws RepositoryException {
    this.category = category;
    this.identifier = identifier;
    this.display = workflowDescriptor.getDisplayName();
    this.attributes = new TreeMap<String, String>();
    for (String attributeKey : workflowDescriptor.getAttribute(null).split(" "))
      this.attributes.put(attributeKey, workflowDescriptor.getAttribute(attributeKey));
    this.hints = workflowDescriptor.hints();
    try {
      Class<Workflow>[] workflowInterfaces = workflowDescriptor.getInterfaces();
      if (workflowInterfaces != null) {
        this.interfaces = new String[workflowInterfaces.length];
        for (int i = 0; i < workflowInterfaces.length; i++) {
          this.interfaces[i] = workflowInterfaces[i].getName();
        }
      } else {
        this.interfaces = null;
      }
    } catch (ClassNotFoundException ex) {
      this.interfaces = null;
    }
  }
}

代码示例来源:origin: org.onehippo.cms7/hippo-repository-connector

public Map<String,Serializable> hints() throws RepositoryException, RemoteException {
  return descriptor.hints();
}

代码示例来源:origin: org.onehippo.cms7/hippo-repository-testutils

protected boolean isApplicableMethod(Node node) throws Exception {
  WorkflowDescriptor descriptor = getWorkflowDescriptor(node);
  if (descriptor == null) {
    return false;
  }
  for (Class<Workflow> c : descriptor.getInterfaces()) {
    if (c.equals(getWorkflowClass())) {
      Map<String, Serializable> hints = descriptor.hints();
      if (hints == null) {
        return true;
      }
      Serializable info = hints.get(getWorkflowMethodName());
      if (info instanceof Boolean) {
        return (Boolean) info;
      } else {
        // don't understand, try it
        return true;
      }
    }
  }
  return false;
}

代码示例来源:origin: org.onehippo.cms7/hippo-repository-connector

public String getDisplayName() throws RepositoryException {
  return descriptor.getDisplayName();
}

代码示例来源:origin: org.onehippo.cms7/hippo-repository-connector

public String getAttribute(String name) throws RepositoryException, RemoteException {
  return descriptor.getAttribute(name);
}

代码示例来源:origin: org.onehippo.cms7/hippo-repository-connector

public String[] getInterfaces() throws ClassNotFoundException, RepositoryException, RemoteException {
  Class<Workflow>[] interfaces = descriptor.getInterfaces();
  String[] classes = new String[interfaces.length];
  for(int i=0; i<interfaces.length; i++) {
    classes[i] = interfaces[i].getName();
  }
  return classes;
}

代码示例来源:origin: org.onehippo.cms7/hippo-cms-translation-frontend

@Override
  protected Boolean load() {
    WorkflowDescriptor descriptor = getModelObject();
    if (descriptor != null) {
      try {
        Map<String, Serializable> hints = descriptor.hints();
        if (hints.containsKey("addTranslation") && hints.get("addTranslation").equals(Boolean.FALSE)) {
          return false;
        }
      } catch (RepositoryException e) {
        log.error("Failed to analyze hints for translations workflow", e);
      }
    }
    return true;
  }
};

代码示例来源:origin: org.onehippo.cms7/hippo-cms-console-frontend

public WorkflowDialog(WorkflowPlugin plugin) {
  this.plugin = plugin;
  final IModel<Node> nodeModel = (IModel<Node>)plugin.getDefaultModel();
  final MultiLineLabel dump = new MultiLineLabel("dump", "");
  dump.setOutputMarkupId(true);
  add(dump);
  try {
    Node subject = nodeModel.getObject();
    ByteArrayOutputStream ostream = new ByteArrayOutputStream();
    PrintWriter out = new PrintWriter(ostream);
    Session session = subject.getSession();
    WorkflowManager workflowManager = ((HippoWorkspace) session.getWorkspace()).getWorkflowManager();
    Node categories = session.getRootNode().getNode("hippo:configuration/hippo:workflows");
    for (NodeIterator iter = categories.getNodes(); iter.hasNext();) {
      Node category = iter.nextNode();
      WorkflowDescriptor descriptor = workflowManager.getWorkflowDescriptor(category.getName(), subject);
      out.println("Category " + category.getName() + ": "
          + (descriptor != null ? descriptor.getDisplayName() : "none"));
    }
    out.flush();
    dump.setDefaultModel(new Model<String>(new String(ostream.toByteArray())));
  } catch(RepositoryException ex) {
    dump.setDefaultModel(new Model<String>(ex.getClass().getName()+": "+ex.getMessage()));
  }
  setOkVisible(false);
  setFocusOnOk();
}

代码示例来源:origin: org.onehippo.cms7/hippo-cms-workflowmenu

private Panel createPluginForWorkflow(WorkflowDescriptorModel pluginModel) throws RepositoryException {
  WorkflowDescriptor descriptor = pluginModel.getObject();
  String pluginRenderer = descriptor.getAttribute(FrontendNodeType.FRONTEND_RENDERER);
  if (pluginRenderer == null) {
    log.warn("No plugin renderer configured.");
    return null;
  }
  pluginRenderer = pluginRenderer.trim();
  if (!pluginRenderer.startsWith("/")) {
    log.warn("The frontend:pluginrenderer property is no longer supported, only a child node of type frontend:plugin or frontend:plugincluster.");
    return null;
  } else {
    Node node = UserSession.get().getJcrSession().getNode(pluginRenderer);
    final JcrNodeModel nodeModel = new JcrNodeModel(node);
    if (node.isNodeType(FrontendNodeType.NT_PLUGINCLUSTER)) {
      JcrClusterConfig jcrPluginConfig = new JcrClusterConfig(nodeModel);
      return (Panel) plugins.startRenderer(jcrPluginConfig, pluginModel);
    } else {
      JcrPluginConfig jcrPluginConfig = new JcrPluginConfig(nodeModel);
      return (Panel) plugins.startRenderer(jcrPluginConfig, pluginModel);
    }
  }
}

代码示例来源:origin: org.onehippo.cms7/hippo-addon-publication-workflow-frontend

@Override
  public void onModelChanged() {
    super.onModelChanged();
    WorkflowDescriptorModel model = (WorkflowDescriptorModel) getDefaultModel();
    if (model != null) {
      try {
        Map<String, Serializable> hints = ((WorkflowDescriptor) model.getObject()).hints();
        if (hints.containsKey("unlock") && (hints.get("unlock") instanceof Boolean)
            && !((Boolean) hints.get("unlock")).booleanValue()) {
          unlockAction.setVisible(false);
        }
      } catch (RepositoryException ex) {
        // status unknown, maybe there are legit reasons for this, so don't emit a warning
        log.info(ex.getClass().getName() + ": " + ex.getMessage());
      }
    }
  }
}

代码示例来源:origin: org.onehippo.cms7/hippo-cms-plugins

public WorkflowDialog(WorkflowPlugin plugin) {
  this.plugin = plugin;
  final JcrNodeModel nodeModel = (JcrNodeModel) plugin.getDefaultModel();
  final MultiLineLabel dump = new MultiLineLabel("dump", "");
  dump.setOutputMarkupId(true);
  add(dump);
  try {
    Node subject = nodeModel.getNode();
    ByteArrayOutputStream ostream = new ByteArrayOutputStream();
    PrintWriter out = new PrintWriter(ostream);
    Session session = subject.getSession();
    WorkflowManager workflowManager = ((HippoWorkspace) session.getWorkspace()).getWorkflowManager();
    Node categories = session.getRootNode().getNode("hippo:configuration/hippo:workflows");
    for (NodeIterator iter = categories.getNodes(); iter.hasNext();) {
      Node category = iter.nextNode();
      WorkflowDescriptor descriptor = workflowManager.getWorkflowDescriptor(category.getName(), subject);
      out.println("Category " + category.getName() + ": "
          + (descriptor != null ? descriptor.getDisplayName() : "none"));
    }
    out.flush();
    dump.setDefaultModel(new Model<String>(new String(ostream.toByteArray())));
  } catch(RepositoryException ex) {
    dump.setDefaultModel(new Model<String>(ex.getClass().getName()+": "+ex.getMessage()));
  }
  setOkVisible(false);
  setFocusOnOk();
}

代码示例来源:origin: org.onehippo.cms7/hippo-addon-publication-workflow-frontend

@Override
  public void onModelChanged() {
    super.onModelChanged();
    WorkflowDescriptorModel model = (WorkflowDescriptorModel) getDefaultModel();
    schedule = null;
    if (model != null) {
      try {
        Node node = model.getNode();
        state = node.getProperty("hippostdpubwf:type").getString();
        if (node.hasProperty("hipposched:triggers/default/hipposched:fireTime")) {
          schedule = node.getProperty("hipposched:triggers/default/hipposched:fireTime").getDate().getTime();
        } else if (node.hasProperty("hippostdpubwf:reqdate")) {
          schedule = new Date(node.getProperty("hippostdpubwf:reqdate").getLong());
        }
        Map<String, Serializable> hints = ((WorkflowDescriptor)model.getObject()).hints();
        if (hints.containsKey("cancelRequest") && !((Boolean)hints.get("cancelRequest")).booleanValue()) {
          cancelAction.setVisible(false);
        }
      } catch (RepositoryException ex) {
        // status unknown, maybe there are legit reasons for this, so don't emit a warning
        log.info(ex.getClass().getName() + ": " + ex.getMessage());
      }
    }
  }
}

代码示例来源:origin: org.onehippo.cms7/hippo-addon-publication-workflow-frontend

schedule = new Date(node.getProperty("hippostdpubwf:reqdate").getLong());
Map<String, Serializable> hints = ((WorkflowDescriptor)model.getObject()).hints();
if (hints.containsKey("cancelRequest") && !((Boolean)hints.get("cancelRequest")).booleanValue()) {
  cancelAction.setVisible(false);

代码示例来源:origin: org.onehippo.cms7/hippo-cms-translation-frontend

WorkflowDescriptor workflow = manager.getWorkflowDescriptor("translate", docNode);
if (workflow != null) {
  final Serializable available = workflow.hints().get("translate");
  if (available != null && (Boolean) available) {
    autoTranslateModel = new PropertyModel<>(TranslationAction.this, "autoTranslateContent");

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com