Skip to content

Commit

Permalink
Update PHPDoc blocks to be more consistent and ubiquitous
Browse files Browse the repository at this point in the history
  • Loading branch information
grantbacon committed May 27, 2014
1 parent 636cad1 commit 017f081
Show file tree
Hide file tree
Showing 63 changed files with 832 additions and 385 deletions.
16 changes: 16 additions & 0 deletions src/Jaspersoft/Client/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@

define("BASE_REST2_URL", "/rest_v2");

/**
* Class Client
*
* Defines the JasperReports server information, and provides services to be used for various tasks.
*
* @package Jaspersoft\Client
*/
class Client
{
private $restReq;
Expand Down Expand Up @@ -152,7 +159,16 @@ public function serverInfo()
return json_decode($data, true);
}

/**
* Provides the constructed RESTv2 URL for the defined JasperReports Server
* @return string
*/
public function getURL() { return $this->restUrl2; }

/**
* Provides the RESTRequest object to be reused by the services that require it
* @return RESTRequest
*/
public function getService() { return $this->restReq; }

}
19 changes: 4 additions & 15 deletions src/Jaspersoft/Dto/Attribute/Attribute.php
Original file line number Diff line number Diff line change
@@ -1,31 +1,20 @@
<?php
namespace Jaspersoft\Dto\Attribute;

/** Jasper\Attribute class
* this class represents Attributes from the JasperServer and contains data that is
* accessible via the user service in the REST API.
/**
* Represents a user attribute
*
* author: gbacon
* date: 06/13/2012
* @package Jaspersoft\Dto\Attribute
*/
class Attribute {

public $name;
public $value;

/**
* Constructor
*
* To use this function provide an array in the format array('attributeName' => 'attributeValue').
* @param string $name - name of attribute
* @param string $value - value of attribute
*/
public function __construct($name, $value)
{
$this->name = $name;
$this->value = $value;
}

}

?>
}
34 changes: 33 additions & 1 deletion src/Jaspersoft/Dto/ImportExport/ExportTask.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,44 @@
<?php
namespace Jaspersoft\Dto\ImportExport;

/**
* Class ExportTask
* Define an export task to be executed
*
* @package Jaspersoft\Dto\ImportExport
*/
class ExportTask
{

/**
* Usernames to be exported
*
* @var array
*/
public $users = array();
/**
* Uris of resources to be exported
*
* @var array
*/
public $uris = array();
/**
* List of role names to be exported
*
* @var array
*/
public $roles = array();
/**
* Parameters for defining type of exports
*
* Possible values:
* 'everything' - Export everything except audit data: all repository resources, permissinos, report jobs, users and roles
* 'repository-permissions' - Repository permissions along with each exported folder and resource, should be used only in conjunction with uris
* 'role-users' - Each role export triggers the export of all users belonging to a role, should only be used in conjunction with roles
* 'include-access-events' - Access events (date, time, and user name of last modification) are exported.
* 'include-monitoring-events' - Includes monitoring events
*
* @var array
*/
public $parameters = array();

public function jsonSerialize()
Expand Down
24 changes: 24 additions & 0 deletions src/Jaspersoft/Dto/ImportExport/ImportTask.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,37 @@
<?php
namespace Jaspersoft\Dto\ImportExport;

/**
* Class ImportTask
* Define an import task to be executed
*
* @package Jaspersoft\Dto\ImportExport
*/
class ImportTask
{
/**
* @var boolean
*/
public $update;
/**
* @var boolean
*/
public $skipUserUpdate;
/**
* @var boolean
*/
public $includeAccessEvents;
/**
* @var boolean
*/
public $includeAuditEvents;
/**
* @var boolean
*/
public $includeMonitoringEvents;
/**
* @var boolean
*/
public $includeServerSettings;

public function queryData()
Expand Down
19 changes: 12 additions & 7 deletions src/Jaspersoft/Dto/ImportExport/TaskState.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
<?php


namespace Jaspersoft\Dto\ImportExport;


/**
* Class TaskState
* Describes the state of an import or export task that has been executed
*
* @package Jaspersoft\Dto\ImportExport
*/
class TaskState
{

/** The ID for the Task (read-only)
/**
* ID for the task (read-only)
*
* @var int
*/
public $id;

/** Current phase of the task (read-only)
* Possible Values:
/**
* Current phase of the task (read-only)
* 'inprogress' - The task is currently being executed
* 'finished' - The task has completed.
* 'failed' - The task has failed to complete
Expand All @@ -23,7 +27,8 @@ class TaskState
*/
public $phase;

/** A message returned by the server in regard to the task, especially useful in the event of failure.
/**
* A message returned by the server in regard to the task, especially useful in the event of failure.
*
* @var string
*/
Expand Down
35 changes: 23 additions & 12 deletions src/Jaspersoft/Dto/Job/Alert.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,28 @@

/**
* Class Alert
* Defines an Alert object used by Job
*
* @package Jaspersoft\Dto\Job
*/
class Alert
{

/** Read-only value of server-declared ID
/**
* Read-only value of server-declared ID
*
* @var int
*/
public $id;

/** Read-only value used for optimistic locking
/**
* Read-only value used for optimistic locking
*
* @var int
*/
public $version;

/** Specify who receives the alert
/**
* Specify who receives the alert
*
* Supported Values:
* "NONE", "OWNER", "ADMIN", "OWNER_AND_ADMIN"
Expand All @@ -31,13 +35,15 @@ class Alert
*/
public $recipient;

/** Array of email addresses
/**
* Array of email addresses
*
* @var array
*/
public $toAddresses;

/** Specify when the notification is sent
/**
* Specify when the notification is sent
*
* Supported Values:
* "NONE", "ALL", "FAIL_ONLY", "SUCCESS_ONLY"
Expand All @@ -48,29 +54,34 @@ class Alert
*/
public $jobState;

/** Email message body
/**
* Email message body
*
* @var string
*/
public $messageText;

/** Email message body on failure
/**
* Email message body on failure
* @var string
*/
public $messageTextWhenJobFails;

/** Email subject
/**
* Email subject
* @var string
*/
public $subject;

/** Should the stack trace be included in the alert?
/**
* Should the stack trace be included in the alert?
*
* @var boolean
*/
public $includingStackTrace;

/** Should the alert include report job info?
/**
* Should the alert include report job info?
*
* @var boolean
*/
Expand All @@ -95,7 +106,7 @@ public function jsonSerialize()
}

/** This function takes a \stdClass decoded by json_decode representing a scheduled job
* and casts it as a Alert Object
* and casts it as an Alert Object
*
* @param \stdClass $json_obj
* @return Alert
Expand Down
24 changes: 16 additions & 8 deletions src/Jaspersoft/Dto/Job/CalendarTrigger.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
class CalendarTrigger extends Trigger
{

/** Pattern that determines minute part of trigger fire times
/**
* Pattern that determines minute part of trigger fire times
*
* Pattern can consist of following tokens:
* + single minute value between 0 and 59 these can be separated by commas to create a set
Expand All @@ -17,7 +18,8 @@ class CalendarTrigger extends Trigger
*/
public $minutes;

/** Pattern that determines the hour portion of trigger firing
/**
* Pattern that determines the hour portion of trigger firing
*
* Pattern can consist of following tokens:
* + single hour value between 0 and 23 these can be separated by commas to create a set
Expand All @@ -31,7 +33,8 @@ class CalendarTrigger extends Trigger
*/
public $hours;

/** Pattern that determines the month portion of trigger firing
/**
* Pattern that determines the month portion of trigger firing
*
* This should be an array of zero-indexed month indices (e.g: 0 = January, 11 = December)
*
Expand All @@ -42,7 +45,8 @@ class CalendarTrigger extends Trigger
*/
public $months;

/** Type of days on which the trigger should fire
/**
* Type of days on which the trigger should fire
*
* Supported Values:
* "ALL", "WEEK", "MONTH"
Expand All @@ -51,7 +55,8 @@ class CalendarTrigger extends Trigger
*/
public $daysType;

/** The week days on which a trigger should fire. Use 1-indexed week days (e.g: 1 = Sunday, 7 = Saturday)
/**
* The week days on which a trigger should fire. Use 1-indexed week days (e.g: 1 = Sunday, 7 = Saturday)
*
* Example: array("1", "7")
* This would run a trigger on Sundays and Saturdays
Expand All @@ -60,7 +65,8 @@ class CalendarTrigger extends Trigger
*/
public $weekDays;

/** Pattern that describes the month days in which the trigger should fire.
/**
* Pattern that describes the month days in which the trigger should fire.
*
* Pattern can consist of following tokens:
* + single day value between 1 and 31 these can be separated by commas to create a set
Expand All @@ -83,7 +89,8 @@ public function __construct($minutes = null, $hours = null, $daysType = null, $w
$this->monthDays = $monthDays;
}

/** Overrides Trigger to provide proper JSON hierarchy as described by JRS
/**
* Overrides Trigger to provide proper JSON hierarchy as described by JRS
*
* @return array
*/
Expand All @@ -108,7 +115,8 @@ public function jsonSerialize()
return array($this->name() => $result);
}

/** This function takes a \stdClass decoded by json_decode representing a scheduled job
/**
* This function takes a \stdClass decoded by json_decode representing a scheduled job
* and casts it as a CalendarTrigger Object
*
* @param \stdClass $json_obj
Expand Down
Loading

0 comments on commit 017f081

Please sign in to comment.