Permalink
Browse files

- Modeling: Support for including attached model scripts into forward…

… and synchronization wizards

- Changed layout of options in fwdeng and sync wizards
- Added members in GrtStoredNote object to specify where in the SQL the script should be included
- Changed stored script editor toolbar to include options for the script inclusion point
- Added a header comment to forward engineer scripts
[TESTS]
- Add a script to model and try all options for forward engineer and synchronization
- Make sure that stored note editor does not have the new options
  • Loading branch information...
1 parent a1e0a71 commit 0c5020c40bb6309d9c6bdc18c24440566715cb3d @akojima akojima committed May 28, 2014
@@ -2307,6 +2307,7 @@
2BF049B51751A55100A7EA35 /* synchronize_differences_page.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BF049B41751A55000A7EA35 /* synchronize_differences_page.cpp */; };
2BF249EB1404B07D003B3C0F /* wb_sql_editor_tree_controller.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BF249E91404B07D003B3C0F /* wb_sql_editor_tree_controller.h */; };
2BF249EC1404B07D003B3C0F /* wb_sql_editor_tree_controller.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BF249EA1404B07D003B3C0F /* wb_sql_editor_tree_controller.cpp */; };
+ 2BF2786D1869FBB40026215C /* GrtStoredNote.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BF2786B1869FBAB0026215C /* GrtStoredNote.cpp */; };
2BF42B4416862D82007C030C /* wb_history_tree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BF42B4216862D82007C030C /* wb_history_tree.cpp */; };
2BF42B4516862D82007C030C /* wb_history_tree.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BF42B4316862D82007C030C /* wb_history_tree.h */; };
2BF43851108778F500F04A6C /* wb_admin_security.py in Copy Files (plugins) */ = {isa = PBXBuildFile; fileRef = 2BF43850108778D600F04A6C /* wb_admin_security.py */; };
@@ -5994,6 +5995,7 @@
2BF049B41751A55000A7EA35 /* synchronize_differences_page.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = synchronize_differences_page.cpp; path = plugins/db.mysql/frontend/synchronize_differences_page.cpp; sourceTree = "<group>"; };
2BF249E91404B07D003B3C0F /* wb_sql_editor_tree_controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = wb_sql_editor_tree_controller.h; path = backend/wbprivate/sqlide/wb_sql_editor_tree_controller.h; sourceTree = "<group>"; };
2BF249EA1404B07D003B3C0F /* wb_sql_editor_tree_controller.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = wb_sql_editor_tree_controller.cpp; path = backend/wbprivate/sqlide/wb_sql_editor_tree_controller.cpp; sourceTree = "<group>"; wrapsLines = 0; };
+ 2BF2786B1869FBAB0026215C /* GrtStoredNote.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GrtStoredNote.cpp; path = backend/wbpublic/objimpl/GrtStoredNote.cpp; sourceTree = "<group>"; };
2BF42B4216862D82007C030C /* wb_history_tree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = wb_history_tree.cpp; path = backend/wbprivate/model/wb_history_tree.cpp; sourceTree = "<group>"; };
2BF42B4316862D82007C030C /* wb_history_tree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = wb_history_tree.h; path = backend/wbprivate/model/wb_history_tree.h; sourceTree = "<group>"; };
2BF4384F108778C300F04A6C /* wb_admin_security_be.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; name = wb_admin_security_be.py; path = plugins/wb.admin/backend/wb_admin_security_be.py; sourceTree = "<group>"; };
@@ -9554,6 +9556,7 @@
2BAE1A660F368E5A00BE725E /* objimpl */ = {
isa = PBXGroup;
children = (
+ 2BF2786B1869FBAB0026215C /* GrtStoredNote.cpp */,
2BE9FD23151A692800CC0894 /* ui */,
2BAE1A670F368EB200BE725E /* workbench.physical */,
2BAE1A6E0F368EB200BE725E /* workbench.model */,
@@ -13496,6 +13499,7 @@
buildActionMask = 2147483647;
files = (
2BAE1AA90F368F1600BE725E /* charset_list.cpp in Sources */,
+ 2BF2786D1869FBB40026215C /* GrtStoredNote.cpp in Sources */,
2BAE1AAA0F368F1600BE725E /* charset_utils.cpp in Sources */,
2BAE1AAB0F368F1600BE725E /* db_object_filter.cpp in Sources */,
2BAE1AAC0F368F1600BE725E /* db_object_helpers.cpp in Sources */,
View
@@ -0,0 +1,8 @@
+New Features in 6.1.0
+---------------------
+
+Modeling:
+- Include stored scripts in model forward engineering and model synchronization scripts
+- Select where in forward engineering and model synchronization scripts should stored notes appear
+- Option to create triggers after INSERTs in forward engineering script
+- Button to toggle whether to show only changed objects in sync differences page
@@ -497,6 +497,8 @@ bool DbSqlEditorSnippets::get_field(const bec::NodeId &node, ColumnId column, st
break;
case Script:
value = _entries[node[0]].code;
+ if (value.empty())
+ return false;
break;
}
return true;
@@ -63,6 +63,7 @@ add_library(wbpublic
grtdb/editor_view.cpp
grtdb/role_tree_model.cpp
grtdb/sync_profile.cpp
+ objimpl/GrtStoredNote.cpp
objimpl/db/db_DatabaseObject.cpp
objimpl/db/db_Schema.cpp
objimpl/db/db_Table.cpp
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; version 2 of the
+ * License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include "stdafx.h"
+
+#include <grts/structs.h>
+
+#include <grtpp_util.h>
+
+
+//================================================================================
+// GrtStoredNote
+
+void GrtStoredNote::init()
+{
+}
+
+GrtStoredNote::~GrtStoredNote()
+{
+}
+
+
+grt::StringRef GrtStoredNote::getText()
+{
+ grt::BaseListRef args(get_grt());
+ args.ginsert(filename());
+ return grt::StringRef::cast_from(get_grt()->call_module_function("Workbench", "getAttachedFileContents", args));
+}
+
+
+void GrtStoredNote::setText(const std::string &text)
+{
+ grt::BaseListRef args(get_grt());
+ args.ginsert(filename());
+ args.ginsert(grt::StringRef(text));
+ grt::StringRef::cast_from(get_grt()->call_module_function("Workbench", "setAttachedFileContents", args));
+}
+
+
+
+
+
@@ -398,9 +398,11 @@ void BaseSnippetList::refresh_snippets()
std::string caption;
_model->get_field(bec::NodeId(i), 0, caption);
std::string description;
- _model->get_field(bec::NodeId(i), 1, description);
+ bool skip_image = false;
+ if (!_model->get_field(bec::NodeId(i), 1, description))
+ skip_image = true;
- Snippet* snippet = new Snippet(description.empty() ? NULL : _image, caption, description, true);
+ Snippet* snippet = new Snippet(skip_image ? NULL : _image, caption, description, true);
_snippets.push_back(snippet);
}
set_layout_dirty(true);
View
@@ -1,6 +1,6 @@
top_srcdir = ..
-genobj = $(top_srcdir)/tools/genobj/genobj
+genobj = ../DerivedData/MySQLWorkbench/Build/Products/Debug/genobj
genwrap = $(top_srcdir)/tools/genwrap/genwrap
@@ -27,7 +27,10 @@ genwrap = $(top_srcdir)/tools/genwrap/genwrap
# grti/wb_model_reporting.h\
# grti/wbvalidation.h
-all: grts/*.h grti/*.h modules
+all: grts/*.h grts/structs.h grti/*.h modules
+
+grts/structs.h: $(top_srcdir)/res/grt/structs.xml
+ $(genobj) $< $(top_srcdir)/res/grt grts ../backend/wbpublic/objimpl
grts/%.h: $(top_srcdir)/res/grt/%.xml
$(genobj) $< $(top_srcdir)/res/grt grts ../backend/wbpublic/objimpl/`basename $<|sed -e 's/structs.\(.*\).xml/\1/'`
@@ -57,8 +60,6 @@ grts/structs.db.query.h: $(top_srcdir)/res/grt/structs.db.query.xml
grts/structs.eer.h: $(top_srcdir)/res/grt/structs.eer.xml
-grts/structs.h: $(top_srcdir)/res/grt/structs.xml
-
grts/structs.ui.h: $(top_srcdir)/res/grt/structs.ui.xml
grts/structs.model.h: $(top_srcdir)/res/grt/structs.model.xml
@@ -377,15 +377,59 @@ class db_Script : public GrtStoredNote
typedef GrtStoredNote super;
public:
db_Script(grt::GRT *grt, grt::MetaClass *meta=0)
- : GrtStoredNote(grt, meta ? meta : grt->get_metaclass(static_class_name()))
+ : GrtStoredNote(grt, meta ? meta : grt->get_metaclass(static_class_name())),
+ _forwardEngineerScriptPosition(""),
+ _synchronizeScriptPosition("")
{
}
static std::string static_class_name() { return "db.Script"; }
+ /** Getter for attribute forwardEngineerScriptPosition
+
+
+ \par In Python:
+value = obj.forwardEngineerScriptPosition
+ */
+ grt::StringRef forwardEngineerScriptPosition() const { return _forwardEngineerScriptPosition; }
+ /** Setter for attribute forwardEngineerScriptPosition
+
+
+ \par In Python:
+obj.forwardEngineerScriptPosition = value
+ */
+ virtual void forwardEngineerScriptPosition(const grt::StringRef &value)
+ {
+ grt::ValueRef ovalue(_forwardEngineerScriptPosition);
+ _forwardEngineerScriptPosition= value;
+ member_changed("forwardEngineerScriptPosition", ovalue, value);
+ }
+
+ /** Getter for attribute synchronizeScriptPosition
+
+
+ \par In Python:
+value = obj.synchronizeScriptPosition
+ */
+ grt::StringRef synchronizeScriptPosition() const { return _synchronizeScriptPosition; }
+ /** Setter for attribute synchronizeScriptPosition
+
+
+ \par In Python:
+obj.synchronizeScriptPosition = value
+ */
+ virtual void synchronizeScriptPosition(const grt::StringRef &value)
+ {
+ grt::ValueRef ovalue(_synchronizeScriptPosition);
+ _synchronizeScriptPosition= value;
+ member_changed("synchronizeScriptPosition", ovalue, value);
+ }
+
protected:
+ grt::StringRef _forwardEngineerScriptPosition;
+ grt::StringRef _synchronizeScriptPosition;
private: // wrapper methods for use by grt
static grt::ObjectRef create(grt::GRT *grt)
{
@@ -399,6 +443,16 @@ class db_Script : public GrtStoredNote
grt::MetaClass *meta= grt->get_metaclass(static_class_name());
if (!meta) throw std::runtime_error("error initializing grt object class, metaclass not found");
meta->bind_allocator(&db_Script::create);
+ {
+ void (db_Script::*setter)(const grt::StringRef &)= &db_Script::forwardEngineerScriptPosition;
+ grt::StringRef (db_Script::*getter)() const= &db_Script::forwardEngineerScriptPosition;
+ meta->bind_member("forwardEngineerScriptPosition", new grt::MetaClass::Property<db_Script,grt::StringRef >(getter,setter));
+ }
+ {
+ void (db_Script::*setter)(const grt::StringRef &)= &db_Script::synchronizeScriptPosition;
+ grt::StringRef (db_Script::*getter)() const= &db_Script::synchronizeScriptPosition;
+ meta->bind_member("synchronizeScriptPosition", new grt::MetaClass::Property<db_Script,grt::StringRef >(getter,setter));
+ }
}
};
Oops, something went wrong.

0 comments on commit 0c5020c

Please sign in to comment.