Style Intelligence v12.0

inetsoft.sree
Class RepletEngine

java.lang.Object
  extended by inetsoft.uql.asset.AbstractAssetEngine
      extended by inetsoft.sree.RepletEngine
All Implemented Interfaces:
RepletRepository, AssetRepository, PropertyChangeListener, Remote, EventListener

public class RepletEngine
extends AbstractAssetEngine
implements RepletRepository, PropertyChangeListener

This is the implementation of the RepletRepository. It is the server side report engine for processing replets.


Nested Class Summary
protected static class RepletEngine.SessionKey
           
 
Nested classes/interfaces inherited from class inetsoft.uql.asset.AbstractAssetEngine
AbstractAssetEngine.ReportSheetDependencyFinder, AbstractAssetEngine.SheetTransformListener, AbstractAssetEngine.StorageChangeListener
 
Field Summary
protected  Hashtable activerep
           
protected  String cdir
           
protected  Set destroyrep
           
protected  Hashtable namemap
           
static String PARA_ARCHIVE
          The name for the ServiceRequest parameter.
static String PARA_LIVE
          The name for the ServiceRequest parameter.
static String PARA_PREGENERATED
          The name for the ServiceRequest parameter.
protected  Hashtable principalmap
           
protected  inetsoft.sree.RepletCache repcache
           
protected  Hashtable resmap
           
protected  Hashtable resmap2
           
protected  Hashtable sessionmap
           
protected  String snapdir
           
 
Fields inherited from class inetsoft.uql.asset.AbstractAssetEngine
admin, catalog, editing, istore, LOCAL, parent, scopes
 
Fields inherited from interface inetsoft.sree.RepletRepository
ADDTOQ_FAILURE, ADDTOQ_GENERATION, ADDTOQ_SUCCESS, AUTO_REPLET, DEFAULT_ARCHIVE, NO_ARCHIVE, NOT_CHECK_PERMISSION, PREGENERATE, PRINCIPAL_COOKIE, REPLET, REPLET_MASK, REPORT, VERSIONED_ARCHIVE, VIRTUAL_REPLET
 
Fields inherited from interface inetsoft.uql.asset.AssetRepository
ASSET_ERRORS, COMPONENT_SCOPE, GLOBAL_SCOPE, IGNORE_PERM, LOCAL_QUERY, QUERY_SCOPE, REPORT_SCOPE, REPORT_WORKSHEET, REPOSITORY_SCOPE, TEMPORARY_SCOPE, USER_SCOPE
 
Constructor Summary
RepletEngine()
          Create a default local replet engine.
RepletEngine(String id)
          Create a local replet engine.
RepletEngine(String id, String licenseKey)
          Create a local replet engine and evaluate against a given license key.
 
Method Summary
protected  void accessReplet(Replet replet)
          Access replet.
 void addFolder(AssetEntry entry, Principal user)
          Add one folder.
 void addFolder(RepositoryEntry entry, String name, String alias, String description, Principal user)
          Add folder of a repository entry.
 int addToQueue(Object repletId, String replet, Principal user)
          Add a replet to queue when loading.
 Principal authenticate(ClientInfo user, Object credential)
          Checks the authentication of specific entity.
 void cancel(Object repletId)
          Cancel a replet execution.
 void changeFolder(AssetEntry oentry, AssetEntry nentry, Principal user, boolean force)
          Change one folder.
 void changeFolder(RepositoryEntry entry, String folder, Principal user)
          Change folder of a repository entry.
protected  void changeFolder0(AssetEntry oentry, inetsoft.util.IndexedStorage ostorage, AssetEntry nentry, inetsoft.util.IndexedStorage nstorage, boolean root)
          Change one folder internally.
 void changePassword(Principal principal, String passwd)
          Change the user password.
 void changeSheet(AssetEntry oentry, AssetEntry nentry, Principal user, boolean force)
          Change one sheet.
protected  void changeSheet0(AssetEntry oentry, inetsoft.util.IndexedStorage ostorage, AssetEntry nentry, inetsoft.util.IndexedStorage nstorage)
          Change one sheet internally.
protected  void checkAccess(Principal principal)
          Check if the access matches license.
protected  boolean checkDataSourceFolderPermission(String folder, Principal user)
          Check the datasource folder permission.
protected  boolean checkDataSourcePermission(String dname, Principal user)
          Check the datasource permission.
 void checkFolderRemoveable(AssetEntry entry, Principal user)
          Check if folder is removeable.
 boolean checkPermission(Principal principal, String resource, char acc)
          Check the permission to access a resource.
 boolean checkPermission(Principal principal, String prefix, String resource, String permission)
          Check permission.
protected  boolean checkQueryFolderPermission(String folder, String source, Principal user)
          Check the query folder permission.
protected  boolean checkQueryPermission(String query, Principal user)
          Check the query permission.
 boolean containsFolder(Principal principal, String permission)
          Check if a user could access folders.
 boolean containsParameterSheet(Object repletId)
          Check if the replet contains parameter sheets.
protected  AbstractAssetEngine.ReportSheetDependencyFinder createFinder()
          Create finder.
 Object createReplet(Object name, Principal principal, int type)
          Create an instance of the specified replet.
 Image createThumbnail(String name, String version, Principal user)
          Creates a thumbnail image for a report.
 void deployReport(inetsoft.sree.adm.web.manager.DeployInfo info, byte[] data, boolean overwrite)
          Deploys a report into the repository.
protected  void destroy(Object id)
          Destroy a replet.
 void destroy(Object repletId, int type)
          Destroy a replet instance.
 void disableParameterSheet(Object repletId)
          Disable parameter sheets contained in the replet, and all the parameter sheets will be ignored when process replet.
 Object export(Object repletId, int format)
          Export a replet to the specified format.
protected  void finalize()
          Remove all the cached files used by this RepletEngine when it is garbage collected.
 PageLocation find(Object id, SearchCondition cond, PageLocation next)
          Search the report to find the condition defined in the search condition.
protected  void fireEvent(int entryType, int changeType, AssetEntry assetEntry, String oldName)
          Notify all registered listeners that an asset entry has been modified.
 void generateReplet(Object repletId, RepletRequest request)
          Generate a report from the specified replet instance.
 Object[] getActiveReplets(String user)
          Get active replet ids.
 ReportSheet getAnalyticReport(Object repletId)
          Get report which can be analyzed.
 int getArchiveOption()
          Get the archive support option.
 Object[] getArchiveReplets(Principal user)
          Get archive replets by principal.
 Object getArchiveReport(String path, String version, Principal principal)
          Open an archived report.
 int getCount(String type)
          Get the count of report of the specified type.
protected  File getDependencyFile()
          Get the dependency file stores dependencies from the report sheets to the worksheets.
protected  String getDependencyFileName()
          Get the dependency file stores dependencies from the report sheets to the sheets.
 AssetEntry[] getEntries(AssetEntry entry, Principal user, String permission, int selector)
          Get the sub entries of a folder.
 String getEntryIdentifier(AssetEntry entry)
          tomzhang bug1318530017384 Create a new identifier for local worksheet to avoid allmap key conflict
 EventHandler getEventHandler(Object id)
          Get the client-side commands of a replet.
 int getEventMask(Object id)
          Return the bitwise OR of the event masks for all events that this replet is able to receive.
 int getExecutingCount()
          Get the number of all executing report during a sample period.
 RepositoryEntry[] getFolders(Principal principal, String permission)
          Get the list of all folders.
 int getGeneratedPageCount()
          Get the generated page count.
 HeadingTarget[] getHeadingTargets(Object repletId)
          Get the targets pointing to heading elements.
 XQueryRepository getLocalQueryRepository(String rid)
          Get the local query repository.
protected  String getNextID(String name, inetsoft.sree.internal.RuntimeReplet replet)
          Find the next unique ID.
protected  XTypeNode getOutputType(String qname, XQueryRepository rep, boolean local, Principal user)
          Get query output type.
 StylePage getPage(Object id, int n)
          Get the specified page.
 int getPageCount(Object id)
          Get the number of pages in the report generated by the replet.
 int getPageCount(Object id, int max)
          Get the really number of pages in the report generated by the replet.
 PageLocation getPageLocation(Object repletId, String elementId, Point item)
          Get the location of a specific element in a report.
 String[] getPrinters()
          Get a list of printers on the server.
 Vector getPrintPages(Object repletId, int[] printPages, int fmt)
          Get the corresponding pages of specified replet for print.
 int getProcessStatus(Object id)
          Get the process status of a report.
 String getProperty(String propname)
          Get the specified property.
 inetsoft.sree.internal.QueuedRepletInfo[] getQueuedReplets(Principal user)
          Get replets information in the report queue.
protected  inetsoft.uql.util.XQuotaManager getQuotaManager()
          Get the quota manager.
 SelectionEvent[] getRegisteredSelections(Object id)
          Get the registered selection events.
protected  RepletRegistry getRegistry(String name, Principal principal)
          Get replet registry.
 RepletContext getRepletContext(Object repletId)
          Get contextual information about a specfic replet.
protected  RepletContext getRepletContext(Object repletId, boolean activeInfo)
          Get contextual information about a specfic replet.
 String getRepletName(Object id)
          Get the specified replet name.
 RepletParameters getRepletParameters(Object id, String reqname)
          Get the replet parameters.
 RepositoryEntry[] getReplets(Principal principal, String permission)
          Get a flattened list of all replets.
 ReportSheet getReport(Object repletId, boolean print)
          Get report from replet engine..
protected  ReportArchive getReportArchive(String name, Principal principal)
          Get report archive.
 inetsoft.sree.adm.web.monitor.ReportInfo[] getReportInfo(String type)
          Get the report infos of specified type.
protected  ReportManager getReportManager(String user)
          Get the report manager.
 String getReportProperty(Object rid, Object key)
          Get report property.
 Size getReportSize(String name, String version, Principal user)
          Gets the size of a report.
 RepositoryEntry[] getRepositoryEntries(String folder, Principal user, String permission, int selector)
          Get available repository entries.
 long getResourceLength(Object rid)
          Get the resource size.
 ActionListener getScheduleActionListener(Object rid)
          Get a listener to runtime replet.
 ScheduleTask getScheduleTask(String taskName)
          Get the schedule task.
 String[] getScheduleTasks(Principal principal)
          Get the scheduled tasks.
protected  SecurityEngine getSecurity()
          Get security engine.
 AbstractSheet getSheet(AssetEntry entry, Principal user, boolean permission, AssetContent ctype)
          Get one sheet.
 Enumeration getSingleStylePage(Object repletId)
          Get a single style page of the specified replet.
 inetsoft.util.IndexedStorage getStorage(AssetEntry entry)
          Get the indexed storage of an asset entry.
 RepletCommand handleEvent(Object id, EventObject e)
          Handle a viewer event.
 void importAssets(byte[] data, boolean replace)
          Import assets assets into the repository.
 void importAssets(byte[] data, boolean replace, inetsoft.util.audit.ActionRecord actionRecord)
          Import assets assets into the repository.
 void importAssets(String filePath, boolean overwriting, List order, HashMap names, inetsoft.sree.adm.PartialDeploymentJarInfo info, boolean desktop, Principal principal, List ignoreList)
          Imports assets into the repository.
 void importAssets(String filePath, boolean overwriting, List order, HashMap names, inetsoft.sree.adm.PartialDeploymentJarInfo info, boolean desktop, Principal principal, List ignoreList, inetsoft.util.audit.ActionRecord actionRecord)
          Imports assets into the repository.
 void init()
          Initialize the engine.
 boolean isArchiveChange(String folder, Principal user, HashMap timestamps)
           
protected  boolean isEntryAvailable(AssetEntry entry)
          Test if an entry is available.
 boolean isFolderChanged(String folder, Principal user)
          Check if repository.xml file change.
 boolean isLogExport()
          Check if should log export.
 boolean isParameterSheet(Object repletId)
          Check if current report sheet is a parameter sheet.
protected  boolean isPregenerated(Object id)
          Check if a replet is pregenerated.
 void logout(Principal principal)
          Logout of the system.
 void mailTo(Object repletId, String recipients, String from, String subject, String msg, String fmt)
          Send a replet via email.
 void mailTo(Object repletId, String recipients, String ccAddress, String bccAddress, String from, String subject, String msg, String fmt)
          Send a replet via email which includes "CC" and "BCC" addresses.
 void mailTo(Object repletId, String recipients, String ccAddress, String bccAddress, String from, String subject, String msg, String fmt, boolean compress)
          Send a replet via email which includes "CC" and "BCC" addresses.
 void mailTo(Object repletId, String recipients, String ccAddress, String bccAddress, String from, String subject, String msg, String fmt, boolean compress, String attachmentName)
          Send a replet via email which includes "CC" and "BCC" addresses.
 void mailTo(Object repletId, String recipients, String ccAddress, String bccAddress, String from, String subject, String msg, String fmt, boolean compress, String attachmentName, String password)
          Send a replet via email which includes "CC" and "BCC" addresses.
 void mailTo(Object repletId, String recipients, String ccAddress, String bccAddress, String from, String subject, String msg, String fmt, boolean compress, String attachmentName, String password, boolean htmlContent)
          Send a replet via email which includes "CC" and "BCC" addresses.
static void main(String[] args)
          Main entrance.
 byte[] nextBlock(Object rid)
          Get the next block of data.
 void print()
          Print the current status.
 void print(Object id, String printer, int[] pageList)
          Print the specified report on the server.
 void propertyChange(PropertyChangeEvent evt)
          Property change event.
 void recordPageCount(Object id)
          Record page count of a replet.
 void removeFolder(AssetEntry entry, Principal user, boolean force)
          Remove one folder.
protected  void removeFolder0(AssetEntry entry, inetsoft.util.IndexedStorage storage)
          Remove one folder internally.
 boolean removeFromQueue(Object repletId, Principal user)
          Remove a queued replet from queue.
 void removeRepositoryEntry(RepositoryEntry entry, Principal user)
          Remove a repostory entry.
 void removeScheduleTask(Principal principal, String taskName)
          Delete the task from the schedule file.
protected  void removeSheet0(AssetEntry entry, inetsoft.util.IndexedStorage storage)
          Remove one sheet internally.
 void removeUser(String name)
          Remove a user.
 void renameRepositoryEntry(RepositoryEntry entry, String nname, Principal user)
          Rename a repository entry.
 void renameUser(String oname, String nname)
          Rename a user.
 void resetGeneratedPageCount()
          Reset the generated page count.
 void resetReplet(Object repletId)
          Reset replet to initial state.
 void saveInArchive(Object id, String path, int fmt, Permission perm, ArchiveRule rule, String comment)
          Save a report in the report archive.
 void setActionListener(Object rid, ActionListener l)
          Set a listener to runtime replet.
 void setLogExport(boolean log)
          Set whether should log export.
 void setPermission(Principal principal, String resource, Permission permission)
          Set a user's permission of a specific access to a resource.
 void setScheduleActionListener(Object rid, ActionListener l)
          Set a listener to runtime replet.
 void setScheduleTask(Principal principal, String taskName, ScheduleTask task)
          Save a schedule task.
 void setSheet(AssetEntry entry, AbstractSheet ws, Principal user, boolean force)
          Set one sheet.
 void waitForReplet(Object id)
          Wait until the generation of replet is done.
 
Methods inherited from class inetsoft.uql.asset.AbstractAssetEngine
addAssetChangeListener, addr, allowsFolderScopeChange, allowsSheetScopeChange, checkAssetPermission, checkDependencyValidity, clearCache, clearVSBookmark, closeStorages, containsEntry, createPhysicalEntry, dispose, getAssetPrefix, getDependencyFileKey, getDesignView, getEntries, getParent, getParentFolder, getQueryEntries, getReportSheetDependencies, getReportStorage, getSession, getSheetDependencies, getStorage, getStorages, getVSBookmark, getWorksheetEntries, initFinder, removeAssetChangeListener, removeSheet, setParent, setSheet, setVSBookmark, supportsScope
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARA_PREGENERATED

public static final String PARA_PREGENERATED
The name for the ServiceRequest parameter. This parameter is only available if the replet is running in pregenerated mode.

See Also:
Constant Field Values

PARA_LIVE

public static final String PARA_LIVE
The name for the ServiceRequest parameter. This parameter is only available if the replet is running in live mode.

See Also:
Constant Field Values

PARA_ARCHIVE

public static final String PARA_ARCHIVE
The name for the ServiceRequest parameter. This parameter is only available if the replet is running in archive mode.

See Also:
Constant Field Values

destroyrep

protected final Set destroyrep

activerep

protected Hashtable activerep

namemap

protected Hashtable namemap

principalmap

protected Hashtable principalmap

resmap

protected Hashtable resmap

resmap2

protected Hashtable resmap2

sessionmap

protected Hashtable sessionmap

cdir

protected String cdir

snapdir

protected String snapdir

repcache

protected inetsoft.sree.RepletCache repcache
Constructor Detail

RepletEngine

public RepletEngine()
Create a default local replet engine.


RepletEngine

public RepletEngine(String id)
Create a local replet engine.

Parameters:
id - the unique engine ID.

RepletEngine

public RepletEngine(String id,
                    String licenseKey)
Create a local replet engine and evaluate against a given license key.

Parameters:
id - the unique engine id
licenseKey - the license key for the slave
Method Detail

main

public static void main(String[] args)
Main entrance.


getFolders

public RepositoryEntry[] getFolders(Principal principal,
                                    String permission)
                             throws RemoteException
Get the list of all folders.

Specified by:
getFolders in interface RepletRepository
Parameters:
principal - a Principal object identifying the user that is requesting the folder list.
permission - the permissions the user must have on a folder in order for it to be returned. Should be a combination of 'r', 'w', and 'd', which stand for read, write, and delete respectively. If this parameter is null, all folders that the user has any permission on are returned.
Returns:
a list of RepositoryEntry objects that represent the folders that are registered.
Throws:
RemoteException - if an error occurs while getting the folder list.

containsFolder

public boolean containsFolder(Principal principal,
                              String permission)
                       throws RemoteException
Check if a user could access folders.

Specified by:
containsFolder in interface RepletRepository
Throws:
RemoteException

getReplets

public RepositoryEntry[] getReplets(Principal principal,
                                    String permission)
Get a flattened list of all replets.

Specified by:
getReplets in interface RepletRepository
Parameters:
principal - a Principal object identifying the user that is requesting the replet list.
permission - the permissions the user must have on a replet in order for it to be returned. Should be a combination of 'r', 'w', and 'd', which stand for read, write, and delete respectively. If this parameter is null, all replets that the user has any permission on are returned.
Returns:
a list of RepositoryEntry objects that represent the replets that are registered.

getArchiveOption

public int getArchiveOption()
Get the archive support option.

Specified by:
getArchiveOption in interface RepletRepository
Returns:
archive support option, one of NO_ARCHIVE, DEFAULT_ARCHIVE, and VERSIONED_ARCHIVE.

getArchiveReport

public Object getArchiveReport(String path,
                               String version,
                               Principal principal)
                        throws RepletException
Open an archived report. This will either create a replet or open a file, the type of which (PDF, RTF, etc.) is determined by the file type stored in the archive.

Specified by:
getArchiveReport in interface RepletRepository
Parameters:
path - the path to the archived report.
version - the version number of the report to retrieve. If the archive does not support versioning, this parameter is ignored and may be null.
principal - a Principal object identifying the user that is requesting the report.
Returns:
an export resource ID, prepended to a file extension, e.g. 389283.pdf.
Throws:
RepletException - if the resource could not be created.

saveInArchive

public void saveInArchive(Object id,
                          String path,
                          int fmt,
                          Permission perm,
                          ArchiveRule rule,
                          String comment)
                   throws RepletException
Save a report in the report archive.

Specified by:
saveInArchive in interface RepletRepository
Parameters:
id - replet ID.
path - path in the report archive.
fmt - report saving format. One of the format options defined in this class or inetsoft.report.io.Builder.
perm - report permission. If it's null, the report will inherit the folder permission.
rule - report archive rule. If it's null, the report will inherit the folder archive rule.
comment - comment string for this version.
Throws:
RepletException - if the report could not be saved.

getRepletContext

public RepletContext getRepletContext(Object repletId)
Get contextual information about a specfic replet.

Specified by:
getRepletContext in interface RepletRepository
Parameters:
repletId - the replet instance ID.
Returns:
the requested RepletContext object.

getRepletContext

protected RepletContext getRepletContext(Object repletId,
                                         boolean activeInfo)
Get contextual information about a specfic replet.

Parameters:
repletId - the replet instance ID.
activeInfo - true if contains active info, false otherwise.
Returns:
the requested RepletContext object.

getReportArchive

protected ReportArchive getReportArchive(String name,
                                         Principal principal)
Get report archive.

Parameters:
name - the specified folder or archive name.
principal - the specified user.
Returns:
report arcive contains the specified folder or archive name, null unavailable.

getRegistry

protected RepletRegistry getRegistry(String name,
                                     Principal principal)
                              throws Exception
Get replet registry.

Parameters:
name - the specified folder or replet name.
principal - the specified user.
Returns:
replet registry contains the specified folder or replet name.
Throws:
Exception

getSecurity

protected SecurityEngine getSecurity()
Get security engine.

Returns:
security engine if any, null otherwise.

createReplet

public Object createReplet(Object name,
                           Principal principal,
                           int type)
                    throws SRSecurityException,
                           RepletException
Create an instance of the specified replet.

Specified by:
createReplet in interface RepletRepository
Parameters:
name - the name of the replet to create.
principal - a Principal object identifying the user requesting that the replet be created.
type - the type of replet being created.
Returns:
the replet instance ID.
Throws:
SRSecurityException - if the user does not have permission to view the report.
RepletException - if the replet could not be created.

getEventMask

public int getEventMask(Object id)
Return the bitwise OR of the event masks for all events that this replet is able to receive.

Specified by:
getEventMask in interface RepletRepository
Parameters:
id - replet ID.
Returns:
event mask.

getRepletParameters

public RepletParameters getRepletParameters(Object id,
                                            String reqname)
Get the replet parameters. This is used by the viewer to prompt for parameter values.

Specified by:
getRepletParameters in interface RepletRepository
Parameters:
id - replet ID.
reqname - request name.
Returns:
replet parameters.

generateReplet

public void generateReplet(Object repletId,
                           RepletRequest request)
                    throws RepletException
Generate a report from the specified replet instance. The createReplet method must be called before calling this method.

Specified by:
generateReplet in interface RepletRepository
Parameters:
repletId - the replet instance ID returned from createReplet.
request - a RepletRequest object containing the report parameters. If this argument is null, the report is generated using the last request.
Throws:
RepletException - if an error occurs that prevents the report from being generated.

getReportProperty

public String getReportProperty(Object rid,
                                Object key)
                         throws RemoteException
Get report property.

Specified by:
getReportProperty in interface RepletRepository
Throws:
RemoteException

accessReplet

protected void accessReplet(Replet replet)
Access replet.


isPregenerated

protected boolean isPregenerated(Object id)
                          throws RemoteException
Check if a replet is pregenerated.

Parameters:
id - the specified replet id.
Returns:
true if and only if the replet is a pregenerated replet and the srp file exists.
Throws:
RemoteException

getEventHandler

public EventHandler getEventHandler(Object id)
Get the client-side commands of a replet. The client-side commands are handled entirely on the client-side without any server involvement.

Specified by:
getEventHandler in interface RepletRepository
Parameters:
id - the replet instance ID.
Returns:
client-side commands.

getProcessStatus

public int getProcessStatus(Object id)
Get the process status of a report.

Specified by:
getProcessStatus in interface RepletRepository
Parameters:
id - the specified report id.

handleEvent

public RepletCommand handleEvent(Object id,
                                 EventObject e)
Handle a viewer event. The replet can return a command to be executed when certain event happens.

Specified by:
handleEvent in interface RepletRepository
Parameters:
id - replet ID.
e - event, one of the events defined in inetsoft.sree.event package.
Returns:
replet command.

getRegisteredSelections

public SelectionEvent[] getRegisteredSelections(Object id)
Get the registered selection events.

Specified by:
getRegisteredSelections in interface RepletRepository
Parameters:
id - replet ID.
Returns:
the registered selection events.

getPage

public StylePage getPage(Object id,
                         int n)
Get the specified page. If the page is not yet generated, this method waits until the page is generated.

Specified by:
getPage in interface RepletRepository
Parameters:
id - replet ID.
n - page index, starting from 0.
Returns:
page object, or null if the page does not exist.

getPageCount

public int getPageCount(Object id)
Get the number of pages in the report generated by the replet.

Specified by:
getPageCount in interface RepletRepository
Parameters:
id - replet ID.
Returns:
number of pages. Return a negative number of the available pages if the report is not finished processing.

getPageCount

public int getPageCount(Object id,
                        int max)
Get the really number of pages in the report generated by the replet.

Parameters:
max - the max loop times to get a valid page count.
Returns:
number of pages. Return a negative number of the available pages if the report is not finished processing.

find

public PageLocation find(Object id,
                         SearchCondition cond,
                         PageLocation next)
Search the report to find the condition defined in the search condition.

Specified by:
find in interface RepletRepository
Parameters:
id - replet ID.
cond - search condition.
next - starting search from the next element of the location pointed to by PageLocation. Search from beginning if next is null.
Returns:
the search result information or null if not found.

getHeadingTargets

public HeadingTarget[] getHeadingTargets(Object repletId)
Get the targets pointing to heading elements. These are used to construct a table of contents.

Specified by:
getHeadingTargets in interface RepletRepository
Parameters:
repletId - the replet instance ID.
Returns:
a list of all the heading targets in the specified replet. Returns null if the replet has not been completely generated.

getPageLocation

public PageLocation getPageLocation(Object repletId,
                                    String elementId,
                                    Point item)
Get the location of a specific element in a report.

Specified by:
getPageLocation in interface RepletRepository
Parameters:
repletId - the replet instance ID.
elementId - the unique ID of the report element.
item - the coordinates of the table cell, or null if the element is not a table.

mailTo

public void mailTo(Object repletId,
                   String recipients,
                   String from,
                   String subject,
                   String msg,
                   String fmt)
            throws RepletException
Send a replet via email.

Parameters:
repletId - the instance ID of the replet to send.
recipients - the email address(es) of the recipients of the email message.
from - the from text of the email header.
subject - the subject line of the email message.
msg - the body text of the email message.
fmt - the file format in which to send the report. Allowed values are the file format constants defined in inetsoft.report.io.Builder and "PDF". ("PDF", "RTF", "XLS", "EXCEL_SHEET", "TEMPLATE", "REPORT", "CSV", "RTF_LAYOUT", "HTML", "HTML_BUNDLE", "SVG").
Throws:
RepletException - if an error occurs while generating or sending the report.

mailTo

public void mailTo(Object repletId,
                   String recipients,
                   String ccAddress,
                   String bccAddress,
                   String from,
                   String subject,
                   String msg,
                   String fmt)
            throws RepletException
Send a replet via email which includes "CC" and "BCC" addresses.

Specified by:
mailTo in interface RepletRepository
Parameters:
repletId - the instance ID of the replet to send.
recipients - the email address(es) of the recipients of the email message.
ccAddress - the "CC" email address(es) of the recipients.
bccAddress - the "BCC" email address(es) of the recipients.
from - the from text of the email header.
subject - the subject line of the email message.
msg - the body text of the email message.
fmt - the file format in which to send the report. Allowed values are the file format constants defined in inetsoft.report.io.Builder and "PDF". ("PDF", "RTF", "XLS", "EXCEL_SHEET", "TEMPLATE", "REPORT", "CSV", "RTF_LAYOUT", "HTML", "HTML_BUNDLE", "SVG").
Throws:
RepletException - if an error occurs while generating or sending the report.

mailTo

public void mailTo(Object repletId,
                   String recipients,
                   String ccAddress,
                   String bccAddress,
                   String from,
                   String subject,
                   String msg,
                   String fmt,
                   boolean compress)
            throws RepletException
Send a replet via email which includes "CC" and "BCC" addresses.

Specified by:
mailTo in interface RepletRepository
Parameters:
repletId - the instance ID of the replet to send.
recipients - the email address(es) of the recipients of the email message.
ccAddress - the "CC" email address(es) of the recipients.
bccAddress - the "BCC" email address(es) of the recipients.
from - the from text of the email header.
subject - the subject line of the email message.
msg - the body text of the email message.
fmt - the file format in which to send the report. Allowed values are the file format constants defined in inetsoft.report.io.Builder and "PDF". ("PDF", "RTF", "XLS", "EXCEL_SHEET", "TEMPLATE", "REPORT", "CSV", "RTF_LAYOUT", "HTML", "HTML_BUNDLE", "SVG").
compress - flag indicating whether or not the exported file is to be compressed.
Throws:
RepletException - if an error occurs while generating or sending the report.

mailTo

public void mailTo(Object repletId,
                   String recipients,
                   String ccAddress,
                   String bccAddress,
                   String from,
                   String subject,
                   String msg,
                   String fmt,
                   boolean compress,
                   String attachmentName)
            throws RepletException
Send a replet via email which includes "CC" and "BCC" addresses.

Specified by:
mailTo in interface RepletRepository
Parameters:
repletId - the instance ID of the replet to send.
recipients - the email address(es) of the recipients of the email message.
ccAddress - the "CC" email address(es) of the recipients.
bccAddress - the "BCC" email address(es) of the recipients.
from - the from text of the email header.
subject - the subject line of the email message.
msg - the body text of the email message.
fmt - the file format in which to send the report. Allowed values are the file format constants defined in inetsoft.report.io.Builder and "PDF". ("PDF", "RTF", "XLS", "EXCEL_SHEET", "TEMPLATE", "REPORT", "CSV", "RTF_LAYOUT", "HTML", "HTML_BUNDLE", "SVG").
compress - flag indicating whether or not the exported file is to be compressed.
attachmentName - the name of email's attachment.
Throws:
RepletException - if an error occurs while generating or sending the report.

mailTo

public void mailTo(Object repletId,
                   String recipients,
                   String ccAddress,
                   String bccAddress,
                   String from,
                   String subject,
                   String msg,
                   String fmt,
                   boolean compress,
                   String attachmentName,
                   String password)
            throws RepletException
Send a replet via email which includes "CC" and "BCC" addresses.

Specified by:
mailTo in interface RepletRepository
Parameters:
repletId - the instance ID of the replet to send.
recipients - the email address(es) of the recipients of the email message.
ccAddress - the "CC" email address(es) of the recipients.
bccAddress - the "BCC" email address(es) of the recipients.
from - the from text of the email header.
subject - the subject line of the email message.
msg - the body text of the email message.
fmt - the file format in which to send the report. Allowed values are the file format constants defined in inetsoft.report.io.Builder and "PDF".
compress - flag indicating whether or not the exported
attachmentName - the email attachment's name. file is to be compressed.
Throws:
RepletException - if an error occurs while generating or sending the report.

mailTo

public void mailTo(Object repletId,
                   String recipients,
                   String ccAddress,
                   String bccAddress,
                   String from,
                   String subject,
                   String msg,
                   String fmt,
                   boolean compress,
                   String attachmentName,
                   String password,
                   boolean htmlContent)
            throws RepletException
Send a replet via email which includes "CC" and "BCC" addresses.

Specified by:
mailTo in interface RepletRepository
Parameters:
repletId - the instance ID of the replet to send.
recipients - the email address(es) of the recipients of the email message.
ccAddress - the "CC" email address(es) of the recipients.
bccAddress - the "BCC" email address(es) of the recipients.
from - the from text of the email header.
subject - the subject line of the email message.
msg - the body text of the email message.
fmt - the file format in which to send the report. Allowed values are the file format constants defined in inetsoft.report.io.Builder and "PDF". ("PDF", "RTF", "XLS", "EXCEL_SHEET", "TEMPLATE", "REPORT", "CSV", "RTF_LAYOUT", "HTML", "HTML_BUNDLE", "SVG").
compress - flag indicating whether or not the exported file is to be compressed.
attachmentName - the name of email's attachment.
Throws:
RepletException - if an error occurs while generating or sending the report.

export

public Object export(Object repletId,
                     int format)
              throws RepletException
Export a replet to the specified format. The exported file is cached internally. The cached file can be retrieved by calling the nextBlock method with the returned resource ID.

Specified by:
export in interface RepletRepository
Parameters:
repletId - the instance ID of the replet to export.
format - the file format in which to export the replet. This must be one of the file format constants defined in inetsoft.report.io.Builder.
Returns:
the resource ID of the exported file.
Throws:
RepletException - if the replet could not be exported.
RemoteException - if an unspecified error occurs.

getResourceLength

public long getResourceLength(Object rid)
                       throws RepletException
Get the resource size. The resource ID is returned from export().

Specified by:
getResourceLength in interface RepletRepository
Parameters:
rid - resource ID
Returns:
the size of the resource.
Throws:
RepletException - if the specified resource does not exist.

nextBlock

public byte[] nextBlock(Object rid)
                 throws RepletException
Get the next block of data. If no more data is available it returns null.

Specified by:
nextBlock in interface RepletRepository
Parameters:
rid - resource ID.
Returns:
data block.
Throws:
RepletException - if the specified resource does not exist.

getPrinters

public String[] getPrinters()
Get a list of printers on the server.

Specified by:
getPrinters in interface RepletRepository
Returns:
list of printer names on the server.

print

public void print(Object id,
                  String printer,
                  int[] pageList)
           throws RepletException
Print the specified report on the server.

Specified by:
print in interface RepletRepository
Parameters:
id - replet id.
printer - server printer name.
pageList - array of page numbers to print
Throws:
RepletException - if the replet could not be printed.

destroy

public void destroy(Object repletId,
                    int type)
Destroy a replet instance. If the specified replet is in the process of generating pages, it is interrupted.

Specified by:
destroy in interface RepletRepository
Parameters:
repletId - the replet instance ID.
type - the creation type of the replet to destroy.

destroy

protected void destroy(Object id)
Destroy a replet. If a replet is in the middle of generating pages, the process is interrupted.

Parameters:
id - replet ID.

cancel

public void cancel(Object repletId)
            throws RemoteException
Cancel a replet execution.

Specified by:
cancel in interface RepletRepository
Parameters:
repletId - the replet instance ID.
Throws:
RemoteException - if an error occurs while destroying the replet.

print

public void print()
Print the current status.


init

public void init()
Initialize the engine. This method must be called once before the engine is used.


getNextID

protected String getNextID(String name,
                           inetsoft.sree.internal.RuntimeReplet replet)
Find the next unique ID.


waitForReplet

public void waitForReplet(Object id)
Wait until the generation of replet is done.


getScheduleTasks

public String[] getScheduleTasks(Principal principal)
                          throws IOException
Get the scheduled tasks. If the user does not have permission to schedule tasks, this method should throw an IOException with an appropriate message. To get the task, the user must have "read", "write", and "delete" permission.

Specified by:
getScheduleTasks in interface RepletRepository
Parameters:
principal - represents an entity
Returns:
a list of task names for an user
Throws:
IOException - if the user does not have permission to schedule tasks or a general I/O error occurs.
RemoteException - if an error occurs.

getScheduleTask

public ScheduleTask getScheduleTask(String taskName)
Get the schedule task.

Specified by:
getScheduleTask in interface RepletRepository
Parameters:
taskName - the name of the schedule task.
Returns:
a ScheduleTask object of the named task, it may be null.

setScheduleTask

public void setScheduleTask(Principal principal,
                            String taskName,
                            ScheduleTask task)
                     throws Exception
Save a schedule task.

Specified by:
setScheduleTask in interface RepletRepository
Parameters:
principal - represents an entity.
taskName - the name used for retrieving the original task object. It may be different from the name in the task object if the task has been renamed.
task - the task to be saved.
Throws:
IOException - if the specified user does not have permission to schedule tasks.
RemoteException - if an unspecified error occurs.
Exception

removeScheduleTask

public void removeScheduleTask(Principal principal,
                               String taskName)
                        throws Exception
Delete the task from the schedule file.

Specified by:
removeScheduleTask in interface RepletRepository
Parameters:
principal - represents an entity.
taskName - the task name to be removed.
Throws:
IOException - if the specified user does not have permission to schedule tasks.
RemoteException - if an unspecified error occurs.
Exception

getProperty

public String getProperty(String propname)
Get the specified property.

Specified by:
getProperty in interface RepletRepository
Parameters:
propname - the property name.
Returns:
the property.

authenticate

public Principal authenticate(ClientInfo user,
                              Object credential)
Checks the authentication of specific entity.

Specified by:
authenticate in interface RepletRepository
Parameters:
user - the client info of the user to be authenticated.
credential - it wraps up the some secure message, such as user id and password.
Returns:
an Principal object or null if authentication fails.

logout

public void logout(Principal principal)
Logout of the system.

Specified by:
logout in interface RepletRepository
Parameters:
principal - represents an entity.

changePassword

public void changePassword(Principal principal,
                           String passwd)
                    throws SRSecurityException
Change the user password.

Specified by:
changePassword in interface RepletRepository
Parameters:
principal - represents an entity.
passwd - is the new password.
Throws:
if - the password cannot be changed.
SRSecurityException - if the password could not be changed.

checkPermission

public boolean checkPermission(Principal principal,
                               String resource,
                               char acc)
Check the permission to access a resource. It always returns true if no security provider is selected.

Specified by:
checkPermission in interface RepletRepository
Parameters:
principal - represents an entity.
resource - resource name.
acc - permission. 'r' for read, 'w' for write, and 'd' for delete.
Returns:
true if the permission is granted to this principal.

setPermission

public void setPermission(Principal principal,
                          String resource,
                          Permission permission)
                   throws SRSecurityException
Set a user's permission of a specific access to a resource.

Specified by:
setPermission in interface RepletRepository
Parameters:
principal - a Principal object identifying the user for whom to set the permission.
resource - the name of the resource.
permission - the permissions assigned to the user and resource.
Throws:
SRSecurityException - if the permissions could not be set.
RemoteException - if an error occurs while setting the permission.

getPrintPages

public Vector getPrintPages(Object repletId,
                            int[] printPages,
                            int fmt)
                     throws RemoteException
Get the corresponding pages of specified replet for print.

Specified by:
getPrintPages in interface RepletRepository
Parameters:
repletId - - Id of replet.
printPages - - selected pages to print. Null to print all pages.
fmt - the file format of the output as defined in Builder.
Throws:
RemoteException

getSingleStylePage

public Enumeration getSingleStylePage(Object repletId)
Get a single style page of the specified replet. The generation will discard any page break, page header or page footer.

Specified by:
getSingleStylePage in interface RepletRepository
Parameters:
repletId - the replet id
Returns:
an enumeration stores the single style page
Throws:
RemoteException - if an unspecified error occurs.

checkPermission

public boolean checkPermission(Principal principal,
                               String prefix,
                               String resource,
                               String permission)
Check permission.

Specified by:
checkPermission in interface AssetRepository
Overrides:
checkPermission in class AbstractAssetEngine
Parameters:
principal - the specified user.
prefix - the specified prefix.
resource - the specified resource.
permission - the specified permission.
Returns:
true if passed, false otherwise.

finalize

protected void finalize()
Remove all the cached files used by this RepletEngine when it is garbage collected.

Overrides:
finalize in class AbstractAssetEngine

checkAccess

protected void checkAccess(Principal principal)
                    throws RepletException
Check if the access matches license.

Throws:
RepletException

getAnalyticReport

public ReportSheet getAnalyticReport(Object repletId)
Get report which can be analyzed.

Parameters:
repletId - the specified replet id.
Returns:
report if exists, null otherwise.

getReport

public ReportSheet getReport(Object repletId,
                             boolean print)
Get report from replet engine..

Parameters:
repletId - the specified replet id.
print - if true will try return print report first, otherwise return report for analysis only.
Returns:
report if exists, null otherwise.

isParameterSheet

public boolean isParameterSheet(Object repletId)
                         throws RemoteException
Check if current report sheet is a parameter sheet.

Specified by:
isParameterSheet in interface RepletRepository
Parameters:
repletId - the specified replet id.
Returns:
true if is a parameter sheet, false otherwise.
Throws:
RemoteException

containsParameterSheet

public boolean containsParameterSheet(Object repletId)
                               throws RemoteException
Check if the replet contains parameter sheets.

Specified by:
containsParameterSheet in interface RepletRepository
Parameters:
repletId - the specified replet id.
Returns:
true if contains parameter sheets, false otherwise.
Throws:
RemoteException

disableParameterSheet

public void disableParameterSheet(Object repletId)
                           throws RemoteException
Disable parameter sheets contained in the replet, and all the parameter sheets will be ignored when process replet.

Specified by:
disableParameterSheet in interface RepletRepository
Parameters:
repletId - the specified replet id.
Throws:
RemoteException

resetReplet

public void resetReplet(Object repletId)
                 throws RemoteException
Reset replet to initial state. If contains parameter sheets, the first parameter sheet will be set to be current report sheet.

Specified by:
resetReplet in interface RepletRepository
Parameters:
repletId - the specified replet id.
Throws:
RemoteException

addToQueue

public int addToQueue(Object repletId,
                      String replet,
                      Principal user)
               throws RemoteException
Add a replet to queue when loading.

Specified by:
addToQueue in interface RepletRepository
Parameters:
repletId - the specified replet id.
replet - the specified replet name.
user - the specified user.
Returns:
ADDTOQ_SUCCESS if successfully added to the report queue, ADDTOQ_FAILURE otherwise,ADDTOQ_GENERATION page generate is completed.
Throws:
RemoteException

removeFromQueue

public boolean removeFromQueue(Object repletId,
                               Principal user)
                        throws RemoteException
Remove a queued replet from queue.

Specified by:
removeFromQueue in interface RepletRepository
Parameters:
repletId - the specified replet id.
user - the specified user.
Returns:
true if successfully removed from the report queue, false otherwise.
Throws:
RemoteException

getRepletName

public String getRepletName(Object id)
                     throws RemoteException
Get the specified replet name.

Parameters:
id - replet ID.
Throws:
RemoteException

getActiveReplets

public Object[] getActiveReplets(String user)
                          throws RemoteException
Get active replet ids.

Specified by:
getActiveReplets in interface RepletRepository
Parameters:
user - the specified user. Pass null to include all replets.
Returns:
active replet ids.
Throws:
RemoteException

getArchiveReplets

public Object[] getArchiveReplets(Principal user)
                           throws RemoteException
Get archive replets by principal.

Specified by:
getArchiveReplets in interface RepletRepository
Parameters:
user - the specified principal. Pass null to include all replets.
Returns:
archive replets ids.
Throws:
RemoteException

getQueuedReplets

public inetsoft.sree.internal.QueuedRepletInfo[] getQueuedReplets(Principal user)
                                                           throws RemoteException
Get replets information in the report queue.

Specified by:
getQueuedReplets in interface RepletRepository
Parameters:
user - the specified user. Pass null to include all replets.
Returns:
queued replet information.
Throws:
RemoteException

getRepositoryEntries

public RepositoryEntry[] getRepositoryEntries(String folder,
                                              Principal user,
                                              String permission,
                                              int selector)
                                       throws RemoteException
Get available repository entries.

Specified by:
getRepositoryEntries in interface RepletRepository
Parameters:
folder - the specified parent folder.
user - the specified user.
permission - the permissions the user must have on an entry in order for it to be returned. Should be a combination of 'r', 'w', and 'd', which stand for read, write, and delete respectively. If this parameter is null, all entries that the user has any permission on are returned.
selector - the specified selector, should be one of the repository entry type predefined in RepositoryEntry like FOLDER. The selector might be the combination of the types as well.
Throws:
RemoteException

isFolderChanged

public boolean isFolderChanged(String folder,
                               Principal user)
                        throws RemoteException
Check if repository.xml file change.

Specified by:
isFolderChanged in interface RepletRepository
Throws:
RemoteException

isArchiveChange

public boolean isArchiveChange(String folder,
                               Principal user,
                               HashMap timestamps)

changeFolder

public void changeFolder(RepositoryEntry entry,
                         String folder,
                         Principal user)
                  throws RemoteException
Change folder of a repository entry.

Specified by:
changeFolder in interface RepletRepository
Parameters:
entry - the specified repository entry.
folder - the specified new folder.
user - the specified user.
Throws:
RemoteException

removeRepositoryEntry

public void removeRepositoryEntry(RepositoryEntry entry,
                                  Principal user)
                           throws RemoteException
Remove a repostory entry.

Specified by:
removeRepositoryEntry in interface RepletRepository
Parameters:
entry - the specified repository entry.
user - the specified user.
Throws:
RemoteException

renameRepositoryEntry

public void renameRepositoryEntry(RepositoryEntry entry,
                                  String nname,
                                  Principal user)
                           throws RemoteException
Rename a repository entry.

Specified by:
renameRepositoryEntry in interface RepletRepository
Parameters:
entry - the specified entry.
nname - the specified new name.
user - the specified user.
Throws:
RemoteException

isEntryAvailable

protected boolean isEntryAvailable(AssetEntry entry)
Test if an entry is available.

Overrides:
isEntryAvailable in class AbstractAssetEngine

getEntryIdentifier

public String getEntryIdentifier(AssetEntry entry)
tomzhang bug1318530017384 Create a new identifier for local worksheet to avoid allmap key conflict

Specified by:
getEntryIdentifier in interface AssetRepository
Overrides:
getEntryIdentifier in class AbstractAssetEngine
Parameters:
entry - AssetEntry
Returns:
like 2^2^_NULL_^VATReport1

getStorage

public inetsoft.util.IndexedStorage getStorage(AssetEntry entry)
                                        throws Exception
Get the indexed storage of an asset entry.

Specified by:
getStorage in interface AssetRepository
Overrides:
getStorage in class AbstractAssetEngine
Parameters:
entry - the specified asset entry.
Returns:
the indexed storage of the asset entry.
Throws:
Exception

getReportManager

protected ReportManager getReportManager(String user)
Get the report manager.

Specified by:
getReportManager in class AbstractAssetEngine
Returns:
the associated report manager.

getQuotaManager

protected inetsoft.uql.util.XQuotaManager getQuotaManager()
Get the quota manager.

Overrides:
getQuotaManager in class AbstractAssetEngine
Returns:
the quota manager if any, null otherwise.

getDependencyFile

protected File getDependencyFile()
Get the dependency file stores dependencies from the report sheets to the worksheets.

Overrides:
getDependencyFile in class AbstractAssetEngine
Returns:
the dependency file, null not to support the feature.

getDependencyFileName

protected String getDependencyFileName()
Description copied from class: AbstractAssetEngine
Get the dependency file stores dependencies from the report sheets to the sheets.

Specified by:
getDependencyFileName in class AbstractAssetEngine
Returns:
the dependency file name.

getOutputType

protected XTypeNode getOutputType(String qname,
                                  XQueryRepository rep,
                                  boolean local,
                                  Principal user)
                           throws Exception
Get query output type.

Specified by:
getOutputType in class AbstractAssetEngine
Parameters:
qname - the specified query name.
rep - the specified local query repository.
local - true if is a local query.
user - the specified principal.
Throws:
Exception

checkQueryFolderPermission

protected boolean checkQueryFolderPermission(String folder,
                                             String source,
                                             Principal user)
Check the query folder permission.

Specified by:
checkQueryFolderPermission in class AbstractAssetEngine
Parameters:
folder - the specified folder.
source - the specified source.
user - the specified user.
Returns:
true if pass, false otherwise.

checkQueryPermission

protected boolean checkQueryPermission(String query,
                                       Principal user)
Check the query permission.

Specified by:
checkQueryPermission in class AbstractAssetEngine
Parameters:
query - the specified query.
user - the specified user.
Returns:
true if pass, false otherwise.

checkDataSourcePermission

protected boolean checkDataSourcePermission(String dname,
                                            Principal user)
Check the datasource permission.

Specified by:
checkDataSourcePermission in class AbstractAssetEngine
Parameters:
dname - the specified datasource.
user - the specified user.
Returns:
true if pass, false otherwise.

checkDataSourceFolderPermission

protected boolean checkDataSourceFolderPermission(String folder,
                                                  Principal user)
Check the datasource folder permission.

Specified by:
checkDataSourceFolderPermission in class AbstractAssetEngine
Parameters:
folder - the specified datasource folder.
user - the specified user.
Returns:
true if pass, false otherwise.

getLocalQueryRepository

public XQueryRepository getLocalQueryRepository(String rid)
Get the local query repository.

Specified by:
getLocalQueryRepository in interface AssetRepository
Parameters:
rid - the specified report id.
Returns:
the local query repository.

createFinder

protected AbstractAssetEngine.ReportSheetDependencyFinder createFinder()
Create finder.

Specified by:
createFinder in class AbstractAssetEngine
Returns:
the created reportsheet dependency finder.

changeFolder0

protected void changeFolder0(AssetEntry oentry,
                             inetsoft.util.IndexedStorage ostorage,
                             AssetEntry nentry,
                             inetsoft.util.IndexedStorage nstorage,
                             boolean root)
                      throws Exception
Change one folder internally.

Overrides:
changeFolder0 in class AbstractAssetEngine
Parameters:
oentry - the specified old folder entry.
nentry - the specified new folder entry.
ostorage - the specified old indexed storage.
nstorage - the specified old indexed storage.
Throws:
Exception

importAssets

public void importAssets(String filePath,
                         boolean overwriting,
                         List order,
                         HashMap names,
                         inetsoft.sree.adm.PartialDeploymentJarInfo info,
                         boolean desktop,
                         Principal principal,
                         List ignoreList)
                  throws Exception
Imports assets into the repository.

Throws:
Exception

importAssets

public void importAssets(String filePath,
                         boolean overwriting,
                         List order,
                         HashMap names,
                         inetsoft.sree.adm.PartialDeploymentJarInfo info,
                         boolean desktop,
                         Principal principal,
                         List ignoreList,
                         inetsoft.util.audit.ActionRecord actionRecord)
                  throws Exception
Imports assets into the repository.

Throws:
Exception

importAssets

public void importAssets(byte[] data,
                         boolean replace)
                  throws Exception
Import assets assets into the repository.

Throws:
Exception

importAssets

public void importAssets(byte[] data,
                         boolean replace,
                         inetsoft.util.audit.ActionRecord actionRecord)
                  throws Exception
Import assets assets into the repository.

Throws:
Exception

deployReport

public void deployReport(inetsoft.sree.adm.web.manager.DeployInfo info,
                         byte[] data,
                         boolean overwrite)
                  throws Exception
Deploys a report into the repository.

Throws:
Exception

changeSheet

public void changeSheet(AssetEntry oentry,
                        AssetEntry nentry,
                        Principal user,
                        boolean force)
                 throws Exception
Change one sheet.

Specified by:
changeSheet in interface AssetRepository
Overrides:
changeSheet in class AbstractAssetEngine
Parameters:
oentry - the specified old sheet entry.
nentry - the specified new sheet entry.
user - the specified user.
force - true to change sheet forcely without checking dependency.
Throws:
Exception

changeSheet0

protected void changeSheet0(AssetEntry oentry,
                            inetsoft.util.IndexedStorage ostorage,
                            AssetEntry nentry,
                            inetsoft.util.IndexedStorage nstorage)
                     throws Exception
Change one sheet internally.

Overrides:
changeSheet0 in class AbstractAssetEngine
Parameters:
oentry - the specified old sheet entry.
nentry - the specified new sheet entry.
ostorage - the specified old indexed storage.
nstorage - the specified old indexed storage.
Throws:
Exception

removeFolder0

protected void removeFolder0(AssetEntry entry,
                             inetsoft.util.IndexedStorage storage)
                      throws Exception
Remove one folder internally.

Overrides:
removeFolder0 in class AbstractAssetEngine
Parameters:
entry - the specified folder entry.
storage - the specified indexed storage.
Throws:
Exception

removeSheet0

protected void removeSheet0(AssetEntry entry,
                            inetsoft.util.IndexedStorage storage)
                     throws Exception
Remove one sheet internally.

Overrides:
removeSheet0 in class AbstractAssetEngine
Parameters:
entry - the specified sheet entry.
storage - the specified indexed storage.
Throws:
Exception

addFolder

public void addFolder(AssetEntry entry,
                      Principal user)
               throws Exception
Add one folder.

Specified by:
addFolder in interface AssetRepository
Overrides:
addFolder in class AbstractAssetEngine
Parameters:
entry - the specified folder entry.
user - the specified user.
Throws:
Exception

setSheet

public void setSheet(AssetEntry entry,
                     AbstractSheet ws,
                     Principal user,
                     boolean force)
              throws Exception
Set one sheet.

Specified by:
setSheet in interface AssetRepository
Overrides:
setSheet in class AbstractAssetEngine
Parameters:
entry - the specified sheet entry.
user - the specified user.
force - true to set sheet forcely without checking.
Throws:
Exception

getEntries

public AssetEntry[] getEntries(AssetEntry entry,
                               Principal user,
                               String permission,
                               int selector)
                        throws Exception
Get the sub entries of a folder.

Specified by:
getEntries in interface AssetRepository
Overrides:
getEntries in class AbstractAssetEngine
Parameters:
entry - the specified folder entry.
user - the specified user.
permission - the specified access way.
selector - the specified selector.
Returns:
the sub entries of the folder, null if exception occurs.
Throws:
Exception

changeFolder

public void changeFolder(AssetEntry oentry,
                         AssetEntry nentry,
                         Principal user,
                         boolean force)
                  throws Exception
Change one folder.

Specified by:
changeFolder in interface AssetRepository
Overrides:
changeFolder in class AbstractAssetEngine
Parameters:
oentry - the specified old folder entry.
nentry - the specified new folder entry.
user - the specified user.
force - true to change folder forcely without checking dependency.
Throws:
Exception

removeFolder

public void removeFolder(AssetEntry entry,
                         Principal user,
                         boolean force)
                  throws Exception
Remove one folder.

Specified by:
removeFolder in interface AssetRepository
Overrides:
removeFolder in class AbstractAssetEngine
Parameters:
entry - the specified folder entry.
user - the specified user.
force - true to remove folder forcely without checking.
Throws:
Exception

checkFolderRemoveable

public void checkFolderRemoveable(AssetEntry entry,
                                  Principal user)
                           throws Exception
Check if folder is removeable.

Specified by:
checkFolderRemoveable in interface AssetRepository
Overrides:
checkFolderRemoveable in class AbstractAssetEngine
Parameters:
entry - the specified folder entry.
user - the specified user.
Throws:
Exception

renameUser

public void renameUser(String oname,
                       String nname)
                throws Exception
Rename a user.

Specified by:
renameUser in interface AssetRepository
Overrides:
renameUser in class AbstractAssetEngine
Parameters:
oname - the old name of the user.
nname - the new name of the user.
Throws:
Exception

removeUser

public void removeUser(String name)
                throws Exception
Remove a user.

Specified by:
removeUser in interface AssetRepository
Overrides:
removeUser in class AbstractAssetEngine
Parameters:
name - the name of the user.
Throws:
Exception

fireEvent

protected void fireEvent(int entryType,
                         int changeType,
                         AssetEntry assetEntry,
                         String oldName)
Description copied from class: AbstractAssetEngine
Notify all registered listeners that an asset entry has been modified.

Overrides:
fireEvent in class AbstractAssetEngine
Parameters:
entryType - the type of entry to which the change was made.
changeType - the type of change that was made to the entry.
assetEntry - the modified asset entry.
oldName - the old name of the entry, of null if the entry was not renamed.

propertyChange

public void propertyChange(PropertyChangeEvent evt)
Property change event.

Specified by:
propertyChange in interface PropertyChangeListener

setActionListener

public void setActionListener(Object rid,
                              ActionListener l)
Set a listener to runtime replet.


setScheduleActionListener

public void setScheduleActionListener(Object rid,
                                      ActionListener l)
Set a listener to runtime replet.


getScheduleActionListener

public ActionListener getScheduleActionListener(Object rid)
Get a listener to runtime replet.


getSheet

public AbstractSheet getSheet(AssetEntry entry,
                              Principal user,
                              boolean permission,
                              AssetContent ctype)
                       throws Exception
Get one sheet.

Specified by:
getSheet in interface AssetRepository
Overrides:
getSheet in class AbstractAssetEngine
Parameters:
entry - the specified sheet entry.
user - the specified user.
permission - true to check permission, false otherwise.
ctype - the asset content type.
Returns:
the associated sheet.
Throws:
Exception

getReportSize

public Size getReportSize(String name,
                          String version,
                          Principal user)
Gets the size of a report.

Specified by:
getReportSize in interface RepletRepository
Parameters:
name - the name of the report.
version - the version of the report.
user - the user for whom the request is being made.
Returns:
the size of the report.

createThumbnail

public Image createThumbnail(String name,
                             String version,
                             Principal user)
Creates a thumbnail image for a report.

Specified by:
createThumbnail in interface RepletRepository
Parameters:
name - the name of the report.
version - the version of the report.
user - the user for whom the request is being made.
Returns:
a thumbnail image.

getExecutingCount

public int getExecutingCount()
Get the number of all executing report during a sample period.


getCount

public int getCount(String type)
Get the count of report of the specified type.

Parameters:
type - Active, Queued, Executing.
Returns:
the count of report.

getGeneratedPageCount

public int getGeneratedPageCount()
Get the generated page count.

Returns:
the generated page count.

resetGeneratedPageCount

public void resetGeneratedPageCount()
Reset the generated page count.


getReportInfo

public inetsoft.sree.adm.web.monitor.ReportInfo[] getReportInfo(String type)
Get the report infos of specified type. Only the getPageCount is time consuming, so level constraint is added here.

Parameters:
type - Active, Queued, Executing.
Returns:
report infos.

recordPageCount

public void recordPageCount(Object id)
Record page count of a replet.


addFolder

public void addFolder(RepositoryEntry entry,
                      String name,
                      String alias,
                      String description,
                      Principal user)
               throws RemoteException
Add folder of a repository entry.

Specified by:
addFolder in interface RepletRepository
Parameters:
entry - the specified repository entry.
name - the name of new folder.
alias - the alias of new folder.
description - the description of new folder.
user - the specified user.
Throws:
RemoteException

isLogExport

public boolean isLogExport()
Check if should log export.

Returns:
true if should log, false otherwise.

setLogExport

public void setLogExport(boolean log)
Set whether should log export.

Parameters:
match - true if should log, false otherwise.

Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.