class ViewURLResourceProvider extends AbstractAuthorizedResourceProvider {

  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;
  }

  public  ViewURLResourceProvider();

}