cancel
Showing results for 
Search instead for 
Did you mean: 

d:path type and variable error

userfresco
Champ in-the-making
Champ in-the-making
Hi,

This problem and question is the <type>dSmiley Tongueath</type> variable value
Running a rule that adds the above property to a document with the default value of http://localhost/editor/editpage.php results in a error
Failed to run Actions due to error: The property value is not compatible with the type defined for the property: property: Name: {custom.model}EditLink Title: EditLink Description: null Default Value: localhost/edit.aspx DataType Name: {http://www.alfresco.org/model/dictionary/1.0}path ContainerClass Name: {custom.model}EditLink isMultiValued: false isMandatory: false isMandatoryEnforced: false isProtected: false isIndexed: true isStoredInIndex: false isIndexedAtomically: true indexTokenisationMode: TRUE value: localhost/edit.aspx value type: class java.lang.String
My idea is to eventually add the document.url to the end of the  default value to end up looking something like the url below, but the type of property dSmiley Tongueath seems to not accept this format
http://localhost/editor/editpage.php?file=http://localhost:8080/alfresco/d/d/workspace/SpacesStore/e...

This value is then displayed in the 'view details' page in the property section and the user can click on the link to edit the xml document

Here are the files below

web-client-config-custom.xml
<config evaluator="aspect-name" condition="custom:EditLink">
      <property-sheet>
         <separator name="sepCust4" display-label="EditLink" component-generator="HeaderSeparatorGenerator" />
         <show-property name="custom:EditLink"/>
      </property-sheet>
   </config>
custom-model-context.xml

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>

    <!– Registration of new models –>   
    <bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/customModel.xml</value>
            </list>
        </property>
    </bean>
         
</beans>
customModel.xml
<aspect name="custom:EditLink">
         <title>EditLink</title>
         <properties>
            <property name="custom:EditLink">
               <title>EditLink</title>
               <type>dSmiley Tongueath</type>
            <protected>false</protected>
            <mandatory>false</mandatory>
            <multiple>false</multiple>
            <default>http://localhost/editor/editpage.php</default>
            </property>
         </properties>
      </aspect>
    

Any other ideas, references or suggestions appreciated
Thank you in advance.
2 REPLIES 2

userfresco
Champ in-the-making
Champ in-the-making
This functionality can be accomplished by making the following changes:

1. File CustomModel.xml

<type>d:text</type>

2. File web-client-config-custom.xml

<show-property name="custom:EditLink" component-generator="LinkGenerator" />

rbkprod
Champ in-the-making
Champ in-the-making
This functionality can be accomplished by making the following changes:

1. File CustomModel.xml

<type>d:text</type>

2. File web-client-config-custom.xml

<show-property name="custom:EditLink" component-generator="LinkGenerator" />

This is nice! Thanks.

I have a question though, if I want (in your example) custom:EditLink to be a link to a text file in another space (so when you view properties, the property EditLink references to say test.txt in Company Home -> Files -> Test.txt) I have a .js to get the url, something like:


var ref = document.properties["custom:ref"];
if (ref == "Test")//user enters test in the text field
{
    var refFolder = companyhome.childByNamePath("/Files/Test.txt");
    ref = refFolder.url;
    document.properties["custom:ref"] = ref; //change it to the test.txt url
}
document.save();

Although the link seems legit in the properties screen, when I click on it, it doesn't open the right file, just opens a blank.

Any thoughts?