Forum OpenACS Q&A: Error while running Edit This Page

Collapse
Posted by Boris Doesborg on
I try to run Edit This Page but get an database error.

I installed OpenACS 4.6.3 from tarball.

When trying to create a new object in the table "acs_objects" it looks for the object type "etp_page_revision". It seems like the object type "etp_page_revision" does not exist in the table "acs_object_types".

I hope this makes sense because this is as far as my knowledge of the ACS content system and Oracle reaches.

I encountered problems with the "Edit This Page" package in all the versions of OpenACS I installed.

We're planned to develop a web site that relies on "Edit This Page".

What version of OpenAcs do you recommend?


--- error ---


ora8.c:3463:ora_tcl_command: error in `OCIStmtExecute ()': ORA-02291: integrity constraint (MYSERVER.ACS_OBJECTS_OBJECT_TYPE_FK) violated - parent key not found
ORA-06512: at "MYSERVER.ACS_OBJECT", line 68
ORA-06512: at "MYSERVER.ETP", line 30
ORA-06512: at line 3

SQL: 
	begin
	  :1 := etp.create_page(
	           package_id     => :package_id,
	           name           => :name,
                   title          => :title,
	           content_type   => :content_type
	        );
	end;
Collapse
Posted by Dave Bauer on
Edit-this-page is definitely broken on Oracle.

You can try making this call in sqlplus:

select content_type.create_type (
        content_type => 'etp_page_revision',
        supertype => 'content_revision',
        pretty_name => 'ETP managed page',
        pretty_plural => 'ETP managed pages',
        table_name => 'etp_page_revisions',
        id_column => 'etp_page_revision_id',
        name_method => 'content_revision__revision_name'
);

Unfortunately the oracle version of ETP has not been maintained. Try creating the content type using that pl/sql call, and let me know what happens. You can ask more questions here or visit the  #openacs IRC channel at irc.freenode.net. See https://openacs.org/irc/ for more information.

Collapse
Posted by Boris Doesborg on
Thanks a lot Dave,

I'll try that.

What is the future of OpenACS on Oracle? At the moment the ACS core supports both Oracle and Postgres, right?

Do you (or anyone else) foresee that one day this support for Oracle will be dropped?

I read the thread about this subject but that was 2 years ago. How is the situation now?

Collapse
Posted by Carl Robert Blesius on
"Do you (or anyone else) foresee that one day this support for Oracle will be dropped"

Simple answer: No.
Simple reason: People are using it.

Collapse
Posted by Boris Doesborg on
I like simple answers
Collapse
Posted by Jun Yamog on
Hi,

I am not sure if ETP was ever fully ported to Oracle.  Please see this thread.

https://openacs.org/forums/message-view?message_id=33068

Collapse
Posted by Malte Sussdorff on
I know that Azri has been developing ETP for Oracle, extended (aka. forked) it and got it running sometime lately (maybe it is still in beta, not sure about this).
Collapse
Posted by Boris Doesborg on
We resolved the error by executing something slightly different:
begin
        content_type.create_type (
        content_type => 'etp_page_revision',
        supertype => 'content_revision',
        pretty_name => 'ETP managed page',
        pretty_plural => 'ETP managed pages',
        table_name => 'etp_page_revisions',
        id_column => 'etp_page_revision_id',
        name_method => 'content_revision.revision_name'
);
end;
/
show errors;
We also changed it in the create script: /web/myserver/packages/edit-this-page/sql/oracle/edit-this-page-create.sql

Thanks a lots.

Collapse
Posted by Dave Bauer on
You are welcome.

I just looked, and this is fixed in the most recent CVS version of OpenACS.

Collapse
Posted by Harish Krishnan on
As Malte pointed out about azri, I have done some code changes at TCL as well as pl/sql packages which not only made the package more stable with respect to functionalities but also some new features have been added. The code rewrite uses content repository functions and procedures and overcomes locking problems experienced with earlier ETP.

The new features include a sidebar navigation system and display of ads with a new experimental global display. You can have a look at ETP at http://develop.sussdorff-roy.com/alumni .

The above mentioned problem was the first one I experienced but not the only one with ETP on oracle and creating a content type etp_page_revision does solve the problem.

Collapse
Posted by Malte Sussdorff on
The URL would actually be http://develop.sussdorff-roy.com:8037/alumni. No login required for viewing the ETP pages.
Collapse
Posted by Dave Bauer on
Harish,

Let's coordinate to get these improvements into OpenACS 5.1.

Collapse
Posted by Boris Doesborg on
We found another error that caused havoc in Edit this page.

It is in /web/myserver/packages/edit-this-page/sql/oracle/edit-this-page-create.sql

We replaced these lines (68-81) ...

    function get_attribute_value (
      object_id    in acs_objects.object_id%TYPE,
      attribute_id in acs_attribute_values.attribute_id%TYPE
    ) return varchar is
      v_value acs_attribute_values.attr_value%TYPE;
    begin
        select attr_value
        into v_value
        from acs_attribute_values
        where object_id = object_id
        and attribute_id = attribute_id;
        return v_value;
        exception when no_data_found then return null;
    end get_attribute_value;
... with these ...
function get_attribute_value (
      object_id    in acs_objects.object_id%TYPE,
      attribute_id in acs_attribute_values.attribute_id%TYPE
    ) return varchar is
      v_value acs_attribute_values.attr_value%TYPE;
    begin
        select attr_value
        into v_value
        from acs_attribute_values
        where object_id = get_attribute_value.object_id
        and attribute_id = get_attribute_value.attribute_id;
        return v_value;
        exception when no_data_found then return null;
    end get_attribute_value;
I'm now working with the package and it seems (knock on wood) to work fine in an Oracle 8.1.6 & OpenACS 4.6.3 environment.

Harish and Malte, I'm still interested in other changes you made to the package including the new functionalties like the sliding menu.

Collapse
Posted by Harish Krishnan on
Sorry for the delay. I would really like to contribute to the effort.
Collapse
Posted by Boris Doesborg on
Found the "Commit your work" error.

Sometimes the "Commit your work" link simply didn't show up.

(for more info search for "batigol" in the IRC log https://openacs.org/irc/log/2003-10-17)

the problem is in line 209 and 210 of /web/yourserver/packages/edit-this-page/sql/edit-this-page-create.sql

      where i.name = name
      and i.parent_id = etp.get_folder_id(package_id)
Should be
      where i.name = create_new_revision.name
      and i.parent_id = etp.get_folder_id(create_new_revision.package_id)