From 1c8242d14b42e94388a14b9c68c8ba11646159f0 Mon Sep 17 00:00:00 2001 From: Hao Liu Date: Thu, 11 Jun 2015 18:58:54 +0800 Subject: [PATCH] Release 3.0.3 --- HISTORY.rst | 15 ++++++++++ config/messages/2.9.0.md | 21 -------------- config/messages/2.9.1.md | 14 ---------- config/messages/2.9.2.md | 35 ------------------------ config/messages/2.9.3.md | 17 ------------ config/messages/2.9.4.md | 26 ------------------ config/messages/2.9.5.md | 29 -------------------- config/messages/2.9.6.md | 26 ------------------ config/messages/2.9.7.md | 28 ------------------- config/messages/2.9.8.md | 19 ------------- config/messages/2.9.9.md | 13 --------- config/messages/3.0.3.md | 17 ++++++++++++ config/settings/package.sublime-settings | 2 +- messages.json | 11 +------- processor.py | 34 ++++++++--------------- salesforce/api/metadata.py | 1 + salesforce/api/tooling.py | 19 ++++++++----- 17 files changed, 58 insertions(+), 269 deletions(-) delete mode 100644 config/messages/2.9.0.md delete mode 100644 config/messages/2.9.1.md delete mode 100644 config/messages/2.9.2.md delete mode 100644 config/messages/2.9.3.md delete mode 100644 config/messages/2.9.4.md delete mode 100644 config/messages/2.9.5.md delete mode 100644 config/messages/2.9.6.md delete mode 100644 config/messages/2.9.7.md delete mode 100644 config/messages/2.9.8.md delete mode 100644 config/messages/2.9.9.md create mode 100644 config/messages/3.0.3.md diff --git a/HISTORY.rst b/HISTORY.rst index ae8d9fd..7e96a58 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,21 @@ Release History --------------- + +Release 3.0.3 (2015-06-11) +++++++++++++++++++ +* Bug Fix: + - Fix duplicate save check bug caused by release 3.0.2 + - Fix fields completion bug for cross sObjects between tooling and non-tooling, for example ``User``, ``RecordType`` + +* Enhancement: + - Add session expired message for ``describe_metadata`` + - Enhancement for ``refresh_file_from_server`` + +* Update + - Update pop-up compile message for ``save_to_server`` command + + Release 3.0.2 (2015-06-07) ++++++++++++++++++ * Bug fix: diff --git a/config/messages/2.9.0.md b/config/messages/2.9.0.md deleted file mode 100644 index e81d4b1..0000000 --- a/config/messages/2.9.0.md +++ /dev/null @@ -1,21 +0,0 @@ -Build 2.9.0 ------------ -Release Date: 3 May 2015 - -* Fix bug for messy code in debug log detail -* Enhancement for not refreshing sidebar when ``retrieve_files_from_other_server`` -* Enhancement for adding folder name to retrieve request when ``list_package`` for folders -* Enhancement for package.xml completion for folder name of Document, EmailTemplate, Dashboard and Report -* Enhancement for package.xml completion for AuraDefinitionBundle -* Enhancement for sobject completion, if there are two matched statements, ``insert prd`` and ``Product2 prd``, plugin will choose the second one as matched -* Enhancement for ``toggle_metadata_objects``, you can toggle metadata objects continually util you press ``ESC`` to exit -* Enhancement for ``generate_sobject_soql``, you can choose whether generate sobject SOQL of ``Custom``, ``Updateable`` or ``Createable`` -* Update ``inFolder`` and ``metaFile`` in ``metaObjects`` settings from string to boolean -* Update workspace of default build-in project from ``C:/ForcedotcomWorkspace`` to empty -* Update name of default build-in project from ``pro-test`` to ``pro-sublime`` -* Update for ``toggle_metadata_objects``, after subscribe a new metadata object, don't refresh its folder again, just after you finish all toggle, you will need to confirm whether use refresh all subscribed metadata together -* Add ``toggle_metadata_objects`` document in ``docs/utilities.md`` -* Remove four deprecated settings, ``keep_config_history``, ``output_session_info``, ``delay_seconds_for_hidden_output_panel_when_failed`` and ``get_static_resource_body`` - -Notes: You should restart your sublime after ``HaoIDE`` is upgraded ------------ \ No newline at end of file diff --git a/config/messages/2.9.1.md b/config/messages/2.9.1.md deleted file mode 100644 index 69f926f..0000000 --- a/config/messages/2.9.1.md +++ /dev/null @@ -1,14 +0,0 @@ -Build 2.9.1 ------------ -Release Date: 5 May 2015 - -* Fix bug for ``switch_project``, see issue #24 -* Enhancement for speeding up ``Save To Server`` operation -* Rename ``save_component`` command to ``save_to_server`` -* Rename ``delete_component`` command to ``delete_file_from_server`` -* Simplify ``delete_file_from_server`` and ``refresh_file_from_server`` -* Add two new value issue_url and history_url into package info -* Update ``report_issue`` and ``view_release_notes`` command to read url from package info - -Notes: You should restart your sublime after ``HaoIDE`` is upgraded ------------ \ No newline at end of file diff --git a/config/messages/2.9.2.md b/config/messages/2.9.2.md deleted file mode 100644 index bd68ac2..0000000 --- a/config/messages/2.9.2.md +++ /dev/null @@ -1,35 +0,0 @@ -Build 2.9.2 ------------ -Release Date: 10 May 2015 - -### Bug Fix: -* Fix bug for ``combine_soql`` which is invoked by ``Generate SOQL`` and ``Bulk Query`` -* Fix bug for ``export_profile`` command -* Fix bug for completion of building ``package.xml`` -* Fix bug for ``export_validation_rules`` command - -### New Feature: -* Deprecated ``metadataObjects`` since this release, which is replaced by ``/.config/metadata.json`` -* Add ``describe_metadata`` command, ``/.config/metadata.json`` will be generated by this command -* Add ``reload_project_cache`` command, ``/.config/package.json`` will be generated by this command -* Add ``build_package_xml`` command, see `more `_ -* Add key bindings for ``build_package_xml`` command - -### Enhancement: -* Move package related logic from ``main.py`` to the new ``package.py`` -* Add thread progress for ``track_debug_log``, ``fetch_debug_log`` and ``track_all_debug_logs`` -* `create_new_project`` start supporting callback -* Add metadata object for input description for ``create_new_component`` module -* Add list_package support for ``CustomObject`` retrieve -* Add availability check for ``.config/metadata.json`` for all related commands -* Add ``api_version`` message into the sidebar message -* Update ``api_version`` from ``32`` to ``33`` -* Update ``Metadata Migration`` to ``Metadata`` in the main menu -* Update ``generate_soql`` logic to include ``Id`` field if no available matched fields -* Update description for default settings -* Update README.md - -### Notes: -* You must subscribe metadata objects when you create new project -* You should restart your sublime after ``HaoIDE`` is upgraded ------------ \ No newline at end of file diff --git a/config/messages/2.9.3.md b/config/messages/2.9.3.md deleted file mode 100644 index ed94b6e..0000000 --- a/config/messages/2.9.3.md +++ /dev/null @@ -1,17 +0,0 @@ -Build 2.9.3 ------------ -Release Date: 11 May 2015 - -* Enhancement: - - Package.xml completion read cache from ``.config/package.json``, no longer read cache from project file - - Sort for items in quick panel of package.xml building - - Add alert message for package.xml completion - -* Bug Fix: - - Add the folder into member when list_package for DocumentFolder, EmailFolder, ReportFolder and DashboardFolder - - No four spaces in the quick panel of package.xml building for windows - -* Notes: - - You must subscribe metadata objects when you create new project - - You should restart your sublime after ``HaoIDE`` is upgraded ------------ \ No newline at end of file diff --git a/config/messages/2.9.4.md b/config/messages/2.9.4.md deleted file mode 100644 index a915d7a..0000000 --- a/config/messages/2.9.4.md +++ /dev/null @@ -1,26 +0,0 @@ -Build 2.9.4 ------------ -Release Date: 13 May 2015 - -* Bug Fix: - - If there is only one member, just remove the type and the related member when ``build package xml`` - - When execute ``query_to_csv`` command and field value contains ``"`` or ``,`` - -* Enhancement: - - Show the error message when list package for metadata objects if have - - Support quick clear for symbol_table and sobject cache - - Automatic ``{!}`` enhancement for vf tag just if type is "Object" or "ApexPages.Action" - - Update type of some visualforce standard components from ``Object`` to ``String`` - - Change the item format in the quick panel when ``build package xml`` - - Add ``EmailTemplate`` to ``allowed_sobjects`` setting - - Allow user to choose reloading specified ``metadata_object`` cache when execute reload_project_cache command - - When operation is depends on login session, so login firstly and callback with this operation - -* Update: - - Rollback the delivered function for issue #15 - - Optimize on ``metadata.py`` - -* Notes: - - You must subscribe metadata objects when you create new project - - You should restart your sublime after ``HaoIDE`` is upgraded ------------ \ No newline at end of file diff --git a/config/messages/2.9.5.md b/config/messages/2.9.5.md deleted file mode 100644 index 52ce2df..0000000 --- a/config/messages/2.9.5.md +++ /dev/null @@ -1,29 +0,0 @@ -Build 2.9.5 ------------ -Release Date: 16 May 2015 - -* Enhancement: - - Add callback for ``toggle_metadata_objects`` if ``.config/metadata.json`` is not exist - - Move ``export_query_to_csv`` command from context menu to ``Data Loader" in the main menu, add check logic for input soql and allow trying again. - - Add snippets, ``Class Body - Trigger Template Bind.sublime-snippet``, ``Class Body - Trigger Template.sublime-snippet`` and ``Class Body - Trigger Template Implement.sublime-snippet`` - - Update content of snippet ``Class Body - Roll up summary utility.sublime-snippet`` to that written by me, see `more detail `_ - -* Update: - - Rename ``View Release Notes`` command to ``Release Notes`` - - Rename ``json_pretty`` command to ``json_format`` - - Rename ``convert_xml_to_json`` command to ``xml_to_json`` - - Move ``xml_to_json`` from context menu to ``Utilites`` in the main menu - - Add access to ``toggle_metadata_objects`` for both ``Settings`` and ``Metadata`` in the main menu - - Upgrade build-in ``xmltodict`` module to ``0.9.2`` - - Update document for the change in this release - -* New Feature: - - New commands for ``HaoIDE > Utilities`` of the main menu: - - Add a new command ``haoide_help`` to view related document - - Add a new command ``json_to_xml`` to convert xml back to json, see issue #32 - - Add a new command ``xml_format`` to format selected xml content or whole file content, see issue #32 - -* Notes: - - You must subscribe metadata objects when you create new project - - You should restart your sublime after ``HaoIDE`` is upgraded ------------ \ No newline at end of file diff --git a/config/messages/2.9.6.md b/config/messages/2.9.6.md deleted file mode 100644 index a1ffd11..0000000 --- a/config/messages/2.9.6.md +++ /dev/null @@ -1,26 +0,0 @@ -Build 2.9.6 ------------ -Release Date: 20 May 2015 - -* Bug Fix: - - Fix issue #33 - - Fix issue #35 - -* Enhancement: - - Add required check for XML utilities - - Add required check for JSON utilities - - Separate ``login`` feature from ``switch_project`` - - Add callback for ``switch_project`` for operations need switching, such as, ``deploy to server``, ``diff with server`` or ``retrieve from server`` - - Combine ``retrieve from server`` and ``retrieve from other server`` to only one command, just like ``deploy to server``, you can switch project when execute ``retrieve from server`` - - When ``reload_project_cache``, just if you selected at least one metadata object, reload will start, otherwise, do nothing - -* New Feature - - Add a new ``reload session cache`` command into ``Cache`` of the main menu for forced login - -* Update - - Because metadata.json of every project is stable, so save it into ``metadata.sublime-settings`` but not ``.config/metdata.json`` again - - Remove ``check_workspace_available`` for export feature, because this check is useless - -* Notes: - - You should restart your sublime after ``HaoIDE`` is upgraded ------------ \ No newline at end of file diff --git a/config/messages/2.9.7.md b/config/messages/2.9.7.md deleted file mode 100644 index 9819708..0000000 --- a/config/messages/2.9.7.md +++ /dev/null @@ -1,28 +0,0 @@ -Build 2.9.7 ------------ -Release Date: 22 May 2015 - -* Bug Fix: - - Fix issue #36 - - Fix bug for ``childXmlNames`` parsing and ``childXmlNames`` completion for package.xml - - Fix bug for timeout exception message for ``query`` method in ``tooling.py`` - - Fix NoneType exception for automatic extension or controller creation if current view is not local file - - Tag plugin fix a bug for that tag name contains colon, `see tag issue https://github.com/titoBouzout/Tag/issues/79`_ - -* Enhancement for visualforce page completion: - - Enhancement for attribute completion in visualforce page, if attribute value is already exist, it will not insert ``=""`` or ``="{!}"`` again - - Enhancement for ``standardController`` sObject name completion in visualforce page, it will just work when attribute is ``standardController`` - - Add custom class completion for ``extension`` and ``controller`` attribute in visualforce page - - Add values completion for some attributes of standard components which type should be picklist, for example, "apiVersion", "layout", "event" or "target" for link and so on, in this time I just updated to apex:composition, I will check the remaining standard component - - Add two missed standard component into ``vf.py``, "apex:component" and "apex:componentBody" - - Add custom page completion for these four attributes: "page", "template", "pageName", "finishLocation", for example, if you input `` -
-

Compile Error

-
-
-

%s

-
- -
-

- %s at line %s column %s -

-
-
-
+
+

Compile Error for %s

+

+ %s at line %s column %s +

""" % ( file_base_name, @@ -1487,7 +1477,7 @@ def handle_thread(thread, timeout): thread.start() # If saving thread is started, set the flag to True - globals()[username + component_name] = True + globals()[username + file_base_name] = True # Display thread progress wait_message = ("Compiling " if is_check_only else "Saving ") + component_name @@ -1610,7 +1600,7 @@ def handle_thread(thread, timeout): handle_thread(thread, timeout) ThreadProgress(api, thread, 'Diff With Server', 'Diff With Server Succeed') -def handle_refresh_file_from_server(component_attribute, file_name, timeout=120): +def handle_refresh_file_from_server(attr, file_name, timeout=120): def handle_thread(thread, timeout): if thread.is_alive(): sublime.set_timeout(lambda:handle_thread(thread, timeout), timeout) @@ -1623,19 +1613,17 @@ def handle_thread(thread, timeout): fp = open(file_name, "wb") try: - body = bytes(result[component_body], "UTF-8") + body = bytes(result[attr["body"]], "UTF-8") except: - body = result[component_body].encode("UTF-8") + body = result[attr["body"]].encode("UTF-8") fp.write(body) settings = context.get_settings() api = ToolingApi(settings) - component_body = component_attribute["body"] - component_url = component_attribute["url"] - thread = threading.Thread(target=api.get, args=(component_url, )) + thread = threading.Thread(target=api.get, args=(attr["url"], )) thread.start() - ThreadProgress(api, thread, 'Refreshing Component', 'Refresh Succeed') + ThreadProgress(api, thread, 'Refreshing %s' % os.path.basename(file_name), 'Refresh Succeed') handle_thread(thread, timeout) def handle_delete_component(component_url, file_name, timeout=120): diff --git a/salesforce/api/metadata.py b/salesforce/api/metadata.py index 522e1bd..9bc175c 100644 --- a/salesforce/api/metadata.py +++ b/salesforce/api/metadata.py @@ -73,6 +73,7 @@ def describe_metadata(self): if response.status_code > 399: # If session is invalid, force to login and execute this again if "INVALID_SESSION_ID" in response.text: + Printer.get("log").write("Session is expired, need login again") self.login(True) return self.describe_metadata() diff --git a/salesforce/api/tooling.py b/salesforce/api/tooling.py index e383182..6c656da 100644 --- a/salesforce/api/tooling.py +++ b/salesforce/api/tooling.py @@ -592,24 +592,29 @@ def get_sobjects(self): result = self.describe_global() tooling_result = self.describe_global(True) - # sd is sObject describe + # Get all tooling sobjects sobjects = {} - if "sobjects" in result: - for sd in result["sobjects"]: + if "sobjects" in tooling_result: + for sd in tooling_result["sobjects"]: if "name" in sd: sobjects[sd["name"]] = { "name": sd["name"], "custom": sd["custom"], - "tooling": False + "tooling": True } - if "sobjects" in tooling_result: - for sd in tooling_result["sobjects"]: + # Get all none-tooling sobjects + # Note: + # because there are cross sObject between tooling and none-tooling, + # for example, User, RecordType, etc., however, + # we just choose that non-tooling ones to override tooling sObjects + if "sobjects" in result: + for sd in result["sobjects"]: if "name" in sd: sobjects[sd["name"]] = { "name": sd["name"], "custom": sd["custom"], - "tooling": True + "tooling": False } self.result = {