Master-Detail relationship between postings

Master-Detail relationship between postings

Post by bjorn. » Thu, 23 Oct 2003 21:51:43


Hi,

I am new to CMS and trying to learn it by developing a site that
manages employees and their working experience (projects). Information
about the employee is maintained using one template and each
project(one or more) is entered in another one.
My problem is how to design the 1:M / Master-detail relationship. I
have thought about programmatically marking the detail pages with a
custom property "ParentPostingID" or something similar. To avoid
misspellings of custom property values etc, the detail postings will
also be created automatically (not using the console) when the user
presses a "Save" button.

Is there a better way? Could anyone give a hint?! I think this is a
common problem - there has to be a solution pattern for this?!

Thanks in advance,

Bjn
 
 
 

Master-Detail relationship between postings

Post by Stefan [MS » Thu, 23 Oct 2003 23:12:08

Hi Bjn,

I personally used the same approach.

Cheers,
Stefan.

--
This posting is provided "AS IS" with no warranties, and confers no rights.

 
 
 

Master-Detail relationship between postings

Post by bjorn. » Fri, 24 Oct 2003 13:48:09

Hi Stefan,

Thank you for your answer.

Digging deeper into it, there are still some questions...

When should the custom properties (parent's id) be assigned to the
detail postings ?

1) If I do it when the user pushes "Save" button (Create New Page,
Edit mode), it doesn't seem possible to set values of custom
properties at all. But I have access to the parent's id (as a
parameter value to the form).

2) If I catch the posting_created-event in global.asax, I can assign a
value but on the other hand there is no info about the parent....

I hope it's just a lack of knowledge that I can't get alternative #1
to work. My intuition tells me that there's where the connection
between Master and Details should be made.


What would you recommend??

Best regards,
Bjn
 
 
 

Master-Detail relationship between postings

Post by Stefan [MS » Sat, 25 Oct 2003 00:59:31

Hi Bjn,

1) that is correct. The properties need to be created after the page is
created. You cannot create properties for a non-existing page. I do it in a
workflow event.

2) what do you mean by "no info about the parent"?
e.Target contains the posting object:

Posting p = (Posting) e.Target;

Now you can access all properties.

Cheers,
Stefan.

--
This posting is provided "AS IS" with no warranties, and confers no rights.






rights.
 
 
 

Master-Detail relationship between postings

Post by bjorn. » Sat, 25 Oct 2003 17:40:20

hanks again,

Regarding "no info about the parent":
Yes, I am aware of the e.Target property but what I also need (which I
only think is available during Edit of the detail posting) is the id
of the master posting. The custom property ParentPostingID of the
detail posting must be assigned to the value of owning/master
posting's id in order to establsih a connection between them.
For example storing it in a hidden placeholder seems to be a primitive
way, but isn't there better solutions?!


Best regards,
Bjn


"Stefan [MSFT]" < XXXX@XXXXX.COM > wrote in message news:< XXXX@XXXXX.COM >...
 
 
 

Master-Detail relationship between postings

Post by Stefan [MS » Sat, 25 Oct 2003 19:27:13

i Bjn,

I did it that way:
When I create the master posting I automatically create the detail postings
in the workflow event.
Here I have the information of the master posting and can add the "link" to
the master posting in each of the created detail postings. In addition I
also have the links to the detail postings and I'm able to add this link to
the master postings properties.

Cheers,
Stefan.

--
This posting is provided "AS IS" with no warranties, and confers no rights.


"Bj?rn" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...
news:< XXXX@XXXXX.COM >...
in a
rights.
Information
I
a
will
user
a


 
 
 

Master-Detail relationship between postings

Post by Luis Carva » Sat, 25 Oct 2003 22:44:37

i!
I've been following this post for it is of great interest
to me.
In this case, how can I, for example, list all the
projects of an employee or vice-versa, all the employees
in one project?
Do I need to sweep all the postings searching and
comparing that ParentPostingID? Or is there a better way?

the detail postings
add the "link" to
postings. In addition I
to add this link to
confers no rights.
also need (which I
posting) is the id
ParentPostingID of the
owning/master
them.
be a primitive
message
after the page is
existing page. I do it
and confers no
news: XXXX@XXXXX.COM ...
questions...
assigned to the
(Create New Page,
of custom
parent's id (as a
global.asax, I can assign a
the parent....
get alternative #1
the connection
wrote in message
warranties, and confers no
news: XXXX@XXXXX.COM ...
developing a site that
(projects).
template and each
detail relationship.
detail pages with
similar. To avoid
detail postings
console) when the
hint?! I think this is
pattern for this?!
 
 
 

Master-Detail relationship between postings

Post by Stefan [MS » Sat, 25 Oct 2003 23:20:41

i Luis,

if you have a lot of relations ships, you should consider to use an external
SQL database to hold these relationships.
In this database you could store the path of the linked postings.
This would be much more performant as using custom properties.
The approach listed here is good for small amount of data and only if you do
not need to search for it.

Regards,
Stefan.

--
This posting is provided "AS IS" with no warranties, and confers no rights.


"Luis Carvalho" < XXXX@XXXXX.COM > wrote in message
news:0ac701c39a34$f78855f0$ XXXX@XXXXX.COM ...
Hi!
I've been following this post for it is of great interest
to me.
In this case, how can I, for example, list all the
projects of an employee or vice-versa, all the employees
in one project?
Do I need to sweep all the postings searching and
comparing that ParentPostingID? Or is there a better way?

the detail postings
add the "link" to
postings. In addition I
to add this link to
confers no rights.
also need (which I
posting) is the id
ParentPostingID of the
owning/master
them.
be a primitive
message
after the page is
existing page. I do it
and confers no
news: XXXX@XXXXX.COM ...
questions...
assigned to the
(Create New Page,
of custom
parent's id (as a
global.asax, I can assign a
the parent....
get alternative #1
the connection
wrote in message
warranties, and confers no
news: XXXX@XXXXX.COM ...
developing a site that
(projects).
template and each
detail relationship.
detail pages with
similar. To avoid
detail postings
console) when the
hint?! I think this is
pattern for this?!