Forum OpenACS Development: General Include access

Collapse
2: General Include access (response to 1)
Posted by Malte Sussdorff on
To achieve the goal of Liferay integration and probably mashups in OpenACS, I am leaning towards writing a page "/acs-subsite/www/include", which will allow me the following:

Call yourserver.com/include/package_key/include_name?variables

This will result in OpenACS evaluating the include_name of the package_key (e.g. /packages/project-manager/tasks) and return the contents, just if I would call <include src="/packages/project-manager/tasks" variable1=@variable1@ ...>

The reason to put it into site-map is that it will allow me to do the following:

/subsite1/include/project-manager/tasks and pass the package_ids of all instances of project manager to the tasks include.

Alternatively I could call:

/subsite1/include/project-manager/tasks?include_subprojects_p?1 which would include all project-manager instances in the subprojects as well

Additionally I could think about a second page which does the following:

/subsite1/include_url/pm/tasks and pass the package_id of the package instance mounted at /subsite1/pm/

The method with the package_id would probably work with .LRN as well, if we only change the includes to not set the list_of_package_ids automatically to the config from .LRN, but allow them to be passed in as a variable instead.

Are there any objections to this approach? Am I not general enough? Would this make sense in the first place to others in the first place or should I keep it private?

The value is that you can call a URL and get the content of an include e.g. in /lib without having to write a page to display it separately, enabling you to easily include content from OpenACS in other websites.

P.S.: Yes, I do know that there exists a problem if you want to do true includes without the user having to log in. But that is a separate problem that needs to be tackled. For my use case at the moment we just assume the cookie from the login exists.