Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
Merge branch 'ABICLOUDPREMIUM-3713-categoriesWiki' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
zmalik committed Apr 25, 2012
2 parents 0d2187c + 9c1f35a commit 773d0a3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ public class CategoriesResource extends AbstractResource
* Returns all categories
*
* @title Retrieve all categories
* @wiki Returns the global categories by default. If you supply the id of a enterprise, the
* global categories and the local categories of the the given id will be retrieved. If no
* id is supplied, global categories will be retrieved. This feature is available from
* version 2.0-HF1
* @param idEnterprise If you supply the id of a enterprise, the global categories and the local
* categories of the the given enterprise will be retrieved. If no id is supplied,
* global categories will be retrieved.
* @since 2.0-HF1
* @param restBuilder a Context-injected object to create the links of the Dto
* @return a {CategoriesDto} object with all categories
* @throws Exception
Expand All @@ -91,8 +99,12 @@ public CategoriesDto getCategory(
}

/**
* Creates a category and returns it after creation
*
* @wiki Creates a category and returns it after creation. If you provide a link to the
* enterprise it will create a local category, and without any link in the dto it will try
* to create a global category. To create global category user must have the role
* APPLIB_MANAGE_GLOBAL_CATEGORIES. The division in local and global categories is
* available from versin 2.0-HF1
* @since 2.0-HF1
* @param categoryDto category to create
* @param builder a Context-injected object to create the links of the Dto
* @return a {CategoryDto} with the created category
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
import javax.xml.bind.annotation.XmlRootElement;

import com.abiquo.model.transport.SingleResourceTransportDto;
import com.abiquo.server.core.infrastructure.DatacenterDto;
import com.sun.xml.txw2.annotation.XmlElement;

@XmlRootElement(name = "category")
public class CategoryDto extends SingleResourceTransportDto
{
public static final String BASE_MEDIA_TYPE = "application/vnd.abiquo.category+xml";

public static final String MEDIA_TYPE = BASE_MEDIA_TYPE + "; version=" + API_VERSION;

private static final long serialVersionUID = 1L;

private Integer id;
Expand Down Expand Up @@ -89,11 +89,11 @@ public String getMediaType()
{
return CategoryDto.MEDIA_TYPE;
}

@Override
public String getBaseMediaType()
{
return BASE_MEDIA_TYPE;
}

}

0 comments on commit 773d0a3

Please sign in to comment.