GithubHelp home page GithubHelp logo

infopark / reactor Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 8.0 15.07 MB

Gems enabling convenient write access to Infopark CMS Fiona including stress free management of object classes and attributes

License: GNU Lesser General Public License v3.0

Shell 8.32% Ruby 87.76% HTML 1.87% JavaScript 1.45% Dockerfile 0.53% Tcl 0.08%

reactor's People

Contributors

antonmezin avatar tococorocko avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

reactor's Issues

Obj is not properly reloaded after save

If I call save on a changed Obj the object is not reloaded properly but from cache. Even an explicit reload loads the stale data from cache instead of hitting the database. It seems like the cache is not properly invalidated after save.

Adding config.middleware.delete ActiveRecord::QueryCache to development.rb makes the problem disappear.

Example:

    > obj = Obj.find(2091)
    > obj.title = 'foo'
    => "foo"
    > obj.title
    => "foo"
    > obj.save
    REQUEST:
    ...
    RESPONSE:
      <cm-code numeric="200" phrase="OK"/>
      CACHE (0.0ms)  SELECT `default_preview_objs`.* FROM `default_preview_objs` WHERE `default_preview_objs`.`obj_id` = 2091 LIMIT 1  [["obj_id", 2091]]
    => true
    > obj.title
    => "test23"
    > obj.reload
      CACHE (0.0ms)  SELECT `default_preview_objs`.* FROM `default_preview_objs` WHERE `default_preview_objs`.`obj_id` = 2091 LIMIT 1  [["obj_id", 2091]]
    > obj.title
    => "test23"

validSubObjClasses?

I'd like to propose a feature: enable to set the list of allowed sub-obj-classes (validSubObjClasses in tcl).

That's about the only thing that keeps us from using this precious gem for serious work and I'd love to do exactly that.

Kann die Channel-Werte nicht speichern

o = Obj.find(12345)
o.channels = ["one", "two"]
o.save!

Nichts passiert. Die Werte für die Channels wurden nicht gespeichert.
Im CM-Log sehe ich keine Anfrage, um Channels zu schreiben.
Ich vermute, dass die Standard-Attribute eine Sonderbehandlung benötigen. Und diese wurde dem Attribut "channels" nicht zugeteilt.

Jobs?

Is there any way to create/maintain "Jobs" with this? I see workflows and channels, but no hint on "Jobs".

That'd be great!

Falsche Datenbank verwendet wenn die Definition der Klasse-Attribute abgeholt werden

Man nehme eine frische Rails App mit den folgenden Gems

gem 'rails', '4.1.9'
gem 'sqlite3'
gem 'mysql2'
gem 'infopark_fiona_connector','6.10.0.beta1'
gem 'infopark_reactor','1.12.0.beta2' # '1.12.0.beta2'

Darin definieren wir die folgenden beiden Klassen:

class Obj < RailsConnector::BasicObj
  include Reactor::Main
end
class Folder < Obj
end

Folder entspricht hierbei einer Vorlage im CMS. Weiter sagen wir dass für development und cms unterschiedliche Datenbanken verwendet werden sollen:


development:
 adapter: mysql2
 database: development
 username: developmentuser
 password: developmentuser

cms:
  adapter: mysql2
  database: 610cm
  username: 610cmuser
  password: 610cmuser

Anschließend versuchen wir uns ein Objekt aus dem CMS zu holen:

$ rails c
Loading development environment (Rails 4.1.9)
irb(main):001:0> f = Folder.find(10039)
  RailsConnector::ObjClass Load (48.6ms)  SELECT `support_obj_classes`.* FROM `support_obj_classes`
  RailsConnector::Attribute Load (47.2ms)  SELECT `support_attributes`.* FROM `support_attributes` INNER JOIN `support_obj_class_attrs` ON `support_attributes`.`attribute_id` = `support_obj_class_attrs`.`attribute_id` WHERE `support_obj_class_attrs`.`obj_class_id` = 2003
  RailsConnector::Attribute Load (47.2ms)  SELECT `support_attributes`.* FROM `support_attributes` INNER JOIN `support_obj_class_attrs` ON `support_attributes`.`attribute_id` = `support_obj_class_attrs`.`attribute_id` WHERE `support_obj_class_attrs`.`obj_class_id` = 2004
  RailsConnector::Attribute Load (47.6ms)  SELECT `support_attributes`.* FROM `support_attributes` INNER JOIN `support_obj_class_attrs` ON `support_attributes`.`attribute_id` = `support_obj_class_attrs`.`attribute_id` WHERE `support_obj_class_attrs`.`obj_class_id` = 2005
  RailsConnector::Attribute Load (48.2ms)  SELECT `support_attributes`.* FROM `support_attributes` INNER JOIN `support_obj_class_attrs` ON `support_attributes`.`attribute_id` = `support_obj_class_attrs`.`attribute_id` WHERE `support_obj_class_attrs`.`obj_class_id` = 2006
  RailsConnector::Attribute Load (50.2ms)  SELECT `support_attributes`.* FROM `support_attributes` INNER JOIN `support_obj_class_attrs` ON `support_attributes`.`attribute_id` = `support_obj_class_attrs`.`attribute_id` WHERE `support_obj_class_attrs`.`obj_class_id` = 2007
  RailsConnector::Attribute Load (47.6ms)  SELECT `support_attributes`.* FROM `support_attributes` INNER JOIN `support_obj_class_attrs` ON `support_attributes`.`attribute_id` = `support_obj_class_attrs`.`attribute_id` WHERE `support_obj_class_attrs`.`obj_class_id` = 2008
  RailsConnector::Attribute Load (47.1ms)  SELECT `support_attributes`.* FROM `support_attributes` INNER JOIN `support_obj_class_attrs` ON `support_attributes`.`attribute_id` = `support_obj_class_attrs`.`attribute_id` WHERE `support_obj_class_attrs`.`obj_class_id` = 2009
  RailsConnector::Attribute Load (48.9ms)  SELECT `support_attributes`.* FROM `support_attributes` INNER JOIN `support_obj_class_attrs` ON `support_attributes`.`attribute_id` = `support_obj_class_attrs`.`attribute_id` WHERE `support_obj_class_attrs`.`obj_class_id` = 2090
  RailsConnector::Attribute Load (48.3ms)  SELECT `support_attributes`.* FROM `support_attributes` INNER JOIN `support_obj_class_attrs` ON `support_attributes`.`attribute_id` = `support_obj_class_attrs`.`attribute_id` WHERE `support_obj_class_attrs`.`obj_class_id` = 25934
  RailsConnector::ObjClass Load (48.2ms)  SELECT `support_obj_classes`.* FROM `support_obj_classes`
Mysql2::Error: Table 'development.support_obj_class_attrs' doesn't exist: SHOW FULL FIELDS FROM `support_obj_class_attrs`
ActiveRecord::StatementInvalid: Mysql2::Error: Table 'development.support_obj_class_attrs' doesn't exist: SHOW FULL FIELDS FROM `support_obj_class_attrs`
    from /Users/bartek/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:303:in `query'
    from /Users/bartek/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:303:in `block in execute'
    from /Users/bartek/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract_adapter.rb:373:in `block in log'
    from /Users/bartek/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.1.9/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
    from /Users/bartek/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract_adapter.rb:367:in `log'
    from /Users/bartek/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:303:in `execute'
    from /Users/bartek/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activerecord-4.1.9/lib/active_record/connection_adapters/mysql2_adapter.rb:228:in `execute'
    from /Users/bartek/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:310:in `execute_and_free'
    from /Users/bartek/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:451:in `columns'
    from /Users/bartek/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activerecord-4.1.9/lib/active_record/connection_adapters/schema_cache.rb:93:in `block in prepare_default_proc'
    from /Users/bartek/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activerecord-4.1.9/lib/active_record/connection_adapters/schema_cache.rb:44:in `yield'
    from /Users/bartek/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activerecord-4.1.9/lib/active_record/connection_adapters/schema_cache.rb:44:in `columns'
    from /Users/bartek/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activerecord-4.1.9/lib/active_record/model_schema.rb:214:in `columns'
    from /Users/bartek/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activerecord-4.1.9/lib/active_record/model_schema.rb:223:in `columns_hash'
    from /Users/bartek/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activerecord-4.1.9/lib/active_record/model_schema.rb:227:in `column_types'
    from /Users/bartek/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activerecord-4.1.9/lib/active_record/associations/preloader/association.rb:107:in `association_key_type'
... 46 levels...
    from /Users/bartek/Projects/link_title_bug/app/models/folder.rb:1:in `<top (required)>'
    from /Users/bartek/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.1.9/lib/active_support/dependencies.rb:443:in `load'
    from /Users/bartek/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.1.9/lib/active_support/dependencies.rb:443:in `block in load_file'
    from /Users/bartek/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.1.9/lib/active_support/dependencies.rb:633:in `new_constants_in'
    from /Users/bartek/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.1.9/lib/active_support/dependencies.rb:442:in `load_file'
    from /Users/bartek/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.1.9/lib/active_support/dependencies.rb:342:in `require_or_load'
    from /Users/bartek/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.1.9/lib/active_support/dependencies.rb:480:in `load_missing_constant'
    from /Users/bartek/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.1.9/lib/active_support/dependencies.rb:180:in `const_missing'
    from (irb):1
    from /Users/bartek/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.1.9/lib/rails/commands/console.rb:90:in `start'
    from /Users/bartek/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.1.9/lib/rails/commands/console.rb:9:in `start'
    from /Users/bartek/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.1.9/lib/rails/commands/commands_tasks.rb:69:in `console'
    from /Users/bartek/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.1.9/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
    from /Users/bartek/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.1.9/lib/rails/commands.rb:17:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

Cannot create object

Hi,

when trying to create an object I always get the same error:

Publication.create(:name => 'dropzone', :parent => '67423', :title => "Dropzone")
ActiveModel::MassAssignmentSecurity::Error: Can't mass-assign protected attributes: name

Leaving out "name" gives another error message:
RuntimeError: Permission check for object with id=nil which does not exist

Thanks,
Timo

Cannot set suppress_export

Is it possible that setting "suppress_export" is not supported?

I can read the value just fine:

[5] pry(main)> o.suppress_export
=> 0

But when I set it to "1" and "save!" the object I get an error message:

Reactor::Cm::XmlRequestError: [030012] 'suppress_export' kann nicht gesetzt werden, falscher Bezeichner.

setting attributeGroups?

Sorry to bother you again but it looks like there's no way to set attributeGroups and I wondered if you might be interested to implement one?

Or am I missing something?

I'm aware of reading the attributeGroups via RailsConnector::ObjClass.read_blob_data() but all attempts to set them in create_class (etc., like validSubObjClasses) result in errors telling me I'd be using the wrong key ("falscher Bezeichner"). And specific classes I didn't find.

Edit: My intention is to order the attributeGroups and attributes within them. The actual way to do that is pretty much indiffent to me.

Edited contents in production environment

The Infopark Rails Connector usually only has access to released contents in the production environment. Is it possible to use Reactor in the production environment and switch views from released to edited contents?

nilAllowed

Another proposal: allow to set the nilAllowed-parameter at creating a new attribute per migration. According to the DTD this should be possible.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.