/** Component execution. */ public ComponentResponse execute() { if (config == null) { return ComponentResponse.OK; } final ContentType contentType = config.contentType(); final boolean keepCategory = config.keepCategory().booleanValue(); final boolean keepTag = config.keepTag().booleanValue(); if (navigationKey == null) { if (contentType != null) { navigationKey = NavigationKey.contentType(contentType); } } else { if (keepCategory && navigationKey.isCategory()) { navigationKey = NavigationKey.category(navigationKey.getCategory(), contentType); } else if (keepTag && navigationKey.isTag()) { navigationKey = NavigationKey.tag(navigationKey.getTag(), contentType); } else if (contentType != null) { navigationKey = NavigationKey.contentType(contentType); } else { navigationKey = null; } } return ComponentResponse.OK; }