gpt4 book ai didi

org.hippoecm.addon.workflow.WorkflowDescriptorModel.getObject()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-24 16:53:05 27 4
gpt4 key购买 nike

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

WorkflowDescriptorModel.getObject介绍

暂无

代码示例

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

@Override
public WorkflowDescriptor getModelObject() {
  WorkflowDescriptorModel wdm = (WorkflowDescriptorModel) getDefaultModel();
  if (wdm != null) {
    return wdm.getObject();
  }
  return null;
}

代码示例来源: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-editor-frontend

private Map<String, Serializable> obtainWorkflowHints(WorkflowDescriptorModel model) {
  Map<String, Serializable> info = Collections.emptyMap();
  try {
    WorkflowDescriptor workflowDescriptor = model.getObject();
    if (workflowDescriptor != null) {
      WorkflowManager manager = obtainUserSession().getWorkflowManager();
      Workflow workflow = manager.getWorkflow(workflowDescriptor);
      info = workflow.hints();
    }
  } catch (RepositoryException | WorkflowException | RemoteException ex) {
    log.error(ex.getMessage());
  }
  return info;
}

代码示例来源: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-cms-translation-frontend

@SuppressWarnings("unchecked")
private Set<String> getAvailableLanguages() {
  WorkflowDescriptorModel wdm = (WorkflowDescriptorModel) TranslationWorkflowPlugin.this.getDefaultModel();
  if (wdm != null) {
    WorkflowDescriptor descriptor = wdm.getObject();
    WorkflowManager manager = UserSession.get().getWorkflowManager();
    try {
      TranslationWorkflow translationWorkflow = (TranslationWorkflow) manager.getWorkflow(descriptor);
      return (Set<String>) translationWorkflow.hints().get("available");
    } catch (RepositoryException | RemoteException | WorkflowException ex) {
      log.error("Failed to retrieve available languages", ex);
    }
  }
  return Collections.emptySet();
}

代码示例来源: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-workflowmenu

private List<Panel> buildPanelsForCategory(final Node workflowSubject, final String category) throws RepositoryException {
  List<Panel> panels = new LinkedList<>();
  WorkflowDescriptorModel model = new WorkflowDescriptorModel(category, workflowSubject);
  WorkflowDescriptor descriptor = model.getObject();
  if (descriptor == null) {
    // fall back to retrieving workflows on children
    if (workflowSubject.isNodeType(HippoNodeType.NT_HANDLE)) {
      for (Node child : new NodeIterable(workflowSubject.getNodes())) {
        if (!child.isNodeType(HippoNodeType.NT_DOCUMENT)) {
          continue;
        }
        panels.addAll(buildPanelsForCategory(child, category));
      }
    }
  } else {
    Panel panel = createPluginForWorkflow(model);
    if (panel != null) {
      panels.add(panel);
    }
  }
  return panels;
}

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

public <T extends Workflow> T getWorkflow() {
  if (workflow != null) {
    return (T) workflow;
  }
  WorkflowDescriptor descriptor = getObject();
  if (descriptor == null) {
    return null;
  }
  try {
    Session session = UserSession.get().getJcrSession();
    WorkflowManager workflowManager = ((HippoWorkspace) session.getWorkspace()).getWorkflowManager();
    workflow = workflowManager.getWorkflow(descriptor);
    return (T) workflow;
  } catch (RepositoryException e) {
    return null;
  }
}

代码示例来源: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-channel-manager-frontend

public ChannelActionsPlugin(IPluginContext context, IPluginConfig config) {
  super(context, config);
  channelManagerService = loadService("channel manager service", CONFIG_CHANNEL_MANAGER_SERVICE_ID, IChannelManagerService.class);
  if (channelManagerService != null) {
    WorkflowDescriptorModel model = (WorkflowDescriptorModel) getDefaultModel();
    if (model != null) {
      try {
        Node node = model.getNode();
        if (node.isNodeType(HippoNodeType.NT_HANDLE)) {
          WorkflowManager workflowManager = UserSession.get().getWorkflowManager();
          DocumentWorkflow workflow = (DocumentWorkflow) workflowManager.getWorkflow(model.getObject());
          if (Boolean.TRUE.equals(workflow.hints().get("previewAvailable"))) {
            addMenuDescription(model);
          }
        }
      } catch (RepositoryException | RemoteException | WorkflowException e) {
        log.error("Error getting document node from WorkflowDescriptorModel", e);
      }
    }
  }
  add(new EmptyPanel("content"));
}

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

if (node.isNodeType(HippoNodeType.NT_HANDLE)) {
  WorkflowManager workflowManager = UserSession.get().getWorkflowManager();
  DocumentWorkflow workflow = (DocumentWorkflow) workflowManager.getWorkflow(model.getObject());
  Serializable isLive = workflow.hints().get("isLive");
  isPublished = (isLive instanceof Boolean) && ((Boolean) isLive);

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