@Test public void testGetQuickActionsForFolderWithoutConfiguration() { context.currentResource(context.resourceResolver().getResource("/conf/folder2")); ConfigurationColumnViewItem columnViewItem = context.request().adaptTo(ConfigurationColumnViewItem.class); String[] expectedActions = new String[] { CREATE_PULLDOWN_ACTIVATOR, CREATE_CONFIG_ACTIVATOR, CREATE_FOLDER_ACTIVATOR, DELETE_ACTIVATOR }; List<String> actualActions = columnViewItem.getQuickActionsRel(); Assert.assertArrayEquals("Returns the quick-actions", expectedActions, actualActions.toArray()); }
public List<String> getQuickActionsRel() { List<String> actions = new ArrayList<>(); if (isConfigurationContainer()) { if (!hasCommerceSetting && !resource.getPath().equals(Constants.CONF_ROOT)) { actions.add(CREATE_PULLDOWN_ACTIVATOR); actions.add(CREATE_CONFIG_ACTIVATOR); } } if (isCommerceBucket()) { actions.add(PROPERTIES_ACTIVATOR); actions.add(PUBLISH_ACTIVATOR); actions.add(UNPUBLISH_ACTIVATOR); } else { if (!actions.contains(CREATE_PULLDOWN_ACTIVATOR)) { actions.add(CREATE_PULLDOWN_ACTIVATOR); } actions.add(CREATE_FOLDER_ACTIVATOR); } if (isSafeToDelete()) { actions.add(DELETE_ACTIVATOR); } return actions; }
ConfigurationColumnViewItem { public List<String> getQuickActionsRel() { List<String> actions = new ArrayList<>(); if (isConfigurationContainer()) { if (!hasCommerceSetting && !resource.getPath().equals(Constants.CONF_ROOT)) { actions.add(CREATE_PULLDOWN_ACTIVATOR); actions.add(CREATE_CONFIG_ACTIVATOR); } } if (isCommerceBucket()) { actions.add(PROPERTIES_ACTIVATOR); actions.add(PUBLISH_ACTIVATOR); actions.add(UNPUBLISH_ACTIVATOR); } else { if (!actions.contains(CREATE_PULLDOWN_ACTIVATOR)) { actions.add(CREATE_PULLDOWN_ACTIVATOR); } actions.add(CREATE_FOLDER_ACTIVATOR); } if (isSafeToDelete()) { actions.add(DELETE_ACTIVATOR); } return actions; } }
ConfigurationColumnViewItem { public List<String> getQuickActionsRel() { List<String> actions = new ArrayList<>(); if (isConfigurationContainer()) { if (!hasCommerceSetting && !resource.getPath().equals(Constants.CONF_ROOT)) { actions.add(CREATE_PULLDOWN_ACTIVATOR); actions.add(CREATE_CONFIG_ACTIVATOR); } } if (isCommerceBucket()) { actions.add(PROPERTIES_ACTIVATOR); actions.add(PUBLISH_ACTIVATOR); actions.add(UNPUBLISH_ACTIVATOR); } else { if (!actions.contains(CREATE_PULLDOWN_ACTIVATOR)) { actions.add(CREATE_PULLDOWN_ACTIVATOR); } actions.add(CREATE_FOLDER_ACTIVATOR); } if (isSafeToDelete()) { actions.add(DELETE_ACTIVATOR); } return actions; }  }
ConfigurationColumnViewItem { public List<String> getQuickActionsRel() { List<String> actions = new ArrayList<>(); if (isConfigurationContainer()) { if (!hasCommerceSetting && !resource.getPath().equals(Constants.CONF_ROOT)) { actions.add(CREATE_PULLDOWN_ACTIVATOR); actions.add(CREATE_CONFIG_ACTIVATOR); } } if (isCommerceBucket()) { actions.add(PROPERTIES_ACTIVATOR); actions.add(PUBLISH_ACTIVATOR); actions.add(UNPUBLISH_ACTIVATOR); } else { if (!actions.contains(CREATE_PULLDOWN_ACTIVATOR)) { actions.add(CREATE_PULLDOWN_ACTIVATOR); } actions.add(CREATE_FOLDER_ACTIVATOR); } if (isSafeToDelete()) { actions.add(DELETE_ACTIVATOR); } return actions; }  @PostConstruct void initModel(); String getTitle(); boolean hasChildren(); List<String> getQuickActionsRel(); }
ConfigurationColumnViewItem { public List<String> getQuickActionsRel() { List<String> actions = new ArrayList<>(); if (isConfigurationContainer()) { if (!hasCommerceSetting && !resource.getPath().equals(Constants.CONF_ROOT)) { actions.add(CREATE_PULLDOWN_ACTIVATOR); actions.add(CREATE_CONFIG_ACTIVATOR); } } if (isCommerceBucket()) { actions.add(PROPERTIES_ACTIVATOR); actions.add(PUBLISH_ACTIVATOR); actions.add(UNPUBLISH_ACTIVATOR); } else { if (!actions.contains(CREATE_PULLDOWN_ACTIVATOR)) { actions.add(CREATE_PULLDOWN_ACTIVATOR); } actions.add(CREATE_FOLDER_ACTIVATOR); } if (isSafeToDelete()) { actions.add(DELETE_ACTIVATOR); } return actions; }  @PostConstruct void initModel(); String getTitle(); boolean hasChildren(); List<String> getQuickActionsRel();  }