Package org.criticalfailure.torchlight.core.campaign.services.so

Examples of org.criticalfailure.torchlight.core.campaign.services.so.CampaignSO


     */
    public CampaignSO translateTo(AbstractCampaign obj) {

        logger.debug("translate to: " + obj);

        CampaignSO vo = new CampaignSO();

        vo.setId(obj.getId());
        // vo.setGuid(obj.getGuid());
        vo.setType(obj.getTypeId());
        vo.setName(obj.getName());
        vo.setLabel(obj.getLabel());
        vo.setDescription(obj.getDescription());
        vo.setInception(obj.getInception());
        vo.setNotes(obj.getNotes());

        // vo.setVersionId(obj.getVersion() == null ? "" : obj.getVersion().getId());
        // vo.setSettingId(obj.getSetting() == null ? "" : obj.getSetting().getId());

        vo.setStorageType(obj.getStorageType());
        vo.setStorageUri(obj.getStorageUri().toString());
        vo.setStoragePrincipal(obj.getStoragePrincipal());
        vo.setStorageCredentials(obj.getStorageCredentials());

        vo.setCalendar(obj.getCalendar());

        Set<String> participants = new HashSet<String>();
        logger.debug("participants: " + obj.getParticipants().size());
        for(Participant p : obj.getParticipants()) {
            logger.trace("p: " + p);
            participants.add(p.getId());
        }
        vo.setParticipants(participants);

        Set<String> sections = new HashSet<String>();
        logger.debug("sections: " + obj.getSections().size());
        for(ObjectCategory oc : obj.getSections()) {
            logger.trace("oc: " + oc);
            sections.add(oc.getId());
        }
        vo.setSections(sections);

        Set<String> resources = new HashSet<String>();
        logger.debug("resources: " + obj.getResources().size());
        for(Resource r : obj.getResources()) {
            logger.trace("r: " + r);
            resources.add(r.getId());
        }
        vo.setLibraries(resources);

        Set<String> libraries = new HashSet<String>();
        logger.debug("libraries: " + obj.getLibraries().size());
        for(Library l : obj.getLibraries()) {
            logger.trace("l: " + l);
            libraries.add(l.getId());
        }
        vo.setLibraries(libraries);

        Set<String> templates = new HashSet<String>();
        logger.debug("templates: " + obj.getObjects().size());
        for(ObjectTemplate ot : obj.getObjects()) {
            logger.trace("ot: " + ot);
            templates.add(ot.getId());
        }
        vo.setObjects(templates);

        Set<String> instances = new HashSet<String>();
        logger.debug("instances: " + obj.getObjectInstances().size());
        for(ObjectInstance oi : obj.getObjectInstances()) {
            logger.trace("oi: " + oi);
            instances.add(oi.getId());
        }
        vo.setInstances(instances);

        Set<String> events = new HashSet<String>();
        logger.debug("events: " + obj.getTimeline().size());
        for(CampaignEvent ce : obj.getTimeline()) {
            logger.trace("ce: " + ce);
            events.add(ce.getId());
        }
        vo.setEvents(events);

        return vo;
    }
View Full Code Here


        try {
            String path = PathUtils.buildPath(storagePath, "campaigns", guid);
            logger.trace("path: " + path);

            XMLDecoder dec = new XMLDecoder(new BufferedInputStream(new FileInputStream(path)));
            CampaignSO vo = (CampaignSO)dec.readObject();
            logger.trace("campaignVO: " + vo);

            dec.close();

            doSetStatus(CampaignStorageConstants.STORAGE_STATUS_ONLINE);
View Full Code Here

TOP

Related Classes of org.criticalfailure.torchlight.core.campaign.services.so.CampaignSO

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.