com.jalios.rest.client
Class DataElement

java.lang.Object
  extended by com.jalios.rest.client.DataElement

public class DataElement
extends Object

JCMS OpenAPI provides many times JCMS data in XML as exported with the JCMS import/export form. This class provides a usefull way to get the informations in the wrapped JCMS data XML element.

Since:
JCMS-6.0.1
Author:
dissert

Constructor Summary
DataElement(org.jdom.Element element, ClientSession session)
           
 
Method Summary
 org.jdom.Element getAbstractField()
          The JDOM element corresponding to the abstract of the JCMS data represented by the wrapped element.
 String getAbstractMLName()
           
 Date getCdate()
           
static List<DataElement> getDataElementList(JcmsResource resource, ClientSession session)
          For a resource in dataset form, gives a list of corresponding DataElement object.
static List<DataElement> getDataElementList(JcmsResource resource, ClientSession session, String dataSetTag)
          For a resource in dataset form, gives a list of corresponding DataElement object.
 org.jdom.Element getElement()
           
 org.jdom.Element getField(String name)
           
static DataElement getFirstDataElement(JcmsResource resource, ClientSession session)
          For a single data in a resource, gives the corresponding DataElement object.
 String getId()
          Gives the id of the JCMS data represented by the wrapped element.
 String getMainLanguage()
          Gives the main language of the JCMS data represented by the wrapped element.
 Date getMdate()
           
 org.jdom.Element getMLField(org.jdom.Element field)
           
 Date getPdate()
           
 Relateds getRelateds()
          Gives a representation of this DataElement related parameters.
 String getTitle()
           
 String getUrl()
          Gives the url of the JCMS data represented by the wrapped element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataElement

public DataElement(org.jdom.Element element,
                   ClientSession session)
Method Detail

getId

public String getId()
Gives the id of the JCMS data represented by the wrapped element.

Returns:
the id found as an attribute in the XML

getUrl

public String getUrl()
Gives the url of the JCMS data represented by the wrapped element.

Returns:
the url found from an attribute in the XML

getMainLanguage

public String getMainLanguage()
Gives the main language of the JCMS data represented by the wrapped element.

Returns:
the main language (ISO representation)

getTitle

public String getTitle()
Returns:
the title of the JCMS data represented by the wrapped element, in its main language.

getAbstractField

public org.jdom.Element getAbstractField()
The JDOM element corresponding to the abstract of the JCMS data represented by the wrapped element. It contains only the text in the main language of the data. an attribute gives the name of the element with multilingual values.

Returns:
the Jdom element corresponding to the abstract of the JCMS data represented by the wrapped element.

getAbstractMLName

public String getAbstractMLName()
Returns:
the value of the attribute 'name' of the XML element corresponding to the multitlingual version of the abstract

getField

public org.jdom.Element getField(String name)
Parameters:
name -
Returns:
the JDOM element of the field element with this 'name' attribute value. (may be null)

getMLField

public org.jdom.Element getMLField(org.jdom.Element field)
Parameters:
field - the element corresponding to a field in the main language of the data
Returns:
the JDOM element of the multilingual values correponding to this element. may be null.

getPdate

public Date getPdate()
Returns:
if set, the Pdate of the data, as a Java object (it is parsed and decoded).

getCdate

public Date getCdate()
Returns:
if set, the Cdate of the data, as a Java object (it is parsed and decoded).

getMdate

public Date getMdate()
Returns:
if set, the Mdate of the data, as a Java object (it is parsed and decoded).

getElement

public org.jdom.Element getElement()
Returns:
the main JDOM element correponding to the JCMS data.

getRelateds

public Relateds getRelateds()
Gives a representation of this DataElement related parameters.

Returns:
Relateds object encapsulating relateds datas
Since:
JCMS-6.1

getDataElementList

public static List<DataElement> getDataElementList(JcmsResource resource,
                                                   ClientSession session)
For a resource in dataset form, gives a list of corresponding DataElement object.

Parameters:
resource -
session -
Returns:
a list of DataElement correponding to the data in the entity body of the response.
Since:
JCMS-6.1

getDataElementList

public static List<DataElement> getDataElementList(JcmsResource resource,
                                                   ClientSession session,
                                                   String dataSetTag)
For a resource in dataset form, gives a list of corresponding DataElement object.

Parameters:
resource -
session -
dataSetTag - specific enclosing tag name
Returns:
a list of DataElement correponding to the data in the entity body of the response.
Since:
JCMS-6.1

getFirstDataElement

public static DataElement getFirstDataElement(JcmsResource resource,
                                              ClientSession session)
For a single data in a resource, gives the corresponding DataElement object.

Parameters:
resource -
session -
Returns:
a DataElement correponding to the data in the entity body of the response.
Since:
JCMS-6.1


Copyright © 2001-2007 Jalios SA. All Rights Reserved.