简体   繁体   English

是否可以在SDL Tridion 2011 SP1中创建数据库表

[英]Is it possible to create database tables in SDL Tridion 2011 SP1

I just wanted know, whether it is possible to create database tables in SDL Tridion 2011 SP1 and access it from an event handler. 我只是想知道,是否有可能在SDL Tridion 2011 SP1中创建数据库表并从事件处理程序访问它。

Requirement: I want to make use of the database Tables created in event handler to automate page creation for every component created. 要求:我想利用在事件处理程序中创建的数据库表为创建的每个组件自动创建页面。

The database Tables will have information about the page templates and component templates for every schema. 数据库表将具有有关每个模式的页面模板和组件模板的信息。

Whenever a component is created a even handler will be triggered. 每当创建组件时,都会触发一个偶数处理程序。 It should get the component template, page template from database for the given schema and create a Page automatically. 它应该从数据库中获取给定架构的组件模板,页面模板,并自动创建一个页面。 I want to create this database inside the Tridion. 我想在Tridion内部创建此数据库。 I just wanted to know is it possible to create a such database in Tridion. 我只是想知道是否可以在Tridion中创建这样的数据库。 Is it possible to achieve this in the better way? 有可能以更好的方式实现这一目标吗?

That requirement does not make any sense to me, but maybe I have too little information about what you are trying to achieve. 这项要求对我来说没有任何意义,但也许我对您要达到的目标知之甚少。

So, to strictly answer you question: in an event handler you can do whatever you want, since you are in full .NET programming context. 因此,要严格回答您的问题:在事件处理程序中,您可以执行任何所需的操作,因为您处于完整的.NET编程上下文中。 If you want to create a Database, that is possible. 如果要create数据库,则可以。

Note: If you are tying to automatically create Pages in an Event System, you can do this without creating any additional DBs or tables. 注意:如果要在事件系统中自动创建页面,则可以执行此操作而无需创建任何其他DB或表。 Again, I would need more information about what exactly you are trying to accomplish. 同样,我将需要更多有关您要完成的目标的信息。

Edit 1: I recommend against creating any additional tables inside the Tridion CM database, solely for the purpose of keeping things separated - what's Tridion should be kept Tridion and anything you create custom, should be in a different database or namespace. 编辑1:我建议不要在Tridion CM数据库中创建任何其他表,仅是为了使事物分开-Tridion应该保留Tridion,并且您创建的任何自定义内容都应位于不同的数据库或命名空间中。 You will be happy you did so, when you will upgrade your CM. 当您升级CM时,您会很高兴这样做。

I would also recommend storing those parameters you need for automatic Page creation (eg Component Template, Page Template) outside of a Database table. 我还建议在数据库表之外存储自动创建页面所需的那些参数(例如,组件模板,页面模板)。 Think about Folder metadata, configuration files, etc. Storing it in a DB table is not bad per se, but it's kind of an overkill. 考虑一下文件夹元数据,配置文件等。将其存储在数据库表中本身并不坏,但这有点过头了。

If you are asking if you can create additional databases on the same database server as the SDL Tridion CM database, the answer is yes. 如果询问是否可以在与SDL Tridion CM数据库相同的数据库服务器上创建其他数据库,则答案是肯定的。 If that is not what you mean I have no idea what you mean by making a database in Tridion, so please clarify. 如果这不是您的意思,那么我不知道在Tridion中建立数据库的意思,因此请澄清一下。

On a seperate note, it is more common to solve your challenge using metadata on folders. 另外,使用文件夹上的元数据来解决挑战更普遍。 This gives you the benefit that your data is in one datastore, and can be Content Ported between environments. 这给您带来的好处是,数据位于一个数据存储中,并且可以在环境之间进行内容移植。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM