org.drools.guvnor.server
Class ServiceImplementation

java.lang.Object
  extended by org.drools.guvnor.server.ServiceImplementation
All Implemented Interfaces:
com.google.gwt.user.client.rpc.RemoteService, RepositoryService

@Name(value="org.drools.guvnor.client.rpc.RepositoryService")
@AutoCreate
public class ServiceImplementation
extends Object
implements RepositoryService

This is the implementation of the repository service to drive the GWT based front end. Generally requests for this are passed through from RepositoryServiceServlet - and Seam manages instances of this.


Constructor Summary
ServiceImplementation()
           
 
Method Summary
 void cleanLog()
          clean up the log entry.
 void clearRulesRepository()
          Clear the rules repositoty, Use at your own risk.
 void create()
           
 String createNewImportedRule(String sharedAssetName, String initialPackage)
          This will create a new asset which refers to an existing asset
 String createNewRule(String ruleName, String description, String initialCategory, String initialPackage, String format)
          This will create a new asset.
 String createState(String name)
          Create a state (status).
 void createUser(String userName)
          create new user.
 void createWorkspace(String workspace)
          This creates a workspace
 void deleteUncheckedRule(String uuid)
          Delete un checked in Asset
 void deleteUser(String userName)
          Removes user security data.
 boolean doesAssetExistInPackage(String assetName, String packageName)
          Check whether an asset exists in a package
 String[] getCustomSelectors()
          return custom selector names
 RulesRepository getRulesRepository()
           
 boolean isDoNotInstallSample()
           
 Boolean isHostedMode()
          Check to see if app context is active (not in hosted)
 List<String> listAvailablePermissionRoleTypes()
          List the available permission types.
 String[] listAvailablePermissionTypes()
          Deprecated. 
 String[] listImagesInGlobalArea()
           
 String[] listRulesInGlobalArea()
           
 String[] listStates()
          Returns a list of valid states.
 Map<String,List<String>> listUserPermissions()
           
 PageResponse<PermissionsPageRow> listUserPermissions(PageRequest request)
           
 String[] listWorkspaces()
          This returns a list of workspaces
 String[] loadDropDownExpression(String[] valuePairs, String expression)
           
 PageResponse<InboxPageRow> loadInbox(InboxPageRequest request)
          Load the data for a given inbox for the currently logged in user.
 TableDataResult loadInbox(String inboxName)
          Deprecated. in favour of loadInbox(InboxPageRequest)
 PageResponse<StatePageRow> loadRuleListForState(StatePageRequest request)
          Return a list of Assets by status
 TableDataResult loadRuleListForState(String stateName, int skip, int numRows, String tableConfig)
          Deprecated. in favour of loadRuleListForState(StatePageRequest)
 Map<String,String> loadSpringContextElementData()
          Returns the Spring context elements specified by SpringContextElementsManager
 SuggestionCompletionEngine loadSuggestionCompletionEngine(String packageName)
          Loads up the SuggestionCompletionEngine for the given package.
 TableConfig loadTableConfig(String listName)
          Deprecated. in favour of AbstractPagedTable
 Map<String,String> loadWorkitemDefinitionElementData()
          Returns the Workitem Definition elements specified by WorkitemDefinitionElementsManager
 String processTemplate(String name, Map<String,Object> data)
          Load and process the repository configuration templates.
 PageResponse<QueryPageRow> queryFullText(QueryPageRequest request)
          Runs a full text search using JCR.
 TableDataResult queryMetaData(MetaDataQuery[] qr, Date createdAfter, Date createdBefore, Date modifiedAfter, Date modifiedBefore, boolean seekArchived, int skip, int numRows)
          Deprecated. in favour of queryMetaData(QueryMetadataPageRequest)
 PageResponse<QueryPageRow> queryMetaData(QueryMetadataPageRequest request)
          Run a meta data search.
 void removeState(String name)
          Removes a state.
 void removeWorkspace(String workspace)
          This removes a workspace
 void renameState(String oldName, String newName)
          Renames a state.
 Map<String,List<String>> retrieveUserPermissions(String userName)
          Loads the user permissions.
 void setDoNotInstallSample()
           
 void setRulesRepository(RulesRepository repository)
           
 LogEntry[] showLog()
          Deprecated. in favour of showLog(PageRequest)
 PageResponse<LogPageRow> showLog(PageRequest request)
          This will list log entries logged by the server.
 List<PushResponse> subscribe()
          Subscribe for a "callback" for a given request.
 void updateUserPermissions(String userName, Map<String,List<String>> perms)
          Update the user permissions - takes the userName, and a map from permission type to the list of targets it applies to.
 void updateWorkspace(String workspace, String[] selectedModules, String[] unselectedModules)
          For the time being, module == package
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceImplementation

public ServiceImplementation()
Method Detail

create

@Create
public void create()

setRulesRepository

public void setRulesRepository(RulesRepository repository)

getRulesRepository

public RulesRepository getRulesRepository()

listWorkspaces

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public String[] listWorkspaces()
Description copied from interface: RepositoryService
This returns a list of workspaces

Specified by:
listWorkspaces in interface RepositoryService

createWorkspace

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public void createWorkspace(String workspace)
Description copied from interface: RepositoryService
This creates a workspace

Specified by:
createWorkspace in interface RepositoryService

removeWorkspace

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public void removeWorkspace(String workspace)
Description copied from interface: RepositoryService
This removes a workspace

Specified by:
removeWorkspace in interface RepositoryService

updateWorkspace

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public void updateWorkspace(String workspace,
                                               String[] selectedModules,
                                               String[] unselectedModules)
For the time being, module == package

Specified by:
updateWorkspace in interface RepositoryService

createNewRule

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public String createNewRule(String ruleName,
                                               String description,
                                               String initialCategory,
                                               String initialPackage,
                                               String format)
                     throws com.google.gwt.user.client.rpc.SerializationException
This will create a new asset. It will be saved, but not checked in. The initial state will be the draft state. Returns the UUID of the asset.

Specified by:
createNewRule in interface RepositoryService
Throws:
com.google.gwt.user.client.rpc.SerializationException

createNewImportedRule

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public String createNewImportedRule(String sharedAssetName,
                                                       String initialPackage)
                             throws com.google.gwt.user.client.rpc.SerializationException
This will create a new asset which refers to an existing asset

Specified by:
createNewImportedRule in interface RepositoryService
Throws:
com.google.gwt.user.client.rpc.SerializationException

deleteUncheckedRule

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public void deleteUncheckedRule(String uuid)
Description copied from interface: RepositoryService
Delete un checked in Asset

Specified by:
deleteUncheckedRule in interface RepositoryService

loadRuleListForState

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public TableDataResult loadRuleListForState(String stateName,
                                                               int skip,
                                                               int numRows,
                                                               String tableConfig)
                                     throws com.google.gwt.user.client.rpc.SerializationException
Deprecated. in favour of loadRuleListForState(StatePageRequest)

Description copied from interface: RepositoryService
Return a a 2d array/grid of results for rules.

Specified by:
loadRuleListForState in interface RepositoryService
Throws:
com.google.gwt.user.client.rpc.SerializationException

loadTableConfig

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public TableConfig loadTableConfig(String listName)
Deprecated. in favour of AbstractPagedTable

Description copied from interface: RepositoryService
This will return a TableConfig of header names.

Specified by:
loadTableConfig in interface RepositoryService
Parameters:
listName - The name of the list that we are going to render.

queryMetaData

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public TableDataResult queryMetaData(MetaDataQuery[] qr,
                                                        Date createdAfter,
                                                        Date createdBefore,
                                                        Date modifiedAfter,
                                                        Date modifiedBefore,
                                                        boolean seekArchived,
                                                        int skip,
                                                        int numRows)
                              throws com.google.gwt.user.client.rpc.SerializationException
Deprecated. in favour of queryMetaData(QueryMetadataPageRequest)

Description copied from interface: RepositoryService
Run a meta data search. All dates are in format as configured for the system. Pass in null and they will not be included in the search (that applies to any field).

Specified by:
queryMetaData in interface RepositoryService
Returns:
Throws:
com.google.gwt.user.client.rpc.SerializationException

createState

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public String createState(String name)
                   throws com.google.gwt.user.client.rpc.SerializationException
Description copied from interface: RepositoryService
Create a state (status).

Specified by:
createState in interface RepositoryService
Returns:
the UUID of the created StateItem.
Throws:
com.google.gwt.user.client.rpc.SerializationException

removeState

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public void removeState(String name)
                 throws com.google.gwt.user.client.rpc.SerializationException
Description copied from interface: RepositoryService
Removes a state.

Specified by:
removeState in interface RepositoryService
Parameters:
name - state name that will be removed.
Throws:
com.google.gwt.user.client.rpc.SerializationException

renameState

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public void renameState(String oldName,
                                           String newName)
                 throws com.google.gwt.user.client.rpc.SerializationException
Description copied from interface: RepositoryService
Renames a state.

Specified by:
renameState in interface RepositoryService
Parameters:
oldName - states old name.
newName - states new name.
Throws:
com.google.gwt.user.client.rpc.SerializationException

listStates

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public String[] listStates()
                    throws com.google.gwt.user.client.rpc.SerializationException
Description copied from interface: RepositoryService
Returns a list of valid states.

Specified by:
listStates in interface RepositoryService
Throws:
com.google.gwt.user.client.rpc.SerializationException

clearRulesRepository

@WebRemote
public void clearRulesRepository()
Description copied from interface: RepositoryService
Clear the rules repositoty, Use at your own risk.

Specified by:
clearRulesRepository in interface RepositoryService

loadSuggestionCompletionEngine

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public SuggestionCompletionEngine loadSuggestionCompletionEngine(String packageName)
                                                          throws com.google.gwt.user.client.rpc.SerializationException
Description copied from interface: RepositoryService
Loads up the SuggestionCompletionEngine for the given package. As this doesn't change that often, its safe to cache. However, if a change is made to a package, should blow away the cache.

Specified by:
loadSuggestionCompletionEngine in interface RepositoryService
Throws:
com.google.gwt.user.client.rpc.SerializationException

getCustomSelectors

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public String[] getCustomSelectors()
                            throws com.google.gwt.user.client.rpc.SerializationException
Description copied from interface: RepositoryService
return custom selector names

Specified by:
getCustomSelectors in interface RepositoryService
Throws:
com.google.gwt.user.client.rpc.SerializationException

listRulesInGlobalArea

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public String[] listRulesInGlobalArea()
                               throws com.google.gwt.user.client.rpc.SerializationException
Throws:
com.google.gwt.user.client.rpc.SerializationException

listImagesInGlobalArea

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public String[] listImagesInGlobalArea()
                                throws com.google.gwt.user.client.rpc.SerializationException
Throws:
com.google.gwt.user.client.rpc.SerializationException

showLog

@WebRemote
public LogEntry[] showLog()
Deprecated. in favour of showLog(PageRequest)

Description copied from interface: RepositoryService
This will list the last N log entryies logged by the server. For debugging purposes in the GUI.

Specified by:
showLog in interface RepositoryService

showLog

@WebRemote
public PageResponse<LogPageRow> showLog(PageRequest request)
Description copied from interface: RepositoryService
This will list log entries logged by the server. For debugging purposes in the GUI. This is an equivalent function to RepositoryService.showLog() which has been deprecated in favour of DTO centric operations.

Specified by:
showLog in interface RepositoryService

cleanLog

@WebRemote
public void cleanLog()
Description copied from interface: RepositoryService
clean up the log entry.

Specified by:
cleanLog in interface RepositoryService

loadDropDownExpression

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public String[] loadDropDownExpression(String[] valuePairs,
                                                          String expression)
Specified by:
loadDropDownExpression in interface RepositoryService
Parameters:
valuePairs - key=value pairs to be interpolated into the expression.
expression - The expression, which will then be eval'ed to generate a String[]

isDoNotInstallSample

@Restrict(value="#{identity.loggedIn}")
public boolean isDoNotInstallSample()
Specified by:
isDoNotInstallSample in interface RepositoryService

setDoNotInstallSample

@Restrict(value="#{identity.loggedIn}")
public void setDoNotInstallSample()
Specified by:
setDoNotInstallSample in interface RepositoryService

listUserPermissions

@Restrict(value="#{identity.loggedIn}")
public Map<String,List<String>> listUserPermissions()
Specified by:
listUserPermissions in interface RepositoryService
Returns:
A map of username : list of permission types for display reasons.

listUserPermissions

@Restrict(value="#{identity.loggedIn}")
public PageResponse<PermissionsPageRow> listUserPermissions(PageRequest request)
Specified by:
listUserPermissions in interface RepositoryService
Returns:
A map of username : list of permission types for display reasons.

retrieveUserPermissions

@Restrict(value="#{identity.loggedIn}")
public Map<String,List<String>> retrieveUserPermissions(String userName)
Description copied from interface: RepositoryService
Loads the user permissions.

Specified by:
retrieveUserPermissions in interface RepositoryService
Returns:
A map of permission type to the targets it applies to.

updateUserPermissions

@Restrict(value="#{identity.loggedIn}")
public void updateUserPermissions(String userName,
                                           Map<String,List<String>> perms)
Description copied from interface: RepositoryService
Update the user permissions - takes the userName, and a map from permission type to the list of targets it applies to.

Specified by:
updateUserPermissions in interface RepositoryService

listAvailablePermissionTypes

@Deprecated
@Restrict(value="#{identity.loggedIn}")
public String[] listAvailablePermissionTypes()
Deprecated. 

Description copied from interface: RepositoryService
List the available permission types.

Specified by:
listAvailablePermissionTypes in interface RepositoryService
Returns:

listAvailablePermissionRoleTypes

@Restrict(value="#{identity.loggedIn}")
public List<String> listAvailablePermissionRoleTypes()
Description copied from interface: RepositoryService
List the available permission types.

Specified by:
listAvailablePermissionRoleTypes in interface RepositoryService
Returns:

deleteUser

@Restrict(value="#{identity.loggedIn}")
public void deleteUser(String userName)
Description copied from interface: RepositoryService
Removes user security data.

Specified by:
deleteUser in interface RepositoryService

createUser

@Restrict(value="#{identity.loggedIn}")
public void createUser(String userName)
Description copied from interface: RepositoryService
create new user.

Specified by:
createUser in interface RepositoryService

loadInbox

@Restrict(value="#{identity.loggedIn}")
public TableDataResult loadInbox(String inboxName)
                          throws DetailedSerializationException
Deprecated. in favour of loadInbox(InboxPageRequest)

Description copied from interface: RepositoryService
Load the data for a given inbox for the currently logged in user.

Specified by:
loadInbox in interface RepositoryService
Throws:
DetailedSerializationException

loadInbox

@Restrict(value="#{identity.loggedIn}")
public PageResponse<InboxPageRow> loadInbox(InboxPageRequest request)
                                     throws DetailedSerializationException
Description copied from interface: RepositoryService
Load the data for a given inbox for the currently logged in user.

Specified by:
loadInbox in interface RepositoryService
Throws:
DetailedSerializationException

processTemplate

public String processTemplate(String name,
                              Map<String,Object> data)
Load and process the repository configuration templates.

Specified by:
processTemplate in interface RepositoryService

loadSpringContextElementData

public Map<String,String> loadSpringContextElementData()
                                                throws DetailedSerializationException
Returns the Spring context elements specified by SpringContextElementsManager

Specified by:
loadSpringContextElementData in interface RepositoryService
Returns:
a Map containing the key,value pairs of data.
Throws:
DetailedSerializationException

loadWorkitemDefinitionElementData

public Map<String,String> loadWorkitemDefinitionElementData()
                                                     throws DetailedSerializationException
Returns the Workitem Definition elements specified by WorkitemDefinitionElementsManager

Specified by:
loadWorkitemDefinitionElementData in interface RepositoryService
Returns:
a Map containing the key,value pairs of data.
Throws:
DetailedSerializationException

isHostedMode

public Boolean isHostedMode()
Check to see if app context is active (not in hosted)

Specified by:
isHostedMode in interface RepositoryService

queryFullText

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public PageResponse<QueryPageRow> queryFullText(QueryPageRequest request)
                                         throws com.google.gwt.user.client.rpc.SerializationException
Description copied from interface: RepositoryService
Runs a full text search using JCR.

Specified by:
queryFullText in interface RepositoryService
Returns:
Throws:
com.google.gwt.user.client.rpc.SerializationException

queryMetaData

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public PageResponse<QueryPageRow> queryMetaData(QueryMetadataPageRequest request)
                                         throws com.google.gwt.user.client.rpc.SerializationException
Description copied from interface: RepositoryService
Run a meta data search. All dates are in format as configured for the system. Pass in null and they will not be included in the search (that applies to any field).

Specified by:
queryMetaData in interface RepositoryService
Returns:
Throws:
com.google.gwt.user.client.rpc.SerializationException

loadRuleListForState

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public PageResponse<StatePageRow> loadRuleListForState(StatePageRequest request)
                                                throws com.google.gwt.user.client.rpc.SerializationException
Description copied from interface: RepositoryService
Return a list of Assets by status

Specified by:
loadRuleListForState in interface RepositoryService
Parameters:
request - Request specific details
Throws:
com.google.gwt.user.client.rpc.SerializationException

subscribe

public List<PushResponse> subscribe()
Description copied from interface: RepositoryService
Subscribe for a "callback" for a given request.

Specified by:
subscribe in interface RepositoryService

doesAssetExistInPackage

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public boolean doesAssetExistInPackage(String assetName,
                                                          String packageName)
                                throws com.google.gwt.user.client.rpc.SerializationException
Check whether an asset exists in a package

Specified by:
doesAssetExistInPackage in interface RepositoryService
Parameters:
assetName -
packageName -
Returns:
True if the asset already exists in the package
Throws:
com.google.gwt.user.client.rpc.SerializationException


Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.