com.objectplanet.survey.plugin.api
Class Folder

java.lang.Object
  extended by com.objectplanet.survey.plugin.api.Folder

public class Folder
extends java.lang.Object

ATTENTION: This class is a facade for the system business Folder. To improve performance you can force it to keep the reference to the business object by calling keepBusinessObject(). Keeping references to objects may cause inconsistencies in the system, so always remember to call releaseBusinessObject() as soon as you are finished using them.

Folder encapsulates folder data, sub-folders and surveys. The root folder has folder id -1 and can not be deleted.

Author:
Irina Brun
Created:
1. April 2003

Method Summary
 java.lang.String getDescription()
          Gets the description of the folder.
 long getFolderId()
          Gets the id of the folder.
 java.lang.String getName()
          Gets the name of the folder
 long getParentFolderId()
          Gets the id of the parent folder.
 int getSubFolderCount()
          Gets number of sub-folders in this folder.
 ListItem[] getSubFolders()
          Gets children, all folders in this group
 int getSurveyCount()
          Gets number of surveys in this folder.
 ListItem[] getSurveys()
          Gets all surveys in this group
 User getUser()
          Gets the user object
 boolean hasBusinessObject()
          Check if this question has reference to the business Survey object.
 void keepBusinessObject()
          Get and keep business object.
 void releaseBusinessObject()
          Release business object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDescription

public java.lang.String getDescription()
                                throws SurveySystemException
Gets the description of the folder.

Returns:
description Description of the folder.
Throws:
SurveySystemException - If an error occurs in the system

getFolderId

public long getFolderId()
Gets the id of the folder. Top folder has id -1.

Returns:
The id of the folder

getName

public java.lang.String getName()
                         throws SurveySystemException
Gets the name of the folder

Returns:
The name of the folder
Throws:
SurveySystemException - If an error occurs in the system

getParentFolderId

public long getParentFolderId()
                       throws SurveySystemException
Gets the id of the parent folder. If 0 - this is a top folder.

Returns:
The parentId value
Throws:
SurveySystemException - If an error occurs in the system

getSubFolderCount

public int getSubFolderCount()
                      throws SurveySystemException
Gets number of sub-folders in this folder.

Returns:
Sub-folder count
Throws:
SurveySystemException - If an error occurs in the system

getSubFolders

public ListItem[] getSubFolders()
                         throws SurveySystemException
Gets children, all folders in this group

Returns:
Children as ArrayList of ListItems
Throws:
SurveySystemException - If an error occurs in the system

getSurveyCount

public int getSurveyCount()
                   throws SurveySystemException
Gets number of surveys in this folder.

Returns:
Survey count
Throws:
SurveySystemException - If an error occurs in the system

getSurveys

public ListItem[] getSurveys()
                      throws SurveySystemException
Gets all surveys in this group

Returns:
Surveys as ArrayList of ListItems
Throws:
SurveySystemException - If an error occurs in the system

hasBusinessObject

public boolean hasBusinessObject()
Check if this question has reference to the business Survey object. See ATTENTION .

Returns:
True/false

keepBusinessObject

public void keepBusinessObject()
                        throws SurveySystemException
Get and keep business object. See ATTENTION .

Throws:
SurveySystemException - If an error occurs in the system.

releaseBusinessObject

public void releaseBusinessObject()
Release business object. See ATTENTION .


getUser

public User getUser()
Gets the user object

Returns:

Copyright ? ObjectPlanet Inc. All Rights Reserved.

Built on December 20 2016