@Test public void isReady_NotReadyDueToRunmode() { ctx.runMode("publish"); ctx.currentResource("/content/empty"); final EditorLinks editorLinks = ctx.request().adaptTo(EditorLinks.class); assertFalse(editorLinks.isReady()); }
@Override public boolean isReady() { final ResourceResolver resourceResolver = request.getResourceResolver(); final boolean publishInstance = !slingSettingsService.getRunModes().contains("author"); final boolean missingLabels = StringUtils.isBlank(assetDetailsLinkLabel) && StringUtils.isBlank(assetFolderLinkLabel); final boolean missingTargetResources = resourceResolver.resolve(request, ASSET_DETAILS_PREFIX + asset.getPath()) == null || resourceResolver.resolve(request, ASSET_FOLDER_PREFIX + asset.getPath()) == null; if (asset == null || publishInstance || missingLabels || missingTargetResources) { return false; } return true; }
EditorLinksImpl extends AbstractEmptyTextComponent implements EditorLinks { @Override public boolean isReady() { final ResourceResolver resourceResolver = request.getResourceResolver(); final boolean publishInstance = !slingSettingsService.getRunModes().contains("author"); final boolean missingLabels = StringUtils.isBlank(assetDetailsLinkLabel) && StringUtils.isBlank(assetFolderLinkLabel); final boolean missingTargetResources = resourceResolver.resolve(request, ASSET_DETAILS_PREFIX + asset.getPath()) == null || resourceResolver.resolve(request, ASSET_FOLDER_PREFIX + asset.getPath()) == null; if (asset == null || publishInstance || missingLabels || missingTargetResources) { return false; } return true; } }
EditorLinksImpl extends AbstractEmptyTextComponent implements EditorLinks { @Override public boolean isReady() { final ResourceResolver resourceResolver = request.getResourceResolver(); final boolean publishInstance = !slingSettingsService.getRunModes().contains("author"); final boolean missingLabels = StringUtils.isBlank(assetDetailsLinkLabel) && StringUtils.isBlank(assetFolderLinkLabel); final boolean missingTargetResources = resourceResolver.resolve(request, ASSET_DETAILS_PREFIX + asset.getPath()) == null || resourceResolver.resolve(request, ASSET_FOLDER_PREFIX + asset.getPath()) == null; if (asset == null || publishInstance || missingLabels || missingTargetResources) { return false; } return true; }  }
EditorLinksImpl extends AbstractEmptyTextComponent implements EditorLinks { @Override public boolean isReady() { final ResourceResolver resourceResolver = request.getResourceResolver(); final boolean publishInstance = !slingSettingsService.getRunModes().contains("author"); final boolean missingLabels = StringUtils.isBlank(assetDetailsLinkLabel) && StringUtils.isBlank(assetFolderLinkLabel); final boolean missingTargetResources = resourceResolver.resolve(request, ASSET_DETAILS_PREFIX + asset.getPath()) == null || resourceResolver.resolve(request, ASSET_FOLDER_PREFIX + asset.getPath()) == null; if (asset == null || publishInstance || missingLabels || missingTargetResources) { return false; } return true; }  @Override String getAssetDetailsEditorPath(); @Override String getAssetFolderEditorPath(); @Override boolean isEmpty(); @Override boolean isReady(); @Nonnull @Override String getExportedType(); }
EditorLinksImpl extends AbstractEmptyTextComponent implements EditorLinks { @Override public boolean isReady() { final ResourceResolver resourceResolver = request.getResourceResolver(); final boolean publishInstance = !slingSettingsService.getRunModes().contains("author"); final boolean missingLabels = StringUtils.isBlank(assetDetailsLinkLabel) && StringUtils.isBlank(assetFolderLinkLabel); final boolean missingTargetResources = resourceResolver.resolve(request, ASSET_DETAILS_PREFIX + asset.getPath()) == null || resourceResolver.resolve(request, ASSET_FOLDER_PREFIX + asset.getPath()) == null; if (asset == null || publishInstance || missingLabels || missingTargetResources) { return false; } return true; }  @Override String getAssetDetailsEditorPath(); @Override String getAssetFolderEditorPath(); @Override boolean isEmpty(); @Override boolean isReady(); @Nonnull @Override String getExportedType();  }