Package org.gitana.platform.client.project

# Class ProjectImpl

java.lang.Object
org.gitana.platform.support.GitanaObjectImpl
org.gitana.platform.client.document.DocumentImpl
org.gitana.platform.client.platform.AbstractPlatformDocumentImpl
org.gitana.platform.client.project.ProjectImpl

All Implemented Interfaces:
  `Serializable`, `Attachable`, `Document`, `PlatformDocument`, `Project`, `AccessControllable`, `Copyable`, `Referenceable`, `Selfable`, `TitleDescription`, `Transferable`, `TypedID`, `org.gitana.platform.GitanaObject`, `org.gitana.platform.JSONable`

public class ProjectImpl extends AbstractPlatformDocumentImpl implements Project

Author:
  uzi
See Also:
  - Serialized Form

## Field Summary

### Fields inherited from class org.gitana.platform.support.GitanaObjectImpl

`serialVersionUID`

### Fields inherited from interface org.gitana.platform.client.document.Document

`FIELD_ID, SYSTEM, SYSTEM_CREATED_BY, SYSTEM_CREATED_ON, SYSTEM_MODIFIED_BY, SYSTEM_MODIFIED_ON`

### Fields inherited from interface org.gitana.platform.client.project.Project

`FIELD_FAMILY, FIELD_PROJECT_TYPE, FIELD_SHARED_STACK, FIELD_STACK_ID`

### Fields inherited from interface org.gitana.platform.client.support.TitleDescription

`FIELD_DESCRIPTION, FIELD_TITLE`

## Constructor Summary

Constructors
Constructor
Description
`ProjectImpl(Platform platform, com.fasterxml.jackson.databind.node.ObjectNode obj, boolean isSaved)`

## Method Summary

Modifier and Type
Method
Description
`void`
`delete()`
Delete
`void`
`deleteAttachment()`
Deletes the default attachment.
`void`
`deleteAttachment(String attachmentId)`
Deletes an attachment.
`byte[]`
`downloadAttachment()`
Downloads the default attachment.
`byte[]`
`downloadAttachment(String attachmentId)`
Downloads an attachment.
`ACL`
`getACL()`
`List<String>`
`getACL(String principalId)`
Retrieve the authorities that a principal has.
`Map<String,Map<String,org.gitana.platform.services.authority.AuthorityGrant>>`
`getAuthorityGrants(List<String> principalIds)`
Acquires a map of authority grants for a set of principals.
`String`
`getDownloadUri(String attachmentId)`
Acquires the download URI for the attachment
`String`
`getFamily()`
`String`
`getProjectType()`
`protected String`
`getResourceUri()`
`boolean`
`getSharedStack()`
`Stack`
`getStack()`
`String`
`getStackId()`
`String`
`getTypeId()`
`void`
`grant(String principalId, String authorityId)`
Grants an authority to a principal.
`void`
`grant(DomainPrincipal principal, String authorityId)`
`boolean`
`hasAuthority(String principalId, String authorityId)`
Checks whether the principal has the given authority over this object.
`boolean`
`hasAuthority(DomainPrincipal principal, String authorityId)`
`boolean`
`hasPermission(String principalId, String permissionId)`
Checks whether the principal has the given permission over this object.
`boolean`
`hasPermission(DomainPrincipal principal, String authorityId)`
`void`
`inviteUser(String userId)`
`org.gitana.platform.support.ResultMap<Attachment>`
`listAttachments()`
`void`
`reload()`
Reload
`void`
`revoke(String principalId, String authorityId)`
Revokes an authority for a principal.
`void`
`revoke(DomainPrincipal principal, String authorityId)`
`void`
`revokeAll(String principalId)`
Revoke all authorities for a principal.
`void`
`revokeAll(DomainPrincipal principal)`
`void`
`setFamily(String family)`
`void`
`setProjectType(String projectType)`
`void`
`setSharedStack(boolean sharedStack)`
`void`
`setStackId(String stackId)`
`void`
`update()`
Update
`void`
`uploadAttachment(byte[] bytes, String contentType)`
Uploads the default attachment.
`void`
`uploadAttachment(String attachmentId, byte[] bytes, String contentType)`
Uploads an attachment.
`void`
`uploadAttachment(String attachmentId, byte[] bytes, String contentType, String fileName)`
Uploads an attachment.
`void`
`uploadAttachments(Map<String,String> params, org.gitana.http.HttpPayload... payloads)`
Uploads a group of attachments.
`void`
`uploadAttachments(org.gitana.http.HttpPayload... payloads)`
Uploads a group of attachments.

### Methods inherited from class org.gitana.platform.client.platform.AbstractPlatformDocumentImpl

`copy, copy, copyAsync, copyAsync, exportArchive, exportArchive, exportArchive, getCluster, getDriver, getFactory, getPlatform, getPlatformId, getRemote, importArchive, importArchive, importArchive, ref`

### Methods inherited from class org.gitana.platform.client.document.DocumentImpl

`dateCreated, dateModified, getCreatedBy, getDescription, getId, getModifiedBy, getSystemObject, getTitle, isSaved, mergeProperties, mergePropertyIfExists, reload, reload, setDescription, setId, setSaved, setTitle`

### Methods inherited from class org.gitana.platform.support.GitanaObjectImpl

`_objectGetFloat, _objectGetInt, _objectGetLong, _objectGetObject, _objectGetString, _objectSet, get, getArray, getAsJsonNode, getBigDecimal, getBoolean, getDouble, getInt, getLong, getObject, getObject, getString, has, putAll, putAll, putObject, remove, set, toJSON, toJSONString, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.gitana.platform.client.support.Copyable

`copy, copy, copyAsync, copyAsync`

### Methods inherited from interface org.gitana.platform.client.document.Document

`dateCreated, dateModified, getCreatedBy, getId, getModifiedBy, getSystemObject, isSaved, reload, reload, setId, setSaved`

### Methods inherited from interface org.gitana.platform.GitanaObject

`get, getArray, getAsJsonNode, getBigDecimal, getBoolean, getDouble, getInt, getLong, getObject, getObject, getString, has, putAll, putAll, remove, set`

### Methods inherited from interface org.gitana.platform.JSONable

`toJSON, toJSONString`

### Methods inherited from interface org.gitana.platform.client.platform.PlatformDocument

`getPlatform, getPlatformId`

### Methods inherited from interface org.gitana.platform.client.support.Referenceable

`ref`

### Methods inherited from interface org.gitana.platform.client.support.TitleDescription

`getDescription, getTitle, setDescription, setTitle`

### Methods inherited from interface org.gitana.platform.client.support.Transferable

`exportArchive, exportArchive, exportArchive, importArchive, importArchive, importArchive`

### Methods inherited from interface org.gitana.platform.client.support.TypedID

`getId`

## Constructor Details

### ProjectImpl

public ProjectImpl(Platform platform, com.fasterxml.jackson.databind.node.ObjectNode obj, boolean isSaved)

## Method Details

### getTypeId

public String getTypeId()

Specified by:
  `getTypeId` in interface `TypedID`

### getResourceUri

protected String getResourceUri()

Specified by:
  `getResourceUri` in class `AbstractPlatformDocumentImpl`

### getStackId

public String getStackId()

Specified by:
  `getStackId` in interface `Project`

### setStackId

public void setStackId(String stackId)

Specified by:
  `setStackId` in interface `Project`

### getProjectType

public String getProjectType()

Specified by:
  `getProjectType` in interface `Project`

### setProjectType

public void setProjectType(String projectType)

Specified by:
  `setProjectType` in interface `Project`

### getFamily

public String getFamily()

Specified by:
  `getFamily` in interface `Project`

### setFamily

public void setFamily(String family)

Specified by:
  `setFamily` in interface `Project`

### getSharedStack

public boolean getSharedStack()

Specified by:
  `getSharedStack` in interface `Project`

### setSharedStack

public void setSharedStack(boolean sharedStack)

Specified by:
  `setSharedStack` in interface `Project`

### getStack

public Stack getStack()

Specified by:
  `getStack` in interface `Project`

### reload

public void reload()
Description copied from interface: `Selfable`
Reload

Specified by:
  `reload` in interface `Selfable`

### update

public void update()
Description copied from interface: `Selfable`
Update

Specified by:
  `update` in interface `Selfable`

### delete

public void delete()
Description copied from interface: `Selfable`
Delete

Specified by:
  `delete` in interface `Selfable`

### getACL

public ACL getACL()

Specified by:
  `getACL` in interface `AccessControllable`
Returns:
  access control list

### getACL

public List<String> getACL(String principalId)
Description copied from interface: `AccessControllable`
Retrieve the authorities that a principal has.

Specified by:
  `getACL` in interface `AccessControllable`
Parameters:
  `principalId` -
Returns:
  list

### grant

public void grant(String principalId, String authorityId)
Description copied from interface: `AccessControllable`
Grants an authority to a principal.

Specified by:
  `grant` in interface `AccessControllable`
Parameters:
  `principalId` -
  `authorityId` -

### grant

public void grant(DomainPrincipal principal, String authorityId)

Specified by:
  `grant` in interface `AccessControllable`

### revoke

public void revoke(String principalId, String authorityId)
Description copied from interface: `AccessControllable`
Revokes an authority for a principal.

Specified by:
  `revoke` in interface `AccessControllable`
Parameters:
  `principalId` -
  `authorityId` -

### revoke

public void revoke(DomainPrincipal principal, String authorityId)

Specified by:
  `revoke` in interface `AccessControllable`

### revokeAll

public void revokeAll(String principalId)
Description copied from interface: `AccessControllable`
Revoke all authorities for a principal.

Specified by:
  `revokeAll` in interface `AccessControllable`
Parameters:
  `principalId` -

### revokeAll

public void revokeAll(DomainPrincipal principal)

Specified by:
  `revokeAll` in interface `AccessControllable`

### hasAuthority

public boolean hasAuthority(String principalId, String authorityId)
Description copied from interface: `AccessControllable`
Checks whether the principal has the given authority over this object.

Specified by:
  `hasAuthority` in interface `AccessControllable`
Parameters:
  `principalId` -
  `authorityId` -
Returns:

### hasAuthority

public boolean hasAuthority(DomainPrincipal principal, String authorityId)

Specified by:
  `hasAuthority` in interface `AccessControllable`

### getAuthorityGrants

public Map<String,Map<String,org.gitana.platform.services.authority.AuthorityGrant>> getAuthorityGrants(List<String> principalIds)
Description copied from interface: `AccessControllable`
Acquires a map of authority grants for a set of principals.

Specified by:
  `getAuthorityGrants` in interface `AccessControllable`
Parameters:
  `principalIds` -
Returns:

### hasPermission

public boolean hasPermission(String principalId, String permissionId)
Description copied from interface: `AccessControllable`
Checks whether the principal has the given permission over this object.

Specified by:
  `hasPermission` in interface `AccessControllable`
Parameters:
  `principalId` -
  `permissionId` -
Returns:

### hasPermission

public boolean hasPermission(DomainPrincipal principal, String authorityId)

Specified by:
  `hasPermission` in interface `AccessControllable`

### uploadAttachment

public void uploadAttachment(byte[] bytes, String contentType)
Description copied from interface: `Attachable`
Uploads the default attachment.

Specified by:
  `uploadAttachment` in interface `Attachable`
Parameters:
  `bytes` -
  `contentType` -

### uploadAttachment

public void uploadAttachment(String attachmentId, byte[] bytes, String contentType)
Description copied from interface: `Attachable`
Uploads an attachment.

Specified by:
  `uploadAttachment` in interface `Attachable`
Parameters:
  `attachmentId` -
  `bytes` -
  `contentType` -

### uploadAttachment

public void uploadAttachment(String attachmentId, byte[] bytes, String contentType, String fileName)
Description copied from interface: `Attachable`
Uploads an attachment.

Specified by:
  `uploadAttachment` in interface `Attachable`
Parameters:
  `attachmentId` -
  `bytes` -
  `contentType` -
  `fileName` -

### uploadAttachments

public void uploadAttachments(org.gitana.http.HttpPayload... payloads)
Description copied from interface: `Attachable`
Uploads a group of attachments.

Specified by:
  `uploadAttachments` in interface `Attachable`
Parameters:
  `payloads` -

### uploadAttachments

public void uploadAttachments(Map<String,String> params, org.gitana.http.HttpPayload... payloads)
Description copied from interface: `Attachable`
Uploads a group of attachments.

Specified by:
  `uploadAttachments` in interface `Attachable`
Parameters:
  `payloads` -

### downloadAttachment

public byte[] downloadAttachment()
Description copied from interface: `Attachable`
Downloads the default attachment.

Specified by:
  `downloadAttachment` in interface `Attachable`
Returns:
  attachment

### downloadAttachment

public byte[] downloadAttachment(String attachmentId)
Description copied from interface: `Attachable`
Downloads an attachment.

Specified by:
  `downloadAttachment` in interface `Attachable`
Parameters:
  `attachmentId` -
Returns:
  attachment

### listAttachments

public org.gitana.platform.support.ResultMap<Attachment> listAttachments()

Specified by:
  `listAttachments` in interface `Attachable`
Returns:
  map of attachments

### getDownloadUri

public String getDownloadUri(String attachmentId)
Description copied from interface: `Attachable`
Acquires the download URI for the attachment

Specified by:
  `getDownloadUri` in interface `Attachable`
Parameters:
  `attachmentId` -
Returns:
  uri

### deleteAttachment

public void deleteAttachment()
Description copied from interface: `Attachable`
Deletes the default attachment.

Specified by:
  `deleteAttachment` in interface `Attachable`

### deleteAttachment

public void deleteAttachment(String attachmentId)
Description copied from interface: `Attachable`
Deletes an attachment.

Specified by:
  `deleteAttachment` in interface `Attachable`
Parameters:
  `attachmentId` -

### inviteUser

public void inviteUser(String userId)

Specified by:
  `inviteUser` in interface `Project`