Search in sources :

Example 6 with ImplDefinition

use of com.serotonin.m2m2.view.ImplDefinition in project ma-core-public by infiniteautomation.

the class DataPointDwr method getChartRendererOptions.

/**
 * Get a list of available Chart Renderers for this point
 *
 * @param vo
 * @return
 */
@DwrPermission(user = true)
public ProcessResult getChartRendererOptions(int dataTypeId) {
    ProcessResult response = new ProcessResult();
    List<ImplDefinition> list = BaseChartRenderer.getImplementations(dataTypeId);
    response.addData("options", list);
    return response;
}
Also used : ImplDefinition(com.serotonin.m2m2.view.ImplDefinition) ProcessResult(com.serotonin.m2m2.i18n.ProcessResult) DwrPermission(com.serotonin.m2m2.web.dwr.util.DwrPermission)

Example 7 with ImplDefinition

use of com.serotonin.m2m2.view.ImplDefinition in project ma-modules-public by infiniteautomation.

the class GraphicalViewDwr method editInit.

// 
// 
// View editing
// 
@DwrPermission(user = true)
public Map<String, Object> editInit() {
    Map<String, Object> result = new HashMap<String, Object>();
    User user = Common.getUser();
    // Users with which to share.
    // result.put("shareUsers", getShareUsers(user));
    // Users already sharing with.
    // Legacy code, can remove result.put("viewUsers", GraphicalViewsCommon.getUserEditView(user).getViewUsers());
    // View component types
    List<StringStringPair> components = new ArrayList<StringStringPair>();
    for (ImplDefinition impl : ViewComponent.getImplementations()) components.add(new StringStringPair(impl.getName(), translate(impl.getNameKey())));
    result.put("componentTypes", components);
    // Available points
    List<DataPointVO> allPoints = DataPointDao.instance.getDataPoints(DataPointExtendedNameComparator.instance, false);
    List<DataPointBean> availablePoints = new ArrayList<DataPointBean>();
    final boolean admin = Permissions.hasAdmin(user);
    for (DataPointVO dataPoint : allPoints) {
        if (admin || Permissions.hasDataPointReadPermission(user, dataPoint))
            availablePoints.add(new DataPointBean(dataPoint));
    }
    result.put("pointList", availablePoints);
    return result;
}
Also used : DataPointVO(com.serotonin.m2m2.vo.DataPointVO) StringStringPair(com.serotonin.db.pair.StringStringPair) ShareUser(com.serotonin.m2m2.view.ShareUser) AnonymousUser(com.serotonin.m2m2.vo.AnonymousUser) User(com.serotonin.m2m2.vo.User) ImplDefinition(com.serotonin.m2m2.view.ImplDefinition) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) DataPointBean(com.serotonin.m2m2.web.dwr.beans.DataPointBean) DwrPermission(com.serotonin.m2m2.web.dwr.util.DwrPermission)

Example 8 with ImplDefinition

use of com.serotonin.m2m2.view.ImplDefinition in project ma-modules-public by infiniteautomation.

the class ViewComponent method getExportTypes.

public static List<String> getExportTypes() {
    List<ImplDefinition> definitions = getImplementations();
    List<String> result = new ArrayList<String>(definitions.size());
    for (ImplDefinition def : definitions) result.add(def.getExportName());
    return result;
}
Also used : ImplDefinition(com.serotonin.m2m2.view.ImplDefinition) ArrayList(java.util.ArrayList)

Example 9 with ImplDefinition

use of com.serotonin.m2m2.view.ImplDefinition in project ma-core-public by infiniteautomation.

the class BaseChartRenderer method getExportTypes.

public static List<String> getExportTypes() {
    ensureDefinitions();
    List<String> result = new ArrayList<String>(definitions.size());
    for (ImplDefinition def : definitions) result.add(def.getExportName());
    return result;
}
Also used : ImplDefinition(com.serotonin.m2m2.view.ImplDefinition) ArrayList(java.util.ArrayList)

Aggregations

ImplDefinition (com.serotonin.m2m2.view.ImplDefinition)9 ArrayList (java.util.ArrayList)7 DwrPermission (com.serotonin.m2m2.web.dwr.util.DwrPermission)3 ProcessResult (com.serotonin.m2m2.i18n.ProcessResult)2 StringStringPair (com.serotonin.db.pair.StringStringPair)1 ShareUser (com.serotonin.m2m2.view.ShareUser)1 AnonymousUser (com.serotonin.m2m2.vo.AnonymousUser)1 DataPointVO (com.serotonin.m2m2.vo.DataPointVO)1 User (com.serotonin.m2m2.vo.User)1 DataPointBean (com.serotonin.m2m2.web.dwr.beans.DataPointBean)1 HashMap (java.util.HashMap)1