Giter Club home page Giter Club logo

map's Introduction

How to integrate into your project

  1. clone the repo and put it into your plugins folder.

  2. modify the project pom.xml to include it

    <modules>
    	...
    	<module>plugins/map</module>
    </modules>
    
    
    <dependencies>
    	...
    	<dependency>
          <groupId>com.atex.plugins</groupId>
          <artifactId>map</artifactId>
          <version>1.2</version>
        </dependency>
        ...
        <dependency>
          <groupId>com.atex.plugins</groupId>
          <artifactId>map</artifactId>
          <version>1.2</version>
          <classifier>contentdata</classifier>
        </dependency>
        ...
    </dependencies>
    
  3. in you common content module specify the plugins configuration:

    id:plugins.com.atex.plugins.map.Config
    major:appconfig
    inputtemplate:com.atex.plugins.map.Configuration
    securityparent:p.siteengine.Configuration.d
    component:polopoly.Content:name:Map Configuration
    component:zoom:value:7
    component:mapheight:value:270px
    component:mapclass:value:v3_embed-content
    component:gmapregion:value:IT
    component:gmaplanguage:value:it
    
  4. There is a Map element that you can add on the page.

  5. Optionally you can inclue the map as a field of an existing element/article (do not forget to render it in the vm):

      <layout name="mapPage" input-template="p.Page" label="standard.Article.Map.Page">
        <param name="lazyInit">true</param>
    
        <field name="map" input-template="com.atex.plugins.map.MapWidget" label="standard.Article.Map.Widget">
        </field>
    
      </layout>
    
  6. To use it in ACT, you have to modify the policy (for example ArticlePolicy):

    @Override
    public ContentResult<ArticleBean> legacyToNew(final PolicyModelDomain modelDomain) throws CMException {
      ...
      return new ContentResult<>(
                      null,
                      ArticleBean.class.getName(),
                      new Aspect<>(ArticleBean.class.getName(), bean),
                      null,
                      null,
                      Arrays.<Aspect>asList(
                              new Aspect<>("atex.Metadata", getMetadataInfo()),
                              new Aspect<>(MapAspectBean.ASPECT_NAME, getMap())
                      ));
    }
    
    @Override
    public void newToLegacy(final ContentWrite<ArticleBean> dataWrite) throws CMException {
        ...
        MapAspectBean mapBean = dataWrite.getAspect(MapAspectBean.ASPECT_NAME,
                MapAspectBean.class);
        if (mapBean != null) {
            setMap(mapBean);
        }
    }
    
    public MapAspectBean getMap() {
        try {
            return MapAspectBeanUtil.getMapAspectBean(this);
        } catch (CMException e) {
            logger.log(Level.SEVERE, "cannot get map: " + e.getMessage(), e);
        }
        return null;
    }
    
    public void setMap(final MapAspectBean bean)
            throws CMException {
        MapAspectBeanUtil.setMapAspectBean(this, bean);
    }
    

    and you should add the dependency to source-common/pom.xml:

    <dependency>
      <groupId>com.atex.plugins</groupId>
      <artifactId>map</artifactId>
      <version>1.1</version>
    </dependency>
    
  7. You can use it in act too:

      "aspects": {
        "atex.Metadata": {},
        "com.atex.plugins.map.MapAspectBean": {}
      },
    
      "dataBindings": [
        {
          "label": "Map",
          "name": "map",
          "widget": "mapWidget",
    
          "config": {
            "height": "300px"
          },
    
          "domainObjects": {
            "point": "com.atex.plugins.map.MapAspectBean"
          }
        }  
      ]
    

map's People

Contributors

themnd avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.