/** * Authenticate as the guest user. This may not be allowed and throw an exception. * * @throws AuthenticationException */ @Auditable public void authenticateAsGuest() throws AuthenticationException;
String[] params = auditableDef.parameters(); boolean[] recordable = auditableDef.recordable();
@SuppressWarnings("unchecked") public void testAnnotations() throws Exception, NoSuchMethodException { Class clazz = AnnotationTestInterface.class; Method method = clazz.getMethod("noArgs", new Class[]{}); assertTrue(method.isAnnotationPresent(Auditable.class)); Auditable auditable = method.getAnnotation(Auditable.class); assertEquals(auditable.parameters().length, 0); method = clazz.getMethod("getString", new Class[]{String.class, String.class}); assertTrue(method.isAnnotationPresent(Auditable.class)); auditable = method.getAnnotation(Auditable.class); assertEquals(auditable.parameters().length, 2); assertEquals(auditable.parameters()[0], "one"); assertEquals(auditable.parameters()[1], "two"); method = clazz.getMethod("getAnotherString", new Class[]{String.class}); assertTrue(method.isAnnotationPresent(Auditable.class)); auditable = method.getAnnotation(Auditable.class); assertEquals(auditable.parameters().length, 1); assertEquals(auditable.parameters()[0], "one"); } }
Object auditRet = auditableDef.recordReturnedObject() ? ret : null;
String[] params = auditableDef.parameters(); boolean[] recordable = auditableDef.recordable();
Object auditRet = auditableDef.recordReturnedObject() ? ret : null;
/** * Check if Guest user authentication is allowed. * * @return true if Guest user authentication is allowed, false otherwise */ @Auditable public boolean guestUserAuthenticationAllowed();
/** * Invalidate a single ticket by ID * * @param ticket String * @throws AuthenticationException */ @Auditable(parameters = {"ticket"}, recordable = {false}) public void invalidateTicket(String ticket) throws AuthenticationException;
/** * Does this instance allow users to update their passwords? */ @Auditable public Set<String> getDomiansThatAllowUserPasswordChanges();
/** * Make an existing document into a translation by adding the <b>cm:mlDocument</b> aspect and * creating a <b>cm:mlContainer</b> parent. If it is already a translation, then nothing is done. * * @param contentNodeRef An existing <b>cm:content</b> * * @see org.alfresco.model.ContentModel#ASPECT_MULTILINGUAL_DOCUMENT */ @Auditable(parameters = {"contentNodeRef", "locale"}) void makeTranslation(NodeRef contentNodeRef, Locale locale);
/** * Make a translation out of an existing document. The necessary translation structures will be created * as necessary. * * @param newTranslationNodeRef An existing <b>cm:content</b> * @param translationOfNodeRef An existing <b>cm:mlDocument</b> */ @Auditable(parameters = {"newTranslationNodeRef", "translationOfNodeRef", "locale"}) void addTranslation(NodeRef newTranslationNodeRef, NodeRef translationOfNodeRef, Locale locale);
/** * Subscribes to a node. * * @param userId * id of the user * @param node * the node */ @Auditable(parameters = { "userId", "node" }) void subscribe(String userId, NodeRef node);
/** * Get the the versioned metadata of a specific <b>cm:mlDocument</b> transalation version or a specific * <b>cm:mlContainer</b> version * * @param version An existing version of a <b>cm:mlDocument</b> translation version or * an existing version of a <b>cm:mlContainer</b> version. * @return The versioned metadata */ @Auditable(parameters = {"version"}) Map<QName, Serializable> getVersionedMetadatas(Version version);
/** * Get the copies of a given node * * @param originalNodeRef the original node reference * @param pagingRequest page request details * @return the page(s) of nodes that were copied from the given node */ @Auditable(parameters = {"originalNodeRef"}) public PagingResults<CopyInfo> getCopies(NodeRef originalNodeRef, PagingRequest pagingRequest);
/** * Get all preferences for a particular user * * @param userName the user name * @return a map containing the preference values, empty if none */ @Auditable(parameters = {"userName"}) Map<String, Serializable> getPreferences(String userName);
/** * Gets the lock status for the node reference for the specified user. * * @see LockService#getLockStatus(NodeRef) * * @param nodeRef the node reference * @param userName the user name * @return the lock status */ @Auditable(parameters = {"nodeRef", "userName"}) public LockStatus getLockStatus(NodeRef nodeRef, String userName);
/** * Get the username of the owner of the given object. * * @param nodeRef NodeRef * @return the username or null if the object has no owner */ @Auditable(parameters = {"nodeRef"}) public String getOwner(NodeRef nodeRef);
/** * Deploy a Workflow Definition to the Alfresco Repository * * @param engineId the bpm engine id * @param workflowDefinition the workflow definition * @param mimetype the mimetype of the workflow definition * @return workflow deployment descriptor */ @Auditable( parameters = {"engineId", "workflowDefinition", "mimetype"}, recordable = {true, false, true}) public WorkflowDeployment deployDefinition(String engineId, InputStream workflowDefinition, String mimetype);
/** * Is the specified Workflow Definition already deployed? * * Note: the notion of "already deployed" may differ between bpm engines. For example, * different versions of the same process may be considered equal. * * @param workflowDefinition the content object containing the definition * @return true => already deployed */ @Auditable(parameters = {"definitionContent"}) public boolean isDefinitionDeployed(NodeRef workflowDefinition);
/** * Gets all deployed Workflow Definitions (with all previous versions) * * @return the deployed (and previous) workflow definitions */ @Auditable public List<WorkflowDefinition> getAllDefinitions();