app/controllers/scrivito/objs_controller.rb in scrivito_sdk-1.5.5 vs app/controllers/scrivito/objs_controller.rb in scrivito_sdk-1.6.0.rc1
- old
+ new
@@ -1,21 +1,17 @@
module Scrivito
class ObjsController < WebserviceController
around_action :require_selected_workspace_write_authorization, only: [
- :create,
:destroy,
:restore,
:restore_widget,
:revert,
:revert_widget,
- :update,
]
before_filter :require_identical_selected_and_visible_workspace, only: [
- :create,
:page_class_selection,
- :update,
:widget_class_selection,
]
def show
in_selected_workspace { render }
@@ -23,32 +19,15 @@
def widget
in_selected_workspace { render }
end
- def create
- params_parser = ObjCreateParamsParser.new(request.host, request.port)
- @obj = Obj.create(params_parser.parse(params[:obj]), scrivito_user: scrivito_user)
- render :obj
- rescue ObjClassNotFound => e
- raise ClientError.new(
- "You've tried to create a CMS object based on the \"#{e.message}\" class, which is "\
- "either missing or not suitable for the object."
- )
- end
-
def details
assert_dialog_layout
render current_obj.details_view_path, layout: 'scrivito_dialog', formats: :html
end
- def update
- params_parser = ObjUpdateParamsParser.new(request.host, request.port,
- current_obj: current_obj, scrivito_user: scrivito_user)
- current_obj.update(params_parser.parse(params[:obj]))
- end
-
def destroy
in_selected_workspace do
parent = current_obj.parent
@redirect_to = parent ? scrivito_path(parent) : "/"
current_obj.destroy
@@ -71,14 +50,9 @@
end
def restore_widget
in_selected_workspace { current_obj.restore_widget(params[:widget_id]) }
render_empty_json
- end
-
- def conflicting_workspaces
- @workspaces = selected_workspace.conflict_warning_for(params[:id])
- render :workspaces
end
def binary_no_cache
in_selected_workspace do
binary = current_obj[params[:attribute_name]]