protected Resource toResource(ViewURLEntity viewURLEntity) {
    Resource   resource   = new ResourceImpl(Resource.Type.ViewURL);

    resource.setProperty(URL_NAME,viewURLEntity.getUrlName());
    resource.setProperty(URL_SUFFIX,viewURLEntity.getUrlSuffix());
    ViewInstanceEntity viewInstanceEntity = viewURLEntity.getViewInstanceEntity();
    if(viewInstanceEntity == null)
      return resource;
    ViewEntity viewEntity = viewInstanceEntity.getViewEntity();
    String viewName = viewEntity.getCommonName();
    String version  = viewEntity.getVersion();
    String name     = viewInstanceEntity.getName();
    resource.setProperty(VIEW_INSTANCE_NAME,name);
    resource.setProperty(VIEW_INSTANCE_VERSION,version);
    resource.setProperty(VIEW_INSTANCE_COMMON_NAME,viewName);
    return resource;
  }
Converts a View URL entity into a Resource.
@param viewURLEntity
@return A resource object representing the URL
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ViewURLResourceProvider.java