API org.alfresco.webservice.util

cancel
Showing results for 
Search instead for 
Did you mean: 
jaime_martin
Member II

API org.alfresco.webservice.util

hola:
quería echar un vistazo a la API del paquete org.alfresco.webservice.util y lo que hay bajo él (por ejemplo org.alfresco.webservice.util.Constants; org.alfresco.webservice.util.Utils; org.alfresco.webservice.util.WebServiceFactorySmiley Wink
para complementar la info que he encontrado en la wiki
http://wiki.alfresco.com/wiki/Content_Web_Service
pero no lo veo por ningún lado.

El caso es que en este enlace
http://dev.alfresco.com/resource/docs/java/web-service-client/
sí he encontrado info de otros paquetes de org.alfresco.webservice
¿no hay página equivalente que contega la API de org.alfresco.webservice.util?
muchas gracias!
2 Replies
ajv
Member II

Re: API org.alfresco.webservice.util

Hola Jaime,

Es cierto, no aparece en el API. El motivo de que no aparezca (entiendo yo) es porque no forma parte del código fuente generado de Alfresco.
Si te descargas el código fuente de Alfresco, el proyecto Web Service Client contiene 2 carpetas de código: El java generado y el java fuente. En este último existen código de pruebas y el paquete util. El resto de paquetes se encuentra en el java generated.

No obstante, si estás interesado en echar un vistazo al código fuente de ese paquete, te dejo un par de enlaces directos:
http://kickjava.com/src/org/alfresco/webservice/util/AuthenticationUtils.java.htm
http://kickjava.com/src/org/alfresco/webservice/util/ContentUtils.java.htm
http://kickjava.com/src/org/alfresco/webservice/util/Constants.java.htm
http://kickjava.com/src/org/alfresco/webservice/util/WebServiceFactory.java.htm
http://kickjava.com/src/org/alfresco/webservice/util/ISO9075.java.htm
http://kickjava.com/src/org/alfresco/webservice/util/WebServiceException.java.htm

Justamente no he encontrado el código fuente de la clase Utils…pero por si no tienes descargado las fuentes de Alfresco, te adjunto el cóigo de la clase Utils, que es cortito:
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.

* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.

* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception.  You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.webservice.util;

import org.alfresco.webservice.types.NamedValue;
import org.alfresco.webservice.types.Reference;
import org.alfresco.webservice.types.Store;

/**
* This class provides a number of common utility methods usful when using the web service API
*
* @author Roy Wetherall
*/
public class Utils
{
   /**
    * Creates a single valued named value.
    *
    * @param name         the name
    * @param value         the value
    * @return NamedValue   the created NamedValue object
    */
    public static NamedValue createNamedValue(String name, String value)
    {
        NamedValue namedValue = new NamedValue();
        namedValue.setName(name);
        namedValue.setIsMultiValue(false);
        namedValue.setValue(value);
        return namedValue;
    }
   
    /**
     * Creates a multi-valued named value
     *
     * @param name         the name
     * @param values      the array of values
     * @return NamedValue   the create NamedValue object
     */
    public static NamedValue createNamedValue(String name, String[] values)
    {
        NamedValue namedValue = new NamedValue();
        namedValue.setName(name);
        namedValue.setIsMultiValue(true);
        namedValue.setValues(values);
        return namedValue;
    }
   
    /**
     * Gets the store reference string for a given Store object.
     *
     * @param store      the store
     * @return String   the store reference string
     */
    public static String getStoreRef(Store store)
    {
       return store.getScheme() + "://" + store.getAddress();
    }

    /**
     * Gets the node reference string for a given Reference object
     *
     * @param reference      the reference
     * @return String      the node reference string
     */
    public static String getNodeRef(Reference reference)
    {
       return getStoreRef(reference.getStore()) + "/" + reference.getUuid();
    }
}

Bueno, espero que con estas referencias tengas documentación de sobra  Smiley Very Happy
Hasta pronto!
jaime_martin
Member II

Re: API org.alfresco.webservice.util

Parece que tengo ojo clínico mi primer acercamiento a la API y justo me fijo en un paquete que no viene en la especificación!!!
Muchas gracias por tu respuesta que deprimía un poco el no encontrar nada justo de ese paquete ni en la wiki ni en la Alfresco Web Service Client Specification API cuando resulta que se importa en el primer ejemplo que estaba viendo, el FirstWebServiceClient!!!