All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nz.net.osnz.common.extjs.ExtTemplateResource Maven / Gradle / Ivy

The newest version!
package nz.net.osnz.common.extjs;

import nz.net.osnz.common.jsresource.ApplicationResource;
import nz.net.osnz.common.jsresource.ResourceScope;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.inject.Inject;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * @author Kefeng Deng
 */
@Component("extTemplateResource")
public class ExtTemplateResource implements ApplicationResource {

    private final static Logger LOG = LoggerFactory.getLogger(ExtTemplateResource.class);

    /**
     * Template service injected here
     */
    @Inject
    private ExtTemplateService extTemplates;

    /**
     * @return the global resource scope
     */
    @Override
    public List getResourceScope() {
        List resourceList = new ArrayList();
        resourceList.add(ResourceScope.Ext);
        return resourceList;
    }

    /**
     * @return a map of angular templates
     */
    @Override
    public Map getResourceMap() {
        Map map = new LinkedHashMap();
        map.put("extTemplates", extTemplates.getExtTemplates());
        return map;
    }

    @PostConstruct
    public void init() {
        LOG.debug( String.format("ExtTemplateResource status : %s", extTemplates != null) );
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy