Skip to content

Commit

Permalink
Merge pull request #34 from ibm-wch/rel3.2.16
Browse files Browse the repository at this point in the history
Rel3.2.16
  • Loading branch information
Kevin Tapperson authored Dec 3, 2018
2 parents d34a0cb + 0f36de7 commit 5f5e072
Show file tree
Hide file tree
Showing 55 changed files with 753 additions and 312 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- Add a warning after successful push, if --publish-now not specified and a publishing schedule is set, that may delay the publishing of the ready artifacts that were just pushed.
- Update manifest support to handle placeholder sites
- Update paging support to use the next links provided in service responses
- Fix an issue with delete by page when receiving a 404 response.

### 3.1 changes since 3.0

Expand Down
16 changes: 12 additions & 4 deletions CLI/commands/delete.js
Original file line number Diff line number Diff line change
Expand Up @@ -887,11 +887,19 @@ class DeleteCommand extends BaseCommand {
logger.info(i18n.__('cli_delete_success', {"name": getDisplayName(item)}));
})
.catch(function (err) {
// Track the number of failed delete operations.
self._artifactsError++;
if (err.statusCode === 404) {
// The item no longer exists, so assume it was deleted automatically.
self._artifactsCount++;

// Add an error entry for the localized failure message. (Displayed in verbose mode.)
logger.error(i18n.__("cli_delete_failure", {"name": getDisplayName(item), "err": err.message}));
// Add an info entry for the localized success message. (Displayed in verbose mode.)
logger.info(i18n.__('cli_delete_item_ignored', {"name": getDisplayName(item)}));
} else {
// Track the number of failed delete operations.
self._artifactsError++;

// Add an error entry for the localized failure message. (Displayed in verbose mode.)
logger.error(i18n.__("cli_delete_failure", {"name": getDisplayName(item), "err": err.message}));
}
});
}

Expand Down
2 changes: 1 addition & 1 deletion CLI/commands/push.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class PushCommand extends BaseCommand {
*/
checkWarnAboutSchedule(context, opts) {
const deferred = Q.defer();
if (!options.getRelevantOption(context, opts, "publish-now") && !options.getRelevantOption(context, opts, "filterDraft")) {
if (this._artifactsCount > 0 && !options.getRelevantOption(context, opts, "publish-now") && !options.getRelevantOption(context, opts, "filterDraft")) {
ToolsApi.getPublishingNextSchedulesHelper().getNextSchedules(context, opts)
.then(items => {
if (items && items.length && items.length>0) {
Expand Down
4 changes: 2 additions & 2 deletions CLI/lib/baseCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ class BaseCommand {
// command object itself. This is just the way Commander works.
this._commandLineOptions = command;

// Provide a meesage to indicate that there was an invalid argument on the command line.
this.errorMessage(i18n.__('cli_invalid_arguments', {arguments: commandLineOptions}));
// Provide a meesage to indicate that there was an invalid option on the command line.
this.errorMessage(i18n.__('cli_invalid_arguments', {options: commandLineOptions}));

// Reset the command line options.
this.resetCommandLineOptions();
Expand Down
84 changes: 50 additions & 34 deletions CLI/nls/de.json

Large diffs are not rendered by default.

67 changes: 30 additions & 37 deletions CLI/nls/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
"cli_success_message": "Success: %(message)s",
"cli_unknown_option": "An unknown option `%(option)s' was specified.",
"cli_option_missing_argument": "The option `%(option)s' requires an argument.",
"cli_invalid_arguments": "Invalid argument %(arguments)s",
"cli_invalid_arguments": "Invalid option %(options)s",
"cli_could_not_create_dir": " %(error_code)s - The directory '%(dir)s' could not be created.",
"cli_dir_does_not_exist": " %(error_code)s - The directory '%(dir)s' does not exist.",
"cli_dir_is_not_a_directory": "The specified dir option '%(dir)s' is not a directory.",
"cli_dir_is_not_a_directory": "The specified --dir option '%(dir)s' is not a directory.",
"cli_manifest_not_valid": "The specified manifest '%(name)s' could not be read.",
"cli_manifest_not_compatible": "The specified manifest '%(name)s' contains artifact types that are not valid for this tenant.",
"cli_manifest_no_artifacts": "The specified manifest '%(name)s' did not contain any artifacts.",
"cli_save_manifest_failure": "An error occurred when trying to save the manifest: %(err)s.",
"cli_invalid_url_option": "The specified API URL is not valid.",
"cli_invalid_path_option": "Invalid options, path can only be used for web assets, content types, layouts, layout mappings, and pages.",
"cli_invalid_siteContext_option": "Invalid options, site-context can only be used when the sites or pages option is also specified.",
"cli_ready_and_manifest_options": "Invalid options, cannot specifiy both ready and manifest.",
"cli_draft_and_manifest_options": "Invalid options, cannot specifiy both draft and manifest.",
"cli_invalid_path_option": "The --path option is only supported for web assets, content types, layouts, layout mappings, and pages.",
"cli_invalid_siteContext_option": "The --site-context option is only supported for sites and pages.",
"cli_ready_and_manifest_options": "The --ready and --manifest options cannot both be specified.",
"cli_draft_and_manifest_options": "The --draft and --manifest options cannot both be specified.",
"cli_help_on_commands": "For help on specific commands use wchtools <command> -h",
"cli_base_user_name": "User name",
"cli_base_password": "Password",
Expand All @@ -29,7 +29,7 @@
"cli_help_version_number": "output the version number",
"cli_update_notifier": "Run '%(update_command)s' to update from version %(current_version)s to version %(new_version)s.",
"cli_update_notifier_changelog": "A new version of wchtools exists. See %(changelog_url)s for a list of changes.",
"cli_manifest_and_server_manifest": "The manifest and server-manifest options cannot be used together.",
"cli_manifest_and_server_manifest": "The --manifest and --server-manifest options cannot both be specified.",
"cli_manifest_saved": "The manifest was written to %(filename)s",
"cli_deletions_manifest_saved": "The deletions manifest was written to %(filename)s",

Expand Down Expand Up @@ -282,11 +282,11 @@
"cli_push_page_pushed_2": "Pushed page with path %(name)s and id %(id)s",
"cli_push_page_push_error": "Pushing page with path %(name)s resulted in the following error: %(message)s.",
"cli_push_page_item_error": "Pushing page with path %(path)s and id %(id)s resulted in the following error: %(message)s",
"cli_push_name_and_ignore_timestamps": "Invalid options named and Ignore-timestamps cannot be used together.",
"cli_push_name_and_path": "Invalid options named and path cannot be used together.",
"cli_push_name_and_ready": "Invalid options named and ready cannot be used together.",
"cli_push_name_and_draft": "Invalid options named and draft cannot be used together.",
"cli_push_name_one_type": "Invalid options, named can only be used for a single type.",
"cli_push_name_and_ignore_timestamps": "The --named and --Ignore-timestamps options cannot both be specified.",
"cli_push_name_and_path": "The --named and --path options cannot both be specified.",
"cli_push_name_and_ready": "The --named and --ready options cannot both be specified.",
"cli_push_name_and_draft": "The --named and --draft options cannot both be specified.",
"cli_push_name_one_type": "The --named option can only be used for a single artifact type.",
"cli_push_site_revision_pushed": "Pushed publishing site revision with name %(name)s and id %(id)s",
"cli_push_site_revision_push_error": "Pushing publishing site revision with id %(name)s resulted in the following error: %(message)s.",
"cli_push_warn_schedule": "A publishing schedule exists for this WCH tenant. Pushed ready items will publish when the next schedule occurs, which is %(publishDateTime)s. To publish immediately, use the %(publishNow)s option on the push command.",
Expand Down Expand Up @@ -388,7 +388,7 @@
"cli_delete_opt_categories": "If specified, categories and taxonomies will be deleted.",
"cli_delete_opt_sites": "If specified, site definitions will be deleted.",
"cli_delete_opt_pages": "If specified, page definitions will be deleted. You can delete all pages, or by path or id. Note that child pages will also be deleted.",
"cli_delete_opt_page_content":"If specified, content associated with the page will be deleted when deleting a page. This argument is only valid when deleting pages.",
"cli_delete_opt_page_content": "If specified, content associated with the page will be deleted when deleting a page. This option is only valid when deleting pages.",
"cli_delete_opt_all_authoring": "If specified, all types of authoring artifacts will be deleted. This option may only specified if either the --all or --tag option is also specified.",
"cli_delete_opt_use_manifest":"Delete only the items listed in the specified manifest file loaded from the local working directory.",
"cli_delete_opt_use_server_manifest":"Delete only the items listed in the specified manifest loaded from the IBM Watson Content Hub.",
Expand All @@ -399,28 +399,28 @@
"cli_delete_opt_tag": "If specified, then delete content items, content types, or content assets with the specified tag.",
"cli_delete_opt_path": "The path to the artifact(s) to be deleted. To specify a folder of artifacts that should be deleted, you must also specify -r or --recursive",
"cli_delete_opt_siteContext": "If specified, page and site artifacts will only be deleted for the site with the specified context root. For example, if 'store' is specified, page and site artifacts will be limited to the site with that context root. The default site does not have a context root, so 'default' can be specified.",
"cli_delete_opt_recursive": "If specified, the path argument will be treated as a folder, and all artifacts within that folder will be deleted.",
"cli_delete_opt_recursive": "If specified, the --path option will be treated as a folder, and all artifacts within that folder will be deleted.",
"cli_delete_opt_preview": "If specified, list the artifact(s) that would be deleted, but do not actually delete the artifact(s).",
"cli_delete_opt_quiet": "If specified, do not confirm deletion. (When more than one artifact would be deleted, a confirmation is displayed for each one.)",
"cli_delete_opt_by_type_name":"If specified with -c, then delete the content item(s) associated with the specified type name.",
"cli_delete_opt_ready": "If specified, delete ready artifacts. (This is the default.)",
"cli_delete_opt_draft": "If specified, delete draft artifacts.",
"cli_delete_only_one_type": "Deleting more than one artifact type at a time, or deleting all authoring artifact types with -A or --all-authoring requires either the --all or --tag option to be specified.",
"cli_delete_only_one_type": "Deleting more than one artifact type at a time is only supported when the --all, --tag, or --manifest option is specified.",
"cli_delete_no_type": "An artifact type must be specified.",
"cli_delete_no_id_or_path": "Either --id or --path must be specified.",
"cli_delete_both_id_and_path": "Both --id and --path cannot be specified.",
"cli_delete_id_ready_draft": "Both --ready and --draft cannot be specified when deleting by id.",
"cli_delete_path_required": "The --path argument must be specified when deleting web assets.",
"cli_delete_siteContext_required": "The --site-context argument must be specified when deleting a site.",
"cli_delete_requires_id_or_path_and_siteContext": "The --id argument or the --path and --site-context arguments must be specified when deleting a page.",
"cli_delete_path_tag_required": "One of --path or --tag arguments must be specified when deleting content assets.",
"cli_delete_requires_id_name": "One of --id, --named or --tag arguments must be specified, to delete the specified artifact type.",
"cli_delete_requires_id_name_bytypename": "One of --id, --named, --tag or --by-type-name arguments must be specified, to delete the specified artifact type.",
"cli_delete_by_id_not_supported": "The --id argument is not supported for the specified artifact type.",
"cli_delete_by_path_not_supported": "The --path argument is not supported for the specified artifact type.",
"cli_delete_by_tag_not_supported": "The --tag argument is only supported for content items, content types, and content assets.",
"cli_delete_recursive_not_supported": "The --recursive argument is not supported for the specified artifact type.",
"cli_delete_page_content_req_pages": "The --page-content argument should only be used when deleting pages with the -p or --pages options.",
"cli_delete_no_id_or_path": "To delete a layout or layout mapping, the --id or --path option must be specified. To delete all layouts or layout mappings, the --all option must be specified.",
"cli_delete_both_id_and_path": "The --id and --path options cannot both be specified.",
"cli_delete_id_ready_draft": "The --ready and --draft options cannot both be specified when deleting by id.",
"cli_delete_path_required": "To delete a web asset (or a folder of web assets), the --path option must be specified. To delete all web assets, the --all option must be specified.",
"cli_delete_siteContext_required": "To delete a site definition, the --site-context option must be specified. To delete all site definitions, the --all option must be specified.",
"cli_delete_requires_id_or_path_and_siteContext": "To delete a page, the --id option or the --path and --site-context options must be specified. To delete all pages for a specific site, the --all and --site-context options must be specified. To delete all pages, the --all option must be specified.",
"cli_delete_path_tag_required": "To delete a content asset, the --path or --tag option must be specified. To delete all content assets, the --all option must be specified.",
"cli_delete_requires_id_name": "To delete a content type, the --id, --named, or --tag option must be specified. To delete all content types, the --all option must be specified.",
"cli_delete_requires_id_name_bytypename": "To delete a content item, the --id, --named, --tag, or --by-type-name option must be specified. To delete all content items, the --all option must be specified.",
"cli_delete_by_id_not_supported": "The --id option is not supported for the specified artifact type.",
"cli_delete_by_path_not_supported": "The --path option is not supported for the specified artifact type.",
"cli_delete_by_tag_not_supported": "The --tag option is only supported for content items, content types, and content assets.",
"cli_delete_recursive_not_supported": "The --recursive option is not supported for the specified artifact type.",
"cli_delete_page_content_req_pages": "The --page-content option is only supported for pages.",
"cli_delete_all_types": "Deleting all content types",
"cli_deleting_all_assets": "Deleting all assets",
"cli_deleting_all_web_assets": "Deleting all web assets",
Expand Down Expand Up @@ -506,8 +506,7 @@
"one": "Encountered %d error while deleting artifacts.",
"other": "Encountered %d errors while deleting artifacts."
},

"cli_clear_description": "Clear the data associated with the specified argument.",
"cli_clear_description": "Clear the data associated with the specified option.",
"cli_opt_clear_cache": "Clear the content delivery network (CDN) cache for the specified Watson Content Hub tenant. This initiates a background task that may take some time for the CDN to complete, and should only be used when necessary.",
"cli_clear_error": "Error executing the clear command.",
"cli_clear_requires_cache": "The clear command currently only supports clearing the content delivery network cache. Specify the %(cache)s option to clear the cache.",
Expand Down Expand Up @@ -610,15 +609,9 @@
"cli_compare_rendition_diff": "Rendition %(id)s is different.",
"cli_compare_rendition_added": "Rendition %(id)s is new.",
"cli_compare_rendition_removed": "Rendition %(id)s was removed.",
"cli_compare_profile_diff": "Publishing Profile %(id)s is different.",
"cli_compare_profile_added": "Publishing Profile %(id)s is new.",
"cli_compare_profile_removed": "Publishing Profile %(id)s was removed.",
"cli_compare_site_revision_diff": "Site Revision %(id)s is different.",
"cli_compare_site_revision_added": "Site Revision %(id)s is new.",
"cli_compare_site_revision_removed": "Site Revision %(id)s was removed.",
"cli_compare_source_diff": "Publishing Source %(id)s is different.",
"cli_compare_source_added": "Publishing Source %(id)s is new.",
"cli_compare_source_removed": "Publishing Source %(id)s was removed.",
"cli_compare_site_diff": "Site %(contextName)s is different.",
"cli_compare_site_added": "Site %(contextName)s is new.",
"cli_compare_site_removed": "Site %(contextName)s was removed.",
Expand Down
Loading

0 comments on commit 5f5e072

Please sign in to comment.