org.hippoecm.hst.configuration.hosting.VirtualHost.getHostGroupName()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(10.3k)|赞(0)|评价(0)|浏览(125)

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

VirtualHost.getHostGroupName介绍

暂无

代码示例

代码示例来源:origin: org.onehippo.cms7.hst.components/hst-core

@Override
public String getHostGroupName() {
  return delegatee.getHostGroupName();
}

代码示例来源:origin: org.onehippo.cms7.hst.client-modules/hst-page-composer

@Override
public Optional<Channel> getChannelByMountId(final String mountId) {
  if (StringUtils.isBlank(mountId)) {
    throw new IllegalArgumentException("MountId argument must not be blank");
  }
  final VirtualHost virtualHost = getCurrentVirtualHost();
  final List<Mount> mounts = virtualHost.getVirtualHosts().getMountsByHostGroup(virtualHost.getHostGroupName());
  return mounts.stream()
      .filter(mount -> StringUtils.equals(mount.getIdentifier(), mountId))
      .map(Mount::getChannel)
      .filter(Objects::nonNull)
      .findFirst();
}

代码示例来源:origin: org.onehippo.cms7.hst.components/hst-core

public HstLink create(Node node, HstRequestContext requestContext,  String mountAlias, String type) {
  Mount targetMount = requestContext.getMount(mountAlias, type);
  if(targetMount == null) {
    String[] messages = {mountAlias , requestContext.getVirtualHost().getHostGroupName(), type};
    log.info("Cannot create a link for mountAlias '{}' as it cannot be found in the host group '{}' for type '{}'", messages);
    return null;
  }
  log.debug("Target Mount found for mountAlias '{}'. Create link for target Mount", mountAlias);
  return create(node, targetMount);
}

代码示例来源:origin: org.onehippo.cms7.hst.client-modules/hst-page-composer

@Override
public List<Channel> getChannels(final boolean previewConfigRequired,
                 final boolean workspaceRequired,
                 final boolean skipBranches,
                 final boolean skipConfigurationLocked) {
  final VirtualHost virtualHost = getCurrentVirtualHost();
  return virtualHost.getVirtualHosts().getChannels(virtualHost.getHostGroupName())
      .values()
      .stream()
      .filter(channel -> previewConfigRequiredFiltered(channel, previewConfigRequired))
      .filter(channel -> workspaceFiltered(channel, workspaceRequired))
      .filter(channel -> !skipBranches || channel.getBranchOf() == null)
      .filter(channel -> !channel.isConfigurationLocked())
      .collect(Collectors.toList());
}

代码示例来源:origin: org.onehippo.cms7.hst.components/hst-core

public HstLink create(Node node, HstRequestContext requestContext,  String mountAlias) {
  Mount targetMount = requestContext.getMount(mountAlias);
  if(targetMount == null) {
    Mount currentMount = requestContext.getResolvedMount().getMount();
    StringBuffer types = new StringBuffer();
    for(String type: currentMount.getTypes()) {
      if(types.length() > 0) {
        types.append(",");
      }
      types.append(type);
    }
    String[] messages = {mountAlias , currentMount.getVirtualHost().getHostGroupName(), types.toString()};
    log.info("Cannot create a link for mountAlias '{}' as it cannot be found in the host group '{}' and one of the types '{}'", messages);
    return null;
  }
  
  log.debug("Target Mount found for mountAlias '{}'. Create link for target Mount", mountAlias);
  return create(node, targetMount);
}

代码示例来源:origin: org.onehippo.cms7.hst.client-modules/hst-page-composer

private List<HstPropertyDefinition> getHstPropertyDefinitions(final String channelId) {
  final String currentHostGroupName = getCurrentVirtualHost().getHostGroupName();
  return getAllVirtualHosts().getPropertyDefinitions(currentHostGroupName, channelId);
}

代码示例来源:origin: org.onehippo.cms7.hst.client-modules/hst-page-composer

private String getChannelLockedBy(final String channelId) {
  final String hostGroupName = getCurrentVirtualHost().getHostGroupName();
  final String channelPath = getAllVirtualHosts().getChannelById(hostGroupName, channelId).getChannelPath();
  try {
    final Node channelNode = RequestContextProvider.get().getSession().getNode(channelPath);
    if (channelNode.hasProperty(HstNodeTypes.GENERAL_PROPERTY_LOCKED_BY)) {
      return channelNode.getProperty(HstNodeTypes.GENERAL_PROPERTY_LOCKED_BY).getString();
    }
  } catch (RepositoryException e) {
    if (log.isDebugEnabled()) {
      log.info("Failed to retrieve locked-by information for channel '{}'", channelId, e);
    } else {
      log.info("Failed to retrieve locked-by information for channel '{}'", channelId, e.toString());
    }
  }
  return null;
}

代码示例来源:origin: org.onehippo.cms7.hst.client-modules/hst-page-composer

private void deleteBranches(final HstRequestContext requestContext, final Channel master) throws RepositoryException, HstConfigurationException {
  VirtualHost virtualHost = requestContext.getResolvedMount().getMount().getVirtualHost();
  String hostGroupName = virtualHost.getHostGroupName();
  Map<String, Channel> channels = virtualHost.getVirtualHosts().getChannels(hostGroupName);
  List<Channel> branches = channels.values().stream()
      // only the live channels since #delete(session, channel) will also delete the preview
      .filter(channel -> !channel.isPreview() && master.getId().equals(channel.getBranchOf()))
      .collect(Collectors.toList());
  // remove the branches as well
  for (Channel branch : branches) {
    delete(requestContext.getSession(), branch.getHstConfigPath());
  }
}

代码示例来源:origin: org.onehippo.cms7.hst.client-modules/hst-page-composer

private boolean isChannelSettingsEditable(final String channelId) {
  final String hostGroupName = getCurrentVirtualHost().getHostGroupName();
  Channel channel = getAllVirtualHosts().getChannelById(hostGroupName, channelId);
  return channel.isChannelSettingsEditable();
}

代码示例来源:origin: org.onehippo.cms7.hst.client-modules/hst-page-composer

@Override
public Channel getChannel(final String channelId) throws ChannelException {
  final VirtualHost virtualHost = getCurrentVirtualHost();
  final Channel channel = getAllVirtualHosts().getChannelById(virtualHost.getHostGroupName(), channelId);
  if (channel == null) {
    throw new ChannelNotFoundException(channelId);
  }
  return channel;
}

代码示例来源:origin: org.onehippo.cms7.hst.components/hst-core

String hostGroup = mount.getVirtualHost().getHostGroupName();
    log.error("Incorrect hst:hosts configuration. Not allowed to have multiple mount's having the same " +
        "'alias/type/types' combination within a single hst:hostgroup. Failed for mount '{}' in " +
        "hostgroup '" + mount.getVirtualHost().getHostGroupName()+"' for host '" +
        mount.getVirtualHost().getHostName() + "'. Make sure that you add a unique 'alias' in " +
        "combination with the 'types' on the mount within a single hostgroup. The mount '{}' cannot " +

代码示例来源:origin: org.onehippo.cms7.hst.components/hst-core

log.debug("We already did find a possible matching host ('{}') with not an explicit portnumber match but we'll use host ('{}') as this one is equally suited.", host.getHostName() + " (hostgroup="+host.getHostGroupName()+")", tryHost.getHostName() + " (hostgroup="+tryHost.getHostGroupName()+")");

代码示例来源:origin: org.onehippo.cms7.hst.client-modules/hst-page-composer

@Override
public void saveChannel(Session session, final String channelId, Channel channel) throws RepositoryException, IllegalStateException, ChannelException {
  if (!StringUtils.equals(channel.getId(), channelId)) {
    throw new ChannelException("Channel object does not contain the correct id, that should be " + channelId);
  }
  if (!channel.isChannelSettingsEditable()) {
    throw new ChannelException("Channel object is not editable because not part of preview configuration or " +
        "not part of the HST workspace");
  }
  final String currentHostGroupName = getCurrentVirtualHost().getHostGroupName();
  this.channelManager.save(currentHostGroupName, channel);
}

代码示例来源:origin: org.onehippo.cms7.hst.components/hst-core

@Override
public Mount getMount(String alias, String type) {
  checkStateValidity();
  checkMatchingPhaseFinished("getMount");
  if (alias == null || type == null) {
    throw new IllegalArgumentException("Alias and type are not allowed to be null");
  }
  String mappedAlias = getResolvedMount().getMount().getMountProperties().get(alias.toLowerCase());
  if (mappedAlias != null) {
    Mount mount = getVirtualHost().getVirtualHosts().getMountByGroupAliasAndType(getVirtualHost().getHostGroupName(), mappedAlias, type);
    if (mount != null) {
      return mount;
    } else {
      log.debug("We did not find a mapped mount for mappedAlias '{}'. Try to find a mount for alias '{}' directly", mappedAlias, alias);
    }
  } else {
    log.debug("Did not find a mappedAlias for alias '{}'. Try alias directly", alias);
  }
  Mount mount = getVirtualHost().getVirtualHosts().getMountByGroupAliasAndType(getVirtualHost().getHostGroupName(), alias.toLowerCase(), type);
  if (mount == null) {
    log.debug("We did not find a direct mount for alias '{}'. Return null.", alias);
  }
  return mount;
}

代码示例来源:origin: org.onehippo.cms7.hst.components/hst-core

private Mount lookupMount(String alias) {
  Mount currentMount = getResolvedMount().getMount();
  String hostGroupName = currentMount.getVirtualHost().getHostGroupName();
  VirtualHosts hosts = currentMount.getVirtualHost().getVirtualHosts();
  List<Mount> possibleMounts = new ArrayList<Mount>();

代码示例来源:origin: org.onehippo.cms7.hst.client-modules/hst-page-composer

@Override
public ChannelInfoDescription getChannelInfoDescription(final String channelId, final String locale) throws ChannelException {
  try {
    Class<? extends ChannelInfo> channelInfoClass = getAllVirtualHosts().getChannelInfoClass(getCurrentVirtualHost().getHostGroupName(), channelId);

代码示例来源:origin: org.onehippo.cms7.hst.components/hst-core

if(hostGroupName == null) {
  candidateMounts.addAll(findAllCandidateMounts(rewriteMount, rewritePath,
      rewriteMount.getVirtualHost().getHostGroupName(), type));
} else {
  candidateMounts.addAll(findAllCandidateMounts(rewriteMount, rewritePath, hostGroupName, type));

代码示例来源:origin: org.onehippo.cms7.hst.components/hst-core

public List<HstLink> createAll(final Node node, final HstRequestContext hstRequestContext, final boolean crossMount) {
  final Mount mount = hstRequestContext.getResolvedMount().getMount();
  final String type = mount.getType();
  final String hostGroupName = mount.getVirtualHost().getHostGroupName();
  return createAll(node, hstRequestContext, hostGroupName, type, crossMount);
}

代码示例来源:origin: org.onehippo.cms7.hst.components/hst-core

if (hostGroupName == null) {
  mountsForHostGroup = rewriteMount.getVirtualHost().getVirtualHosts()
      .getMountsByHostGroup(rewriteMount.getVirtualHost().getHostGroupName());
} else {
  mountsForHostGroup = rewriteMount.getVirtualHost().getVirtualHosts().getMountsByHostGroup(hostGroupName);

代码示例来源:origin: org.onehippo.cms7.hst.client-modules/hst-cms-rest

return;
final String hostGroupNameForCmsHost = resolvedVirtualHost.getVirtualHost().getHostGroupName();
requestContext.setAttribute(HOST_GROUP_NAME_FOR_CMS_HOST, hostGroupNameForCmsHost);
context.invokeNext();

相关文章