cancel
Showing results for 
Search instead for 
Did you mean: 

link properties

shay
Champ in-the-making
Champ in-the-making
Hi,

I'm having some problems with links in alfresco:

when i create a link via the web client (copy and paste as link) and then i try to modify the link properties i get the following exception:

in the console:

15:07:02,796 ERROR [ui.common.Utils] A system error happened during the operation: null
java.lang.NullPointerException
        at org.alfresco.web.bean.LinkPropertiesBean.save(LinkPropertiesBean.java :209)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
        at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
        at javax.faces.component.UICommand.broadcas(UICommand.java:106)
        at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
        at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:316)
        at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:105)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:81)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:595)

        at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:81)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:595)

and in the web client:

A system error happened during the operation: null


is there a solution for this problem?


second question:
i need to add some new properties to a link, i tried to add some new properties into the contentModel.xml and now my cm:link element looks like:

<type name="cm:link">
         <title>Link Object</title>
         <parent>cm:cmobject</parent>
         <properties>
            <property name="cm:destination">
               <title>Link Destination</title>
               <type>d:noderef</type>
               <mandatory>true</mandatory>
            </property>
            <property name="cmSmiley Frustratedtatus">
                      <title>Status</title>
                    <type>d:text</type>
                    <constraints>
                            <constraint ref="cmSmiley Frustratedtatus"/>
                      </constraints>
                  </property>
                  <property name="cm:GalleryId">
                      <title>Gallery Id</title>
                    <type>d:text</type>
                  </property>
                  <property name="cm:Index">
                      <title>Index</title>
                    <type>d:long</type>
                  </property>
         </properties>
      </type>

Is it the currect place to put those parametetrs?
Where do I set the web client to show them?
I done it for content types but from what I saw link is not content

Thanks in advance,
Shay.
10 REPLIES 10

shay
Champ in-the-making
Champ in-the-making
Hi Luis ,


Thank you for the reply,
I tried your suggestion and now i can see the new properties of the link in the view details mode, but when i try to modify them i can't see any of them in the modify mode.

moreover i'm still having the first problem with the exception when i try to modify some of the original properties, this problem occurs before i did any changes regarding the link properties.

Shay.

shay
Champ in-the-making
Champ in-the-making
Hi,

I did it. But I have 2 issues.
First one and most important: even if I dont change nothing in the configuration, I can not edit the link properties(title for example). I get null pointer exception.
Second thing is that after changing the web client config custom with the next lines:
<config evaluator="aspect-name" condition="custom:LinkAspect">
       <property-sheet>
      <show-property name="custom:GalleryId"/>
      <show-property name="custom:Index"/>
      <show-property name="customSmiley Frustratedtatus"/>
       </property-sheet>
   </config>
and custom model:
<aspect name="custom:LinkAspect">
           <title>Link Aspect</title>
            <properties>
                  <property name="customSmiley Frustratedtatus">
                      <title>Status</title>
                    <type>d:text</type>
                    <constraints>
                            <constraint ref="customSmiley Frustratedtatus"/>
                      </constraints>
                  </property>
                  <property name="custom:GalleryId">
                      <title>Gallery Id</title>
                    <type>d:text</type>
                  </property>
                  <property name="custom:Index">
                      <title>Index</title>
                    <type>d:long</type>
                  </property>
            </properties>
         </aspect>
I still can not see those new properties in edit mode.

Thank you,

gavinc
Champ in-the-making
Champ in-the-making
This is an interesting find, the reason you can not see the properties in edit mode is because the edit page for link properties is not using the property sheet component (edit-link-properties.jsp). This may have been a design decision back in the day when this page was added.

There are a couple of things you can do, you can either customise the JSP. To do this you will also have to override the 'editLinkProperties' navigation rule in faces-config-navigation.xml to point to your new JSP. Then on your JSP you can add the fields you need. The downside to this is that the fields will appear for all links so you'll need to add the 'rendered' attribute to them so they only appear when your aspect is applied.

Or you could apply your aspect directly to the content the link is from, you'll then be able to view and edit the properties in the usual way, but this may not be a suitable solutions as I presume there's a specific reason you want the properties on the link itself.

Also, please raise this as an issue in JIRA so that it gets looked at and reviewed.

Hope this helps.

friedman30
Champ in-the-making
Champ in-the-making
Hi Gavin,

I've seen this post, and tried following your solution.
as for now, i've added another field in "edit-link-properties.jsp" file:

<tr>
<td><nobr><hSmiley SurprisedutputText value="Index" />:</nobr></td>
<td>
<h:inputText value="#{LinkPropertiesBean.properties.Index}" size="35" maxlength="1024" />
</td>
</tr>

("index" is a property of an aspect i've added to customModel.xml and used in web-client-confid-custom.xml)

so, now when i edit the properties of a link, i see the added index (and when i return to this page i see that the value is stored). but after i press the OK button - on the page that shows the properties, i see the Index, but  not it's value….

is there another *.jsp page that needs to be changed for this to work?
is there a different data model that feeds the edit page and the view page of the link properties?
am i missing something here :shock:

thanks,

Dror

gavinc
Champ in-the-making
Champ in-the-making
No, there isn't a different data model, it may be that the properties of the node are cached.

If you navigate away from the space containing the link and come back do you see the value in the view page (by view page i presume you mean the one titled "Details of '<yourlink>.url'")?

friedman30
Champ in-the-making
Champ in-the-making
hi Gavin.

you're right. by "view page" i mean the one titled "Details of '<mylink>.url'")

I think I'm getting towards the solution, but I'm not there yet -
there is an attribute externalConfig for  <rSmiley TongueropertySheetGrid> element. It was set to "true".

<rSmiley TongueropertySheetGrid id="document-props" value="#{DocumentDetailsBean.document}" var="documentProps"
columns="1" mode="view" labelStyleClass="propertiesLabel" externalConfig="true" />


I've found (in the wiki) that when i remove it, i see all the properties (but now i have an overflow of properties).

where can i find this external configuration file?
what should i do to show only the properties i want to??
:?:

thanks,

Dror

gavinc
Champ in-the-making
Champ in-the-making
Have a look at one of the previous posts in this topic and you'll see the following config:

<config evaluator="aspect-name" condition="custom:LinkAspect">
  <property-sheet>
    <show-property name="custom:GalleryId"/>
    <show-property name="custom:Index"/>
    <show-property name="custom:Status"/>
  </property-sheet>
</config>

You need to do something similar in your web-client-config-custom.xml file to make only the properties you want to appear. This file must go in <tomcat>/shared/classes/alfresco/extension. Have a look at http://wiki.alfresco.com/wiki/Web_Client_Configuration_Guide and http://wiki.alfresco.com/wiki/Packaging_And_Deploying_Extensions for details.

friedman30
Champ in-the-making
Champ in-the-making
hi gavin,

I've done exactly what you suggest (from the beginning) but that does not solve the problem at all…  :roll:

I want all of my properties to show, but only some of the default properties.
So I still need to know what is the attribute externalConfig (in <rSmiley TongueropertySheetGrid> element) is pointing at…

where is the external configuration coming from???
Can I define this configuration file to show my properties and some of the alfresco pre-defined properties???

:?:  :?:  :?:

Thanks,

Dror

friedman30
Champ in-the-making
Champ in-the-making
Hi,

I've just noticed one more disturbing thing…
there is no link between the custom.model types that i've defined (in customModel.xml & web-client-config-custom.xml) and the properties i've added to edit-link-properties.jsp.
:shock:

what is the way to keep the same working pattern here?