Package net.cloudcodex.server.data.Data

Examples of net.cloudcodex.server.data.Data.Campaign


   * @param characterId character's id.
   * @return the character's header.
   */
  public CharacterSDO getCharacter(Context context, long campaignId, long characterId) {
   
    final Campaign campaign = dao.readCampaign(context, campaignId);
    if(campaign == null) {
      logger.severe("Campaign not found " + campaignId);
      context.addError(NOT_FOUND_CAMPAIGN, campaignId);
      return null;
    }

    final Key campaignKey = campaign.getKey();
    final Key characterKey = Data.Character.createKey(campaignKey, characterId);
   
    // Check the character exists
    final Data.Character character = dao.readCharacter(context, characterKey);
    if(character == null) {
View Full Code Here


    String description, String sheet, Boolean dead, Boolean locked,
    Map<Long, String> notes, Map<Long, String> aliases) {

    // Check the campaign and the master
    final Key campaignKey = Data.Campaign.createKey(campaignId);
    final Campaign campaign = dao.readCampaign(context, campaignKey);
    if(campaign == null) {
      logger.severe("Campaign not found " + campaignKey);
      context.addError(NOT_FOUND_CAMPAIGN, campaignId);
      return null;
    }
View Full Code Here

   
    if(summary == null) {
      return null;
    }
   
    final Campaign campaign = summary.getCampaign();
    final User master = summary.getMaster();
    final CampaignPublicSummaryDTO dto = new CampaignPublicSummaryDTO();
    dto.setId(campaign.getKey().getId());
    dto.setName(campaign.getName());
    dto.setIcon(campaign.getIcon());
    dto.setNotifications(mapNotification(
        summary.getNotifications(), NotificationType.CAMPAIGN));
    dto.setCreationDate(campaign.getDate());
    dto.setGameMasterNickname(master == null ? null : master.getNickname());
    return dto;
  }
View Full Code Here

   
    if(summary == null) {
      return null;
    }
   
    final Campaign campaign = summary.getCampaign();
    final User master = summary.getMaster();
    final CampaignSummaryDTO dto = new CampaignSummaryDTO();
    dto.setId(campaign.getKey().getId());
    dto.setName(campaign.getName());
    dto.setGame(campaign.getGame());
    dto.setIcon(campaign.getIcon());
    dto.setNotifications(mapNotification(
        summary.getNotifications(), NotificationType.CAMPAIGN));
    dto.setCreationDate(campaign.getDate());
    dto.setGameMasterNickname(master == null ? null : master.getNickname());
    dto.setGame(campaign.getGame());
   
    // iterate to keep only the names.
    final List<Data.Character> characters = summary.getCharacters();
    if(characters != null) {
      final List<String> names = new ArrayList<String>();
View Full Code Here

TOP

Related Classes of net.cloudcodex.server.data.Data.Campaign

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.