Thursday, March 22, 2007

WP Rules and Relations

Subject: When using the Rules Editor to create a "New Rule", why can't I see all the Editor Rules folders?

Note: The "New Rule" action is running a query for category objects that may not match the object_name of the folders you might expect to see with folder view of the Template folders.

There are some details provided in the online Help (WebPublisher 442c) in the section, "Creating a New Rules File Using the Rule Editor".

Following the process for creating a new rules file using the Rule Editor, you select an unassociated WebPublisher Editor template file upon which to base the new rules file. The WebPublisher XML template must be already imported into the Docbase in order for you to create the rules file. Creating a rules file checks out and locks the WebPublisher Editor template file.

Please refer to the documentation (either online help of pdf docs) for more details on using the Rules Editor.

A bit more background and detail on what is happening when you click on "New Rule":

If you do not have a template already in place you will need to create and import your template file. It must have the category set. When you use the Web based Rules Editor to add a "New Rule" from the folder /WebPublisher Configuration/Supporting Templates/Editor Rules, the navigation will list the categories. The WebPublisher template file cannot be an html file. It must be an XML template file to use the Rules Editor.

If you look at the query that is run to display the categories in a folder view you will see a folder structure made up of wcm_category objects. These are not necessarily the same folder structure you will see if you navigate to the folder /WebPublisher Configuration/Supporting Templates/Editor Rules.

query traced in WebPublisher 4.4.2c:
API> execquery,s0,T,select upper(object_name), r_object_id, i_vstamp, r_object_type, i_is_reference, object_name, a_content_type, r_modify_date, r_lock_owner, r_link_cnt, object_name from wcm_category where
FOLDER('/WebPublisher Configuration/Content Templates')
AND a_is_hidden = false order by 1

NOTE if you perform an API dump for one of the objects returned by the above query, check that wcm_category object's value for "r_folder_path" It should indicate something like the following /WebPublisher Configuration/Content Templates/ where 'template-category' is the category value.

*************************************************************************************

Subject: How can I find the rules and presentation file associations for a given xml file in a WebPublisher cabinet?


Note: You can use the DMCL tracing tool to find out the DQL queries running for a particular action in WebPublisher.

To find out the query that runs behind the scenes to get the rules file and the presentation file of a file;
- Login to WebPublisher
- Start the DCML Browser Tracing tool (See Support 5023 for more details on DMCL Browser Tracing tool.)
- Locate and select the file.
- Click on Associate.
This is going to give you a page with the current associations of the selected file.
- Go to the Tracing tool and look for readquery to get the query which ran at the background.


The following DQL queries is pulled out from the trace tool as described above:

TO GET THE ASSOCIATED RULES FILE:

DQL> select r_object_id,description from dm_document d, dm_relation r
where d.i_chronicle_id_i = r.child_id and r.parent_id =
ID('') and relation_name ='wcm_rules_template';


TO GET THE ASSOCIATED PRESENTATION FILE:


DQL> select r_object_id,description from dm_document d, dm_relation r where
d.i_chronicle_id_i = r.child_id and r.parent_id =
ID('') and relation_name ='wcm_layout_template';

*************************************************************************************

Subject: Why might I see, ? UIMain.initializationFailure in the Rules Editor?


Note: When first invoking the rules editor you may experience this error.

One method to correct this issue is to add the local_path variable to a writable directory on the application server machine. The local_path attribute is set in the dmcl.ini file on the application server and should look something like:

local_path=c:\temp

This tells the Rules Editor to write to the browser file system to the C:\temp

This entry should be added to the [DMAPI_CONFIGURATION] section.

NOTE: adding local_path as

local_path=c:\temp\ does NOT WORK

It should also be noted attribute is not required and is simply being provided as an option.

*************************************************************************************

Subject: How do I update the integrity_kind value of a dm_relation type in WebPublisher?


Note: You may run into a situation where you receive an error similar to the following when deleting an object in WebPublisher:

"cannot delete object XXXX since dm_relation object(s) XXXXXXXXX
exists with integrity_kind set to 1."; ERRORCODE: 100; NEXT; null"

In order to delete the object, you can set the integrity kind for a relationship by running the following:

IAPI>retrive,c,dm_relation_type where relation_name=''
IAPI>set,c,l,integrity_kind
IAPI>0
IAPI>save,c,l

NOTE: See the attached document for list of dm_relation types in WebPublisher.


select DMOBJECTTYPE

from dm_attachments

where dmattachmentid= '40819'

and DMWWWCONTENTTYPE = 'text/plain'

and DMFILENAME = 'wprelations.txt'


DQL> select * from dm_relation_type where relation_name like 'wcm%';

relation_name

wcm_template_thumbnail
wcm_process_workflow
wcm_layout_template
wcm_rules_template
wcm_publishing_template
wcm_category
wcm_my_template
wcm_default_workflow
wcm_dynamic_content
wcm_doc_template
DQL>


Setting the integrity kind for a realtionship type

IAPI>retrive,c,dm_relation_type where relation_name=''
IAPI>set,c,l,integrity_kind
IAPI>0
IAPI>save,c,l

*************************************************************************************

No comments: