• Error en propiedades de un documento

  • Do you want to create a native client or integrate with third party applications: webservices are the solution.
Do you want to create a native client or integrate with third party applications: webservices are the solution.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #5333  by lopezmorales.javier
 
Buenas! Cuando quiero recuperar las propiedades de un documento, me devuelve todas las propiedades correctamente, execto en dos casos:
- notes
- subscriptors

Ambos devuelven arrays (Array_Of_note = array of note; para el primero y Array_Of_string = array of string; para el segundo, todo esto en delphi 2010)
Vamos por partes:
- Si el documento posee alguna nota, el array correspondiente posee siempre 3 valores(aun teniendo solo 1 nota, por ejemplo), si no tiene ninguna devuelve 0 valores. A esos valores le intento obtener el texto y el autor y siempre contienen una cadena vacia.
- Y los subcriptors siempre me devuelve un array con 0 valores, tenga o no tenga subcriptors.

Código que utilizo:
Code: Select all
 
var
  documento: OKMDocument1.document;
  notas: OKMDocument1.Array_Of_note;
  nota: OKMDocument1.note;
  suscriptores: OKMDocument1.Array_Of_string;
begin
  documento := GetOKMDocument.getProperties(token, sDocumentSelected);
  mmoPropiedadesDocumento.Lines.Add( 'actualVersion: ' + documento.actualVersion.name_ ); //propiedad que recupera perfectamente

  notas := OKMDocument1.Array_Of_note( documento.notes); //recupero las notas

  if Length(notas) > 0 then
  begin
     for I := Low(notas) to High(notas) do //High(notas) siempre = 2, de 0 a 2 = 3 valores
      begin
          nota := OKMDocument1.note( notas[I] );
          mmoPropiedadesDocumento.Lines.Add( '   - ' + nota.user + '  ' + nota.text ); // nota.user y  nota.text siempre cadenas vacias
     end;
  end;

¿Alguna idea?
 #5340  by jllort
 
Puede que tengamos un bug en los WS. Lo miraremos ahora no te lo puedo asegurar.
 #5344  by lopezmorales.javier
 
jllort wrote:Puede que tengamos un bug en los WS. Lo miraremos ahora no te lo puedo asegurar.
Tema resuelto, es problema a la hora de generar el WS automaticamente, lo he comprobado consumiendo el servicio en java y funciona perfectamente. Gracias por la ayuda.
 #5365  by lopezmorales.javier
 
Re-abro el tema, investigando un poco vuestro wsdl de document me encuentro con esto:
Code: Select all
<xs:complexType name="document">
<xs:sequence>
<xs:element minOccurs="0" name="actualVersion" type="tns:version"/>
<xs:element minOccurs="0" name="author" type="xs:string"/>
<xs:element name="checkedOut" type="xs:boolean"/>
<xs:element name="convertibleToPdf" type="xs:boolean"/>
<xs:element name="convertibleToSwf" type="xs:boolean"/>
<xs:element minOccurs="0" name="created" type="xs:dateTime"/>
<xs:element minOccurs="0" name="keywords" type="xs:string"/>
<xs:element minOccurs="0" name="language" type="xs:string"/>
<xs:element minOccurs="0" name="lastModified" type="xs:dateTime"/>
<xs:element minOccurs="0" name="lockInfo" type="tns:lock"/>
<xs:element name="locked" type="xs:boolean"/>
<xs:element minOccurs="0" name="mimeType" type="xs:string"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="notes" nillable="true" type="tns:note"/>
<xs:element minOccurs="0" name="path" type="xs:string"/>
<xs:element name="permissions" type="xs:byte"/>
<xs:element name="subscribed" type="xs:boolean"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="subscriptors" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="uuid" type="xs:string"/>
</xs:sequence>
</xs:complexType>
En la linea que nombra a:
Code: Select all
<xs:element maxOccurs="unbounded" minOccurs="0" name="notes" nillable="true" type="tns:note"/>
¿la propiedad type no deberia ser del tipo array de notes?

Haciendo mis pruebas a partir de:
Code: Select all
 tNote = Class(TRemotable)
    private
      sText: string;
      sAuthor: string;
    published
      property text: string read sText write sText;
      property author: string read sAuthor write sAuthor;
  end;

  tNotes = array of TNote;

  tDocumento = Class(TRemotable)
    private
      sName: string;
      sNotes: tNotes;
    published
      property name: string read sName write sName;
      property notas: tNotes read sNotes write sNotes;
  end;
Me genera este wsdl:
Code: Select all
<xs:complexType name="tDocumento">

<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="notas" type="ns1:tNotes"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="tNotes">
<xs:complexContent>
<xs:restriction base="soapenc:Array">
<xs:sequence/>
<xs:attribute ref="soapenc:arrayType" n1:arrayType="ns1:tNote[]"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>

<xs:complexType name="tNote">
<xs:sequence>
<xs:element name="text" type="xs:string"/>
<xs:element name="author" type="xs:string"/>
</xs:sequence>
</xs:complexType>
Gracias por la ayuda de antemano!
 #5476  by lopezmorales.javier
 
solucionado completamente, el problema era derivado a la hora de crear el WS automaticamente, a delphi no le gusta esto:
<xs:element maxOccurs="unbounded" minOccurs="0" name="notes" nillable="true" type="tns:note"/>

Añadiendo la siguiente línea, está resuelto:
RemClassRegistry.RegisterSerializeOptions(Document, [xoInlineArrays]);
 #5504  by pavila
 
El tema es que los web services los genera JBoss a partir de unas clases, y me temo que no funciona exactamente como le gustaría a algunas implementaciones cliente por lo que se presentan problemas como el que comentas. Si alguien quiere aportar alguna mejora en este sentido sería bienvenida.

Un saludo.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.