gpt4 book ai didi

org.brixcms.workspace.Workspace.setAttribute()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-24 23:31:05 28 4
gpt4 key购买 nike

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

Workspace.setAttribute介绍

[英]Sets the attribute with specified key to specified value. To remove attribute use null value.
[中]将具有指定键的属性设置为指定值。要删除属性,请使用null值。

代码示例

代码示例来源:origin: brix-cms/brix-cms

/**
 * Sets the Comment for the Workspace
 *
 * @param workspace the comment holding Workspace
 * @param comment   the comment for the Workspace
 */
public void setComment(Workspace workspace, String comment) {
  workspace.setAttribute(WORKSPACE_COMMENT, comment);
}

代码示例来源:origin: brix-cms/brix-cms

public void setAttribute(String attributeKey, String attributeValue) throws RemoteException {
    delegate.setAttribute(attributeKey, attributeValue);
  }
}

代码示例来源:origin: brix-cms/brix-cms

public void setPrototypeName(Workspace workspace, String name) {
  workspace.setAttribute(WORKSPACE_ATTRIBUTE_PROTOTYPE_NAME, name);
}

代码示例来源:origin: brix-cms/brix-cms

public void setWorkspaceName(Workspace workspace, String name) {
  workspace.setAttribute(WORKSPACE_ATTRIBUTE_NAME, name);
}

代码示例来源:origin: brix-cms/brix-cms

public void setWorkspaceState(Workspace workspace, String state) {
  workspace.setAttribute(WORKSPACE_ATTRIBUTE_STATE, state);
}

代码示例来源:origin: brix-cms/brix-cms

public void setCreated(Workspace workspace, Date created) {
  DateFormat df = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG);
  String formatted = df.format(created);
  workspace.setAttribute(WORKSPACE_ATTRIBUTE_CREATED, formatted);
}

代码示例来源:origin: brix-cms/brix-cms

public void createSnapshot(Workspace workspace, String comment) {
  if (!SitePlugin.get().isSiteWorkspace(workspace)) {
    throw new IllegalStateException("Workspace must be a Site workspace");
  }
  Workspace targetWorkspace = brix.getWorkspaceManager().createWorkspace();
  targetWorkspace.setAttribute(Brix.WORKSPACE_ATTRIBUTE_TYPE, WORKSPACE_TYPE);
  targetWorkspace.setAttribute(WORKSPACE_ATTRIBUTE_SITE_NAME, SitePlugin.get().getWorkspaceName(workspace));
  targetWorkspace.setAttribute(WORKSPACE_COMMENT, comment);
  setCreated(targetWorkspace, new Date());
  JcrSession originalSession = brix.getCurrentSession(workspace.getId());
  JcrSession targetSession = brix.getCurrentSession(targetWorkspace.getId());
  brix.clone(originalSession, targetSession);
}

代码示例来源:origin: brix-cms/brix-cms

public Workspace createSite(String name, String state) {
  Workspace workspace = brix.getWorkspaceManager().createWorkspace();
  workspace.setAttribute(Brix.WORKSPACE_ATTRIBUTE_TYPE, WORKSPACE_TYPE);
  setWorkspaceName(workspace, name);
  setWorkspaceState(workspace, state);
  return workspace;
}

代码示例来源:origin: brix-cms/brix-cms

public void createPrototype(List<JcrNode> nodes, String prototypeName) {
  if (nodes.isEmpty()) {
    throw new IllegalStateException("Node list can not be empty.");
  }
  Workspace workspace = brix.getWorkspaceManager().createWorkspace();
  workspace.setAttribute(Brix.WORKSPACE_ATTRIBUTE_TYPE, WORKSPACE_TYPE);
  setPrototypeName(workspace, prototypeName);
  JcrSession destSession = brix.getCurrentSession(workspace.getId());
  JcrUtil.cloneNodes(nodes, destSession.getRootNode());
  destSession.save();
}

代码示例来源:origin: brix-cms/brix-cms

public void createPrototype(Workspace originalWorkspace, String prototypeName) {
  Workspace workspace = brix.getWorkspaceManager().createWorkspace();
  workspace.setAttribute(Brix.WORKSPACE_ATTRIBUTE_TYPE, WORKSPACE_TYPE);
  setPrototypeName(workspace, prototypeName);
  JcrSession originalSession = brix.getCurrentSession(originalWorkspace.getId());
  JcrSession destSession = brix.getCurrentSession(workspace.getId());
  brix.clone(originalSession, destSession);
}

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