cancel
Showing results for 
Search instead for 
Did you mean: 

getAspects in webservices

jlbarrera
Champ in-the-making
Champ in-the-making
Hello there are somethink that i dont understand.

I created a content in alfresco, and i applied an aspect to this content.

When i since web services try getAspects, this return "null"

This is the code:

String[] aspectos = row.getNode().getAspects();

Where row is ResultSetRow

Some ideas? Thanks!
5 REPLIES 5

jlbarrera
Champ in-the-making
Champ in-the-making
If i add the aspect "localizable":

<aspect name="cm:localizable">
         <title>Localizable</title>
         <properties>
            <property name="cm:locale">
               <title>Locale</title>
               <!– need to have means to identify root instance of appropriate category –>
               <type>d:category</type>
            </property>
         </properties>
      </aspect>

I can see locale in the columns of Node.

But if i add the "translatable" aspect to a Node..:

<aspect name="cm:translatable">
         <title>Translatable</title>
         <parent>cm:localizable</parent>
         <!– TODO: Support mandatory-aspects on an aspect in the meta-model
         <mandatory-aspects>
            <aspect>cm:localizable</aspect>
         </mandatory-aspects>
         –>
         <associations>
            <association name="cm:translations">
               <title>Translations</title>
               <source>
                  <role>cm:translationOf</role>
                  <mandatory>false</mandatory>
                  <many>false</many>
               </source>
               <target>
                  <class>cm:content</class>
                  <role>cm:hasTranslation</role>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </target>
            </association>
         </associations>
      </aspect>

How i can get this association?

Thanks…

More information:
————————-
the query:

Query queryAS = new Query(QueryLanguageEnum.lucene,"ASPECT:\"{http://www.alfresco.org/model/content/1.0}imagenNot\"");

return 1 node, so these node has the aspect "imagenNot" (in this case)
But when i access to Node (ResultSetRow)

I see that "aspects" is null   ????? Why?

In property "aspects" always is stored "null", never this property get any content. ?? It is not worked …

jlbarrera
Champ in-the-making
Champ in-the-making
The some question but the other way:

In "columns" are stored the properties of a Node, but where are stored the associations of a Node?

jlbarrera
Champ in-the-making
Champ in-the-making
I find in the wiki of alfresco:

queryAssociated

Execute a query to retrieve associated resources of the specified resource.

QueryResult queryAssociated(Reference node, Association[] association)

Parameters:

    * node - the reference
    * associatoin - the association

Return:

    * a query result containing the references associatied to the specified reference

OK I use for "queryAssociated", a Reference and a Association[], where Association[] is an array:

Association

    * associationType - cms:Name
    * direction - string (source, target)
The Reference is not problem, BUT….How i create an Association[]?

jlbarrera
Champ in-the-making
Champ in-the-making
OK i get the associations of a Node by this code…

RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService();

Association[] assoc = new Association[10];
   
Reference reference = new Reference(STORE, row.getNode().getId(), null);
QueryResult queryAssoc = repositoryService.queryAssociated(reference, assoc);
ResultSet resultSetAssoc = queryAssoc.getResultSet();

:wink: 

But i want select the type of association that i want get. I have seed that (in this case) in assoc  i can put the tipe of association that i want get..

But how?

I try:

Association[] assoc = new Association[10];
assoc[0].setAssociationType(tipo);

But i received a NullPointerException…Some ideas?

rwetherall
Confirmed Champ
Confirmed Champ
Hi,

It looks like there is a bug around this area.  Looking at the server code the associations parameter is not used, which I presume it should be in order to filter the returned associations types.

Did you get an error when you passed a null value to the associations parameter?

The best course of action will be to add this as an issue to Jira so that you can track its progress.

Cheers,
Roy