cancel
Showing results for 
Search instead for 
Did you mean: 

Compound/C-struct property

hbf
Champ on-the-rise
Champ on-the-rise
Hi,

I need an aspect that maintains a set of email addresses and for each of these I want to save the datetime when the email address was last verified to work. So I need a list of a (C-like) struct that holds a single email address and a single date. How can I do this?

<aspect name="bla:contactable">
   <title>Contactable</title>
   <properties>
      <property name="bla:lastchecked">
         <type>d:datetime</type>
         <multiple>true</multiple>
      </property>
      <property name="bla:emailaddress">
         <type>d:text</type>
         <multiple>true</multiple>
      </property>
   </properties>
</aspect>

Unfortunately, this allows for different numbers of dates and addresses, something I do not want.

So is there something like a "compound" property?

Thanks,
Kaspar
9 REPLIES 9

mer
Champ in-the-making
Champ in-the-making
Hi,

I´ve got the same problem as you explain, and I don´t know the solution for this issue.

Please, if someone has any idea give it us.

Thanks in advance!

hbf
Champ on-the-rise
Champ on-the-rise
The way I see it, Alfresco can model this: Using child-associations you can "embed" (composition) into your type a variable-length array of instances of another type.

So in principle, the problem is solved. However, I see two issues with the current Alfresco Web Client that make the above approach very, very difficult for the end user:

    1. In the current Alfresco Web Client, you cannot have a mandatory child association to another type (i.e., a 1-to-n association with n>=1). You get an error:

    14:55:37,905 User:admin ERROR [node.integrity.IntegrityChecker] Found 1 integrity violations:
    The association child multiplicity has been violated:
       Source Node: workspace://SpacesStore/f7d07486-5a1c-11dc-8a59-19e8c96a8993
       Association: Association[ class=ClassDef[name={http://www.baselgovernance.org/icar/model/knowledge_center/content/1.0}content], name={[blabla]/model/knowledge_center/content/1.0}test-child-association, target class={[blabla]/model/knowledge_center/content/1.0}smallet, source role=null, target role=null]
       Required child Multiplicity: 1..1
       Actual child Multiplicity: 0
    14:55:38,051 User:admin ERROR [ui.common.Utils] A system error happened during the operation: Unknown Exception in Transaction.
    The expected correct behaviour for Alfresco would be to show another dialog to the user where she can enter the composition'ed data.
    2. More importantly, the current Alfresco Web Client only supports types that inherit from cm:content but in an composition we do not always want cm:content's properties.
I think we need help/clarification here by an Alfresco engineer. Could somebody comment on this?

paulhh
Champ in-the-making
Champ in-the-making
Hi

We have a design session planned for Friday on the topic of composite objects - both service implications (e.g. check-in) and UI.

Definitely something we will resolve - possibly with some help from a collabroative dev effort with a partner/customer.

Cheers
Paul.

rdanner
Champ in-the-making
Champ in-the-making
Hi

We have a design session planned for Friday on the topic of composite objects - both service implications (e.g. check-in) and UI.

Definitely something we will resolve - possibly with some help from a collabroative dev effort with a partner/customer.

Cheers
Paul.

Hi Paul, any update you can share here?

hbf
Champ on-the-rise
Champ on-the-rise
I am very much interested in this as well! So you have at least two good listeners 😉

paulhh
Champ in-the-making
Champ in-the-making
What came out was that the steps to resolve ideal behaviour are actually in the copy and checkout services:

http://wiki.alfresco.com/wiki/Copy_And_Checkout_Refactor

Comments welcome.

Paul.

rdanner
Champ in-the-making
Champ in-the-making
What came out was that the steps to resolve ideal behaviour are actually in the copy and checkout services:

http://wiki.alfresco.com/wiki/Copy_And_Checkout_Refactor

Comments welcome.

Paul.

On Checkout is the onCopy fired in addition to the onCheckout? 

Also, what does it mean to remote an aspect?  remove?

hbf
Champ on-the-rise
Champ on-the-rise
FYI:

I've looked at the UI side of the problem in the meantime and tried - without success - to write a AMP that allows you to show a special version of the standard child-associations UI in which there is not a "Search" button but a "Create" button instead. Clicking the button would create a new instance of the association's target type and would add it as a child to the given child-association.

You would show this special version by setting the "component-generator" attribute in web-client-custom.xml, for instance:


   <config evaluator="aspect-name" condition="my:person">
      <property-sheet>
         <show-child-association name="my:postaladdresses"
            component-generator="ChildAssociationCompositionGenerator"
            display-label="Postal addresses"/>
            …

To implement this, I subclassed UIChildAssociationEditor to UIChildAssociationCompositionEditor and tried to change BaseAssociationEditor's default implementation of encodeBegin() to show within the current property sheet other property sheets: one for each child in the child-association, and in addition, the aforementioned button "Create".

Unfortunately, this resulted in an error, and this is where I am stuck.


00:05:18,327 User:admin ERROR [renderkit.html.HtmlGridRendererBase] Wrong columns attribute for PanelGrid document-details:document-props:assoc_my_postaladdresses:_id0: 0

If anybody is interested, I can provide more information. As I do not have this much time, I will hardcode the properties of my model for the time being…

hbf
Champ on-the-rise
Champ on-the-rise
I have found a temporary solution. See this forum post.