jueves, 21 de agosto de 2014

2014 International Developer Summit Proceedings


En la siguiente dirección podrán encontrar muchas presentaciones y videos de ESRI 2014

http://proceedings.esri.com/library/userconf/devsummit14/


Hay muchas presentaciones por nombrar algunas una de ellas



Big Data: Using ArcGIS with Apache Hadoop
Presentación: https://s3.amazonaws.com/webapps.esri.com/esri-proceedings/devsummit14/papers/dev-062.pdf
Video: http://video.esri.com/iframe/3438/000000/width/960/0/000000

Esri on GitHub: How to Participate in Open-Source Projects
Presentación: https://s3.amazonaws.com/webapps.esri.com/esri-proceedings/devsummit14/papers/dev-032.pdf
Video: http://video.esri.com/iframe/3237/000000/width/960/0/000000


Entre otros, espero que sea de su interés.

martes, 19 de febrero de 2013

Cambiar Collation de Base de datos en MSSQLS


ALTER DATABASE geominingsuite2 SET SINGLE_USER WITH ROLLBACK IMMEDIATE
ALTER DATABASE geominingsuite2 COLLATE Modern_Spanish_CI_AS
ALTER DATABASE geominingsuite2 SET MULTI_USER

lunes, 11 de febrero de 2013

Problemas con sysproperties en Microsoft Sql Server 2008 y Power Designer

Hace poco tuve problemas generando los comentarios de tablas y columnas en el script generado desde Power Designer 16 para el DBMS Microsoft Sql Server 2008.

Ingresar a tools-->resources-->dbms
doble click en Microsoft SQL Server 2008
En caso de que que se tenga lo siguiente:

script-->objects->Table-->drop
if exists (select 1
            from  sysobjects
           where  id = object_id('[%QUALIFIER%]%TABLE%')
            and   type = 'U')
   drop table [%QUALIFIER%]%TABLE%

script-->objects-.>Table-->TableComment
[if exists (select 1
            from  sysproperties
           where  id = object_id('[%QUALIFIER%]%TABLE%')
            and   type = 3)
begin
   [%OWNER%?[.O:[execute ][exec ]]sp_dropextendedproperty [%R%?[N]]'MS_Description', 
   [%R%?[N]]'user', [%R%?[N]]%.q:OWNER%, [%R%?[N]]'table', [%R%?[N]]%.q:TABLE%
:declare @CurrentUser sysname
select @CurrentUser = user_name()
[.O:[execute ][exec ]]sp_dropextendedproperty [%R%?[N]]'MS_Description', 
   [%R%?[N]]'user', [%R%?[N]]@CurrentUser, [%R%?[N]]'table', [%R%?[N]]%.q:TABLE%
]
end


][%OWNER%?[.O:[execute ][exec ]]sp_addextendedproperty [%R%?[N]]'MS_Description', 
   [%R%?[N]]%.q:COMMENT%,
   [%R%?[N]]'user', [%R%?[N]]%.q:OWNER%, [%R%?[N]]'table', [%R%?[N]]%.q:TABLE%
:select @CurrentUser = user_name()
[.O:[execute ][exec ]]sp_addextendedproperty [%R%?[N]]'MS_Description', 
   [%R%?[N]]%.q:COMMENT%,
   [%R%?[N]]'user', [%R%?[N]]@CurrentUser, [%R%?[N]]'table', [%R%?[N]]%.q:TABLE%

script-->objects-->Column-->ColumnComment
[if exists (select 1
            from sysproperties
           where  id = object_id('[%QUALIFIER%]%TABLE%')
            and   type = 4)
begin
   [%OWNER%?[.O:[execute ][exec ]]sp_dropextendedproperty [%R%?[N]]'MS_Description',
   [%R%?[N]]'user', [%R%?[N]]%.q:OWNER%, [%R%?[N]]'table', [%R%?[N]]%.q:TABLE%, [%R%?[N]]'column', [%R%?[N]]%.q:COLUMN%
:declare @CurrentUser sysname
select @CurrentUser = user_name()
[.O:[execute ][exec ]]sp_dropextendedproperty [%R%?[N]]'MS_Description',
   [%R%?[N]]'user', [%R%?[N]]@CurrentUser, [%R%?[N]]'table', [%R%?[N]]%.q:TABLE%, [%R%?[N]]'column', [%R%?[N]]%.q:COLUMN%
]

end


][%OWNER%?[.O:[execute ][exec ]]sp_addextendedproperty [%R%?[N]]'MS_Description',
   [%R%?[N]]%.q:COMMENT%,
   [%R%?[N]]'user', [%R%?[N]]%.q:OWNER%, [%R%?[N]]'table', [%R%?[N]]%.q:TABLE%, [%R%?[N]]'column', [%R%?[N]]%.q:COLUMN%
:select @CurrentUser = user_name()
[.O:[execute ][exec ]]sp_addextendedproperty [%R%?[N]]'MS_Description',
   [%R%?[N]]%.q:COMMENT%,
   [%R%?[N]]'user', [%R%?[N]]@CurrentUser, [%R%?[N]]'table', [%R%?[N]]%.q:TABLE%, [%R%?[N]]'column', [%R%?[N]]%.q:COLUMN%
]



cambiar sysproperties (marcado en negrita) por (SELECT class AS id,Minor_id AS type,* from sys.extended_properties) _a


luego pulsar en OK, en la ventana de lista de DBMS, pulsar en Save all(guardar todo) y luego Close(cerrar)

Referencias: 
  1. http://blog.csdn.net/moranxue/article/details/7822532



martes, 29 de enero de 2013

Problemas con Portable Library

Hoy estuve publicando una aplicación donde uno de los proyectos es de tipo portable, el error fue que en el servidor donde he estado alojando no tiene visual studio mucho menos el portable library, después de navegar en google encontré la solución:

Error:
Could not load file or assembly 'System.Runtime.Serialization, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)

Solución:
http://stackoverflow.com/questions/5876200/portablelibrary-could-not-load-file-or-assembly?answertab=oldest#tab-top

Problema de referencia en Proyectos Silverlight

Hace poco tuve un incoveniente al compilar un proyecto en Silverlight con referencia a una .dll en red, después de navegar un poco pude encontrar lasolución, comparto el enlace de la solución:

http://stackoverflow.com/questions/11054563/cant-trust-a-project-dll-on-a-network-location?answertab=active#tab-top

miércoles, 13 de julio de 2011

Clase para generar Metadata en geonetwork según formato IDEP

/**
*
* Clase para generar la estructura del metadato en los diferentes formatos admitidos por GEONETWORK
* @author Joguer Tacas Misaico(tacasmisaico@gmail.com)
* @version 1.0.0
*
*/
class Metadata{
private $_xmlns;
private $_gmd;
private $_xsi;
private $_gml;
private $_gts;
private $_gco;
private $_geonet;
private $_codeList;
private $_srv;
/**
*
* Método constructor que inicializa los atributos estáticos
*/
public function __construct(){
$this->_xmlns = 'http://www.w3.org/2000/xmlns/';
$this->_gmd = 'http://www.isotc211.org/2005/gmd';
$this->_xsi = 'http://www.w3.org/2001/XMLSchema-instance';
$this->_gml = 'http://www.opengis.net/gml';
$this->_gts = 'http://www.isotc211.org/2005/gts';
$this->_gco = 'http://www.isotc211.org/2005/gco';
$this->_geonet = 'http://www.fao.org/geonetwork';
$this->_codeList = 'http://www.isotc211.org/2005/resources/codeList.xml';
$this->_srv = 'http://www.isotc211.org/2005/srv';
}
/**
*
* Método que se encarga de generar la estructura del xml a almacenar como metadata del documento
* @access private
* @param
* @return DOMDocument
*/
public function generate19139($pName, $pDateTime, $pAbstract, $pGUID, $pLanguage,
$pAuthorName, $pAuthorEntity, $pAuthorEmail, $pProviderName, $pProviderEntity,
$pProviderEmail, $pKeywords, $pUrlDocument, $pFormat, $pVersion,
$pLogo, $pCategory, $pNorma, $pRSIdentifier, $pRSCode){
$doc=new DOMDocument();
$doc->preserveWhiteSpace=false;
$doc->formatOutput=true;
$mdMetadata=$doc->createElementNS($this->_gmd,'gmd:MD_Metadata');
$mdMetadata->setAttributeNS($this->_xmlns, 'xmlns:xsi', $this->_xsi);
$mdMetadata->setAttributeNS($this->_xmlns, 'xmlns:gml', $this->_gml);
$mdMetadata->setAttributeNS($this->_xmlns, 'xmlns:gts', $this->_gts);
$mdMetadata->setAttributeNS($this->_xmlns, 'xmlns:gco', $this->_gco);
$mdMetadata->setAttributeNS($this->_xmlns, 'xmlns:geonet', $this->_geonet);
$doc->appendChild($mdMetadata);


$fileIdentifier = $doc->createElementNS($this->_gmd, 'fileIdentifier');
$mdMetadata->appendChild($fileIdentifier);
$characterString = $doc->createElementNS($this->_gco, 'CharacterString',$pGUID);
$fileIdentifier->appendChild($characterString);

$language=$doc->createElementNS($this->_gmd,'language');
$mdMetadata->appendChild($language);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString','spa');
$language->appendChild($characterString);

$characterSet=$doc->createElementNS($this->_gmd, 'characterSet');
$mdMetadata->appendChild($characterSet);
$mdCharacterSetCode=$doc->createElementNS($this->_gmd,'MD_CharacterSetCode');
$mdCharacterSetCode->setAttribute('codeListValue', 'utf8');
$mdCharacterSetCode->setAttribute('codeList', $this->_codeList.'#MD_CharacterSetCode');
$characterSet->appendChild($mdCharacterSetCode);

$contact= $doc->createElementNS($this->_gmd,'contact');
$mdMetadata->appendChild($contact);
$ciResponsibleParty=$doc->createElementNS($this->_gmd, 'CI_ResponsibleParty');
$contact->appendChild($ciResponsibleParty);

$individualName=$doc->createElementNS($this->_gmd,'individualName');
$ciResponsibleParty->appendChild($individualName);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString',$pAuthorName);//nombre del autor
$individualName->appendChild($characterString);

$organisationName=$doc->createElementNS($this->_gmd, 'organisationName');
$ciResponsibleParty->appendChild($organisationName);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString',$pAuthorEntity);//institucion del autor
$organisationName->appendChild($characterString);

$contactInfo=$doc->createElementNS($this->_gmd,'contactInfo');
$ciResponsibleParty->appendChild($contactInfo);
$ciContact=$doc->createElementNS($this->_gmd, 'CI_Contact');
$contactInfo->appendChild($ciContact);

$phone=$doc->createElementNS($this->_gmd,'phone');
$ciContact->appendChild($phone);
$ciTelephone=$doc->createElementNS($this->_gmd, 'CI_Telephone');
$phone->appendChild($ciTelephone);

$address=$doc->createElementNS($this->_gmd, 'address');
$ciContact->appendChild($address);
$ciAddress=$doc->createElementNS($this->_gmd,'CI_Address');
$address->appendChild($ciAddress);
$electronicMailAddress=$doc->createElementNS($this->_gmd,'electronicMailAddress');
$ciAddress->appendChild($electronicMailAddress);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString',$pAuthorEmail);//correo electronico del author
$electronicMailAddress->appendChild($characterString);

$role= $doc->createElementNS($this->_gmd,'role');
$ciResponsibleParty->appendChild($role);
$ciRoleCode= $doc->createElementNS($this->_gmd,'CI_RoleCode');
$ciRoleCode->setAttribute('codeListValue', '001');
$ciRoleCode->setAttribute('codeList', $this->_codeList.'#CI_RoleCode');
$role->appendChild($ciRoleCode);

$dateStamp= $doc->createElementNS($this->_gmd,'dateStamp');
$mdMetadata->appendChild($dateStamp);
$dateTime=$doc->createElementNS($this->_gco,'DateTime',$pDateTime);//fecha del metadato
$dateTime->setAttributeNS($this->_xmlns,'xmlns:srv', $this->_srv);
$dateStamp->appendChild($dateTime);

$metadataStandardName=$doc->createElementNS($this->_gmd, 'metadataStandardName');
$mdMetadata->appendChild($metadataStandardName);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString','ISO 19115:2003/19139');
$characterString->setAttributeNS($this->_xmlns,'xmlns:srv', $this->_srv);
$metadataStandardName->appendChild($characterString);

$metadataStandardVersion=$doc->createElementNS($this->_gmd, 'metadataStandardVersion');
$mdMetadata->appendChild($metadataStandardVersion);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString','1.0');
$characterString->setAttributeNS($this->_xmlns,'xmlns:srv', $this->_srv);
$metadataStandardVersion->appendChild($characterString);

$spatialRepresentationInfo=$doc->createElementNS($this->_gmd,'spatialRepresentationInfo');
$mdMetadata->appendChild($spatialRepresentationInfo);
$mdVectorSpatialRepresentation=$doc->createElementNS($this->_gmd,'MD_VectorSpatialRepresentation');
$spatialRepresentationInfo->appendChild($mdVectorSpatialRepresentation);
$topologyLevel =$doc->createElementNS($this->_gmd, 'topologyLevel');
$mdVectorSpatialRepresentation->appendChild($topologyLevel);

$mdTopologyLevelCode=$doc->createElementNS($this->_gmd,'MD_TopologyLevelCode');
$mdTopologyLevelCode->setAttribute('codeListValue', '001');
$mdTopologyLevelCode->setAttribute('codeList', $this->_codeList.'#MD_TopologyLevelCode');
$topologyLevel->appendChild($mdTopologyLevelCode);

$geometricObjects=$doc->createElementNS($this->_gmd, 'geometricObjects');
$mdVectorSpatialRepresentation->appendChild($geometricObjects);
$mdgeometricObjects=$doc->createElementNS($this->_gmd,'MD_GeometricObjects');
$geometricObjects->appendChild($mdgeometricObjects);
$geometricObjectType=$doc->createElementNS($this->_gmd, 'geometricObjectType');
$mdgeometricObjects->appendChild($geometricObjectType);

$mdGeometricObjectTypeCode=$doc->createElementNS($this->_gmd,'MD_GeometricObjectTypeCode');
$mdGeometricObjectTypeCode->setAttribute('codeListValue', '001');
$mdGeometricObjectTypeCode->setAttribute('codeList', $this->_codeList.'#MD_GeometricObjectTypeCode');
$geometricObjectType->appendChild($mdGeometricObjectTypeCode);

$referenceSystemInfo =$doc->createElementNS($this->_gmd,'referenceSystemInfo');
$mdMetadata->appendChild($referenceSystemInfo);
$mdReferenceSystem= $doc->createElementNS($this->_gmd,'MD_ReferenceSystem');
$referenceSystemInfo->appendChild($mdReferenceSystem);

$referenceSysemIdentifier=$doc->createElementNS($this->_gmd,'referenceSystemIdentifier');
$mdReferenceSystem->appendChild($referenceSysemIdentifier);
$rsIdentifier=$doc->createElementNS($this->_gmd, 'RS_Identifier');
$referenceSysemIdentifier->appendChild($rsIdentifier);
$code=$doc->createElementNS($this->_gmd,'code');
$rsIdentifier->appendChild($code);
$characterString=$doc->createElementNS($this->_gco,'CharacterString',$pRSIdentifier); //RS Identifier
$code->appendChild($characterString);
$codeSpace=$doc->createElementNS($this->_gmd,'codeSpace');
$rsIdentifier->appendChild($codeSpace);
$characterString=$doc->createElementNS($this->_gco,'CharacterString',$pRSCode); //WGS 84 Zone
$codeSpace->appendChild($characterString);

$identificationInfo =$doc->createElementNS($this->_gmd, 'identificationInfo');
$mdMetadata->appendChild($identificationInfo);
$mdDataIdentification = $doc->createElementNS($this->_gmd,'MD_DataIdentification');
$identificationInfo->appendChild($mdDataIdentification);

$citation=$doc->createElementNS($this->_gmd,'citation');
$mdDataIdentification->appendChild($citation);
$ciCitation =$doc->createElementNS($this->_gmd, 'CI_Citation');
$citation->appendChild($ciCitation);
$title=$doc->createElementNS($this->_gmd, 'title');
$ciCitation->appendChild($title);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString',$pName);//nombre de metadato
$title->appendChild($characterString);
$date =$doc->createElementNS($this->_gmd,'date');
$ciCitation->appendChild($date);
$ciDate=$doc->createElementNS($this->_gmd,'CI_Date');
$date->appendChild($ciDate);
$date =$doc->createElementNS($this->_gmd,'date');
$ciDate->appendChild($date);
$dateTime=$doc->createElementNS($this->_gco,'DateTime',$pDateTime);//fecha
$date->appendChild($dateTime);
$dateType=$doc->createElementNS($this->_gmd,'dateType');
$ciDate->appendChild($dateType);
$ciDateTypeCode= $doc->createElementNS($this->_gmd,'CI_DateTypeCode');
$ciDateTypeCode->setAttribute('codeListValue', '001');
$ciDateTypeCode->setAttribute('codeList', $this->_codeList.'#CI_DateTypeCode');
$dateType->appendChild($ciDateTypeCode);
$presentationForm= $doc->createElementNS($this->_gmd, 'presentationForm');
$ciCitation->appendChild($presentationForm);
$ciPresentationFormCode=$doc->createElementNS($this->_gmd,'CI_PresentationFormCode');
$ciPresentationFormCode->setAttribute('codeListValue', '005');
$ciPresentationFormCode->setAttribute('codeList', $this->_codeList.'#CI_PresentationFormCode');
$presentationForm->appendChild($ciPresentationFormCode);

$abstract=$doc->createElementNS($this->_gmd,'abstract');
$mdDataIdentification->appendChild($abstract);
$characterString=$doc->createElementNS($this->_gco,'CharacterString',$pAbstract);//resumen
$abstract->appendChild($characterString);

$status = $doc->createElementNS($this->_gmd, 'status');
$mdDataIdentification->appendChild($status);
$mdProgressCode=$doc->createElementNS($this->_gmd, 'MD_ProgressCode');
$mdProgressCode->setAttribute('codeListValue', '001');
$mdProgressCode->setAttribute('codeList', $this->_codeList.'#MD_ProgressCode');
$status->appendChild($mdProgressCode);

$pointOfContact=$doc->createElementNS($this->_gmd,'pointOfContact');
$mdDataIdentification->appendChild($pointOfContact);
$ciResponsibleParty=$doc->createElementNS($this->_gmd,'CI_ResponsibleParty');
$pointOfContact->appendChild($ciResponsibleParty);
$individualName=$doc->createElementNS($this->_gmd,'individualName');
$ciResponsibleParty->appendChild($individualName);
$characterString=$doc->createElementNS($this->_gco,'CharacterString', $pProviderName);//author del dato
$individualName->appendChild($characterString);
$organisationName= $doc->createElementNS($this->_gmd, 'organisationName');
$ciResponsibleParty->appendChild($organisationName);
$characterString=$doc->createElementNS($this->_gco,'CharacterString', $pProviderEntity);//institucion del author
$organisationName->appendChild($characterString);

$contactInfo=$doc->createElementNS($this->_gmd,'contactInfo');
$ciResponsibleParty->appendChild($contactInfo);
$ciContact=$doc->createElementNS($this->_gmd, 'CI_Contact');
$contactInfo->appendChild($ciContact);

$phone=$doc->createElementNS($this->_gmd,'phone');
$ciContact->appendChild($phone);
$ciTelephone=$doc->createElementNS($this->_gmd, 'CI_Telephone');
$phone->appendChild($ciTelephone);

$address = $doc->createElementNS($this->_gmd, 'address');
$ciContact->appendChild($address);
$ciAddress = $doc->createElementNS($this->_gmd,'CI_Address');
$address->appendChild($ciAddress);
$electronicMailAddress = $doc->createElementNS($this->_gmd,'electronicMailAddress');
$ciAddress->appendChild($electronicMailAddress);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString',$pProviderEmail);//correo electronico del author
$electronicMailAddress->appendChild($characterString);

$role= $doc->createElementNS($this->_gmd,'role');
$ciResponsibleParty->appendChild($role);
$ciRoleCode = $doc->createElementNS($this->_gmd,'CI_RoleCode');
$ciRoleCode->setAttribute('codeListValue', '002');
$ciRoleCode->setAttribute('codeList', $this->_codeList.'#CI_RoleCode');
$role->appendChild($ciRoleCode);

$graphicOverview = $doc->createElementNS($this->_gmd, 'graphicOverview');
$mdDataIdentification->appendChild($graphicOverview);
$mdBrowseGraphic = $doc->createElementNS($this->_gmd,'MD_BrowseGraphic');
$graphicOverview->appendChild($mdBrowseGraphic);
$fileName = $doc->createElementNS($this->_gmd, 'fileName');
$mdBrowseGraphic->appendChild($fileName);
$characterString = $doc->createElementNS($this->_gco,'CharacterString',$pLogo);//logo de la institucion
$fileName->appendChild($characterString);
$fileDescription=$doc->createElementNS($this->_gmd,'fileDescription');
$mdBrowseGraphic->appendChild($fileDescription);
$characterString = $doc->createElementNS($this->_gco,'CharacterString','thumbnail');
$fileDescription->appendChild($characterString);
$fileType=$doc->createElementNS($this->_gmd,'fileType');
$mdBrowseGraphic->appendChild($fileType);
$characterString = $doc->createElementNS($this->_gco,'CharacterString','png');
$fileType->appendChild($characterString);

$descriptiveKeywords = $doc->createElementNS($this->_gmd,'descriptiveKeywords');
$mdDataIdentification->appendChild($descriptiveKeywords);
$mdKeywords=$doc->createElementNS($this->_gmd,'MD_Keywords');
$descriptiveKeywords->appendChild($mdKeywords);
$keyword = $doc->createElementNS($this->_gmd, 'keyword');
$mdKeywords->appendChild($keyword);
$characterString = $doc->createElementNS($this->_gco,'CharacterString',$pKeywords);//keywords
$keyword->appendChild($characterString);
$type = $doc->createElementNS($this->_gmd,'type');
$mdKeywords->appendChild($type);
$mdKeywordTypeCode=$doc->createElementNS($this->_gmd, 'MD_KeywordTypeCode');
$mdKeywordTypeCode->setAttribute('codeListValue', '005');
$mdKeywordTypeCode->setAttribute('codeList', $this->_codeList.'#MD_KeywordTypeCode');
$type->appendChild($mdKeywordTypeCode);

$spatialRepresentationType = $doc->createElementNS($this->_gmd, 'spatialRepresentationType');
$mdDataIdentification->appendChild($spatialRepresentationType);
$mdSpatialRepresentationTypeCode= $doc->createElementNS($this->_gmd, 'MD_SpatialRepresentationTypeCode');
$mdSpatialRepresentationTypeCode->setAttribute('codeListValue', '001');
$mdSpatialRepresentationTypeCode->setAttribute('codeList', $this->_codeList.'#MD_SpatialRepresentationTypeCode');
$spatialRepresentationType->appendChild($mdSpatialRepresentationTypeCode);

$spatialResolution = $doc->createElementNS($this->_gmd, 'spatialResolution');
$mdDataIdentification->appendChild($spatialResolution);
$mdResolution = $doc->createElementNS($this->_gmd,'MD_Resolution');
$spatialResolution->appendChild($mdResolution);
$equivalentScale= $doc->createElementNS($this->_gmd,'equivalentScale');
$mdResolution->appendChild($equivalentScale);
$mdRepresentativeFraction = $doc->createElementNS($this->_gmd,'MD_RepresentativeFraction');
$equivalentScale->appendChild($mdRepresentativeFraction);
$denominator= $doc->createElementNS($this->_gmd,'denominator');
$mdRepresentativeFraction->appendChild($denominator);
$integer = $doc->createElementNS($this->_gco,'Integer','50000');//la scala
$denominator->appendChild($integer);

$language = $doc->createElementNS($this->_gmd,'language');
$mdDataIdentification->appendChild($language);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString',$pLanguage);//idioma
$language->appendChild($characterString);

$characterSet = $doc->createElementNS($this->_gmd, 'characterSet');
$mdDataIdentification->appendChild($characterSet);
$mdCharacterSetCode = $doc->createElementNS($this->_gmd,'MD_CharacterSetCode');
$mdCharacterSetCode->setAttribute('codeListValue', 'utf8');
$mdCharacterSetCode->setAttribute('codeList', $this->_codeList.'#MD_CharacterSetCode');
$characterSet->appendChild($mdCharacterSetCode);

$topicCategory = $doc->createElementNS($this->_gmd,'topicCategory');
$mdDataIdentification->appendChild($topicCategory);
$mdTopicCategoryCode = $doc->createElementNS($this->_gmd,'MD_TopicCategoryCode',$pCategory);//categoría
$topicCategory->appendChild($mdTopicCategoryCode);

$extent = $doc->createElementNS($this->_gmd,'extent');
$mdDataIdentification->appendChild($extent);
$exExtent = $doc->createElementNS($this->_gmd, 'EX_Extent');
$extent->appendChild($exExtent);
$geographicElement = $doc->createElementNS($this->_gmd, 'geographicElement');
$exExtent->appendChild($geographicElement);
$exGeographicBoundingBox = $doc->createElementNS($this->_gmd,'EX_GeographicBoundingBox');
$geographicElement->appendChild($exGeographicBoundingBox);
$westBoundLongitude = $doc->createElementNS($this->_gmd,'westBoundLongitude');
$exGeographicBoundingBox->appendChild($westBoundLongitude);
$decimal = $doc->createElementNS($this->_gco,'Decimal', -81.35515);
$westBoundLongitude->appendChild($decimal);

$eastBoundLongitude = $doc->createElementNS($this->_gmd,'eastBoundLongitude');
$exGeographicBoundingBox->appendChild($eastBoundLongitude);
$decimal = $doc->createElementNS($this->_gco,'Decimal', -68.6739);
$eastBoundLongitude->appendChild($decimal);

$southBoundLatitude = $doc->createElementNS($this->_gmd,'southBoundLatitude');
$exGeographicBoundingBox->appendChild($southBoundLatitude);
$decimal = $doc->createElementNS($this->_gco,'Decimal', -18.34855);
$southBoundLatitude->appendChild($decimal);

$northBoundLatitude = $doc->createElementNS($this->_gmd,'northBoundLatitude');
$exGeographicBoundingBox->appendChild($northBoundLatitude);
$decimal = $doc->createElementNS($this->_gco,'Decimal', -0.03687);
$northBoundLatitude->appendChild($decimal);

$distributionInfo = $doc->createElementNS($this->_gmd, 'distributionInfo');
$mdMetadata->appendChild($distributionInfo);
$mdDistribution = $doc->createElementNS($this->_gmd, 'MD_Distribution');
$distributionInfo->appendChild($mdDistribution);
$distributionFormat = $doc->createElementNS($this->_gmd, 'distributionFormat');
$mdDistribution->appendChild($distributionFormat);
$mdFormat = $doc->createElementNS($this->_gmd,'MD_Format');
$distributionFormat->appendChild($mdFormat);
$name = $doc->createElementNS($this->_gmd,'name');
$mdFormat->appendChild($name);
$characterString = $doc->createElementNS($this->_gco,'CharacterString', $pFormat);//formato
$name->appendChild($characterString);
$version = $doc->createElementNS($this->_gmd,'version');
$mdFormat->appendChild($version);
$characterString = $doc->createElementNS($this->_gco,'CharacterString', $pVersion);//version
$version->appendChild($characterString);

$transferOptions = $doc->createElementNS($this->_gmd, 'transferOptions');
$mdDistribution->appendChild($transferOptions);
$mdDigitalTransferOptions = $doc->createElementNS($this->_gmd, 'MD_DigitalTransferOptions');
$transferOptions->appendChild($mdDigitalTransferOptions);

$onLine = $doc->createElementNS($this->_gmd, 'onLine');
$mdDigitalTransferOptions->appendChild($onLine);
$ciOnLineResource = $doc->createElementNS($this->_gmd, 'CI_OnlineResource');
$onLine->appendChild($ciOnLineResource);
$linkAge = $doc->createElementNS($this->_gmd, 'linkage');
$ciOnLineResource->appendChild($linkAge);
$url = $doc->createElementNS($this->_gmd, 'URL',$pUrlDocument); //url
$linkAge->appendChild($url);
$protocol = $doc->createElementNS($this->_gmd, 'protocol');
$ciOnLineResource->appendChild($protocol);
$characterString = $doc->createElementNS($this->_gco,'CharacterString','WWW:LINK-1.0-http--link' ); //protocolo
$protocol->appendChild($characterString);
$name = $doc->createElementNS($this->_gmd, 'name');
$name->setAttribute('gco:nilReason', 'missing');
$ciOnLineResource->appendChild($name);
$characterString = $doc->createElementNS($this->_gco,'CharacterString');
$name->appendChild($characterString);

$onLine = $doc->createElementNS($this->_gmd, 'onLine');
$mdDigitalTransferOptions->appendChild($onLine);
$ciOnLineResource = $doc->createElementNS($this->_gmd, 'CI_OnlineResource');
$onLine->appendChild($ciOnLineResource);
$linkAge = $doc->createElementNS($this->_gmd, 'linkage');
$ciOnLineResource->appendChild($linkAge);
$url = $doc->createElementNS($this->_gmd, 'URL',''); //url wms
$linkAge->appendChild($url);
$protocol = $doc->createElementNS($this->_gmd, 'protocol');
$ciOnLineResource->appendChild($protocol);
$characterString = $doc->createElementNS($this->_gco,'CharacterString','' ); //protocolo OGC:WMS-1.1.1-http-get-map
$protocol->appendChild($characterString);
$name = $doc->createElementNS($this->_gmd, 'name');
$ciOnLineResource->appendChild($name);
$characterString = $doc->createElementNS($this->_gco,'CharacterString','');//Nombre de capas o layer separado por comas
$name->appendChild($characterString);
$description = $doc->createElementNS($this->_gmd, 'description');
$ciOnLineResource->appendChild($description);
$characterString = $doc->createElementNS($this->_gco,'CharacterString','');//Url del servicio WMS o Descripcion del servicio
$description->appendChild($characterString);

$dataQualityInfo = $doc->createElementNS($this->_gmd,'dataQualityInfo');
$mdMetadata->appendChild($dataQualityInfo);
$dqDataQuality = $doc->createElementNS($this->_gmd, 'DQ_DataQuality');
$dataQualityInfo->appendChild($dqDataQuality);
$scope = $doc->createElementNS($this->_gmd, 'scope');
$dqDataQuality->appendChild($scope);
$dqScope = $doc->createElementNS($this->_gmd,'DQ_Scope');
$scope->appendChild($dqScope);
$level = $doc->createElementNS($this->_gmd,'level');
$dqScope->appendChild($level);
$mdScopeCode = $doc->createElementNS($this->_gmd, 'MD_ScopeCode');
$mdScopeCode->setAttribute('codeListValue', '001');
$mdScopeCode->setAttribute('codeList', $this->_codeList.'#MD_ScopeCode');
$level->appendChild($mdScopeCode);
$lineage = $doc->createElementNS($this->_gmd,'lineage');
$dqDataQuality->appendChild($lineage);
$liLineage = $doc->createElementNS($this->_gmd, 'LI_Lineage');
$lineage->appendChild($liLineage);
$statement = $doc->createElementNS($this->_gmd, 'statement');
$liLineage->appendChild($statement);
$characterString = $doc->createElementNS($this->_gco, 'CharacterString',$pNorma); // norma de los metadatos
$statement->appendChild($characterString);

$metadataConstraints = $doc->createElementNS($this->_gmd,'metadataConstraints');
$mdMetadata->appendChild($metadataConstraints);
$mdLegalConstraints = $doc->createElementNS($this->_gmd, 'MD_LegalConstraints');
$metadataConstraints->appendChild($mdLegalConstraints);
$accessConstraints = $doc->createElementNS($this->_gmd, 'accessConstraints');
$mdLegalConstraints->appendChild($accessConstraints);
$mdRestrictionCode = $doc->createElementNS($this->_gmd, 'MD_RestrictionCode');
$mdRestrictionCode->setAttribute('codeListValue', '001');
$mdRestrictionCode->setAttribute('codeList', $this->_codeList.'#MD_RestrictionCode');
$accessConstraints->appendChild($mdRestrictionCode);
$useConstraints = $doc->createElementNS($this->_gmd, 'useConstraints');
$mdLegalConstraints->appendChild($useConstraints);
$mdRestrictionCode = $doc->createElementNS($this->_gmd, 'MD_RestrictionCode');
$mdRestrictionCode->setAttribute('codeListValue', '001');
$mdRestrictionCode->setAttribute('codeList', $this->_codeList.'#MD_RestrictionCode');
$useConstraints->appendChild($mdRestrictionCode);
$otherConstraints = $doc->createElementNS($this->_gmd,'otherConstraints');
$mdLegalConstraints->appendChild($otherConstraints);
$characterString = $doc->createElementNS($this->_gco,'CharacterString', '');//otras restricciones
$otherConstraints->appendChild($characterString);

$metadataMaintenance = $doc->createElementNS($this->_gmd, 'metadataMaintenance');
$mdMetadata->appendChild($metadataMaintenance);
$mdMaintenanceInformation = $doc->createElementNS($this->_gmd, 'MD_MaintenanceInformation');
$metadataMaintenance->appendChild($mdMaintenanceInformation);
$maintenanceAndUpdateFrequency = $doc->createElementNS($this->_gmd, 'maintenanceAndUpdateFrequency');
$mdMaintenanceInformation->appendChild($maintenanceAndUpdateFrequency);
$mdMaintenanceFrequencyCode = $doc->createElementNS($this->_gmd,'MD_MaintenanceFrequencyCode');
$mdMaintenanceFrequencyCode->setAttribute('codeListValue', '001');
$mdMaintenanceFrequencyCode->setAttribute('codeList', $this->_codeList.'#MD_MaintenanceFrequencyCode');
$maintenanceAndUpdateFrequency->appendChild($mdMaintenanceFrequencyCode);
$metadata= $doc->saveXML($mdMetadata);
return $metadata;
}
public function generate191392($name,$dateTime,$abstract, $authorName,$authorEntity,$authorEmail,
$providerName,$providerEntity,$providerEmail,$logo,$keywords, $category, $formato, $version, $urlDocument,$norma){
$doc=new DOMDocument();
$doc->preserveWhiteSpace=false;
$doc->formatOutput=true;
$mdMetadata=$doc->createElementNS($this->_gmd,'gmd:MD_Metadata');
$mdMetadata->setAttributeNS($this->_xmlns, 'xmlns:xsi', $this->_xsi);
$mdMetadata->setAttributeNS($this->_xmlns, 'xmlns:gml', $this->_gml);
$mdMetadata->setAttributeNS($this->_xmlns, 'xmlns:gts', $this->_gts);
$mdMetadata->setAttributeNS($this->_xmlns, 'xmlns:gco', $this->_gco);
$mdMetadata->setAttributeNS($this->_xmlns, 'xmlns:geonet', $this->_geonet);
$doc->appendChild($mdMetadata);


$fileIdentifier = $doc->createElementNS($this->_gmd, 'fileIdentifier');
$mdMetadata->appendChild($fileIdentifier);
$characterString = $doc->createElementNS($this->_gco, 'CharacterString','0e677227-c1be-4b16-bfe9-4c4d0b81ac98');
$fileIdentifier->appendChild($characterString);

$language=$doc->createElementNS($this->_gmd,'language');
$mdMetadata->appendChild($language);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString','spa');
$language->appendChild($characterString);

$characterSet=$doc->createElementNS($this->_gmd, 'characterSet');
$mdMetadata->appendChild($characterSet);
$mdCharacterSetCode=$doc->createElementNS($this->_gmd,'MD_CharacterSetCode');
$mdCharacterSetCode->setAttribute('codeListValue', 'utf8');
$mdCharacterSetCode->setAttribute('codeList', $this->_codeList.'#MD_CharacterSetCode');
$characterSet->appendChild($mdCharacterSetCode);

$contact= $doc->createElementNS($this->_gmd,'contact');
$mdMetadata->appendChild($contact);
$ciResponsibleParty=$doc->createElementNS($this->_gmd, 'CI_ResponsibleParty');
$contact->appendChild($ciResponsibleParty);

$individualName=$doc->createElementNS($this->_gmd,'individualName');
$ciResponsibleParty->appendChild($individualName);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString','Nombre del autor del Metadato');//nombre del autor
$individualName->appendChild($characterString);

$organisationName=$doc->createElementNS($this->_gmd, 'organisationName');
$ciResponsibleParty->appendChild($organisationName);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString','Institución al que pertenece');//institucion del autor
$organisationName->appendChild($characterString);

$contactInfo=$doc->createElementNS($this->_gmd,'contactInfo');
$ciResponsibleParty->appendChild($contactInfo);
$ciContact=$doc->createElementNS($this->_gmd, 'CI_Contact');
$contactInfo->appendChild($ciContact);

$phone=$doc->createElementNS($this->_gmd,'phone');
$ciContact->appendChild($phone);
$ciTelephone=$doc->createElementNS($this->_gmd, 'CI_Telephone');
$phone->appendChild($ciTelephone);

$address=$doc->createElementNS($this->_gmd, 'address');
$ciContact->appendChild($address);
$ciAddress=$doc->createElementNS($this->_gmd,'CI_Address');
$address->appendChild($ciAddress);
$electronicMailAddress=$doc->createElementNS($this->_gmd,'electronicMailAddress');
$ciAddress->appendChild($electronicMailAddress);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString','correo@institucion.gob.pe');//correo electronico del author
$electronicMailAddress->appendChild($characterString);

$role= $doc->createElementNS($this->_gmd,'role');
$ciResponsibleParty->appendChild($role);
$ciRoleCode= $doc->createElementNS($this->_gmd,'CI_RoleCode');
$ciRoleCode->setAttribute('codeListValue', '001');
$ciRoleCode->setAttribute('codeList', $this->_codeList.'#CI_RoleCode');
$role->appendChild($ciRoleCode);

$dateStamp= $doc->createElementNS($this->_gmd,'dateStamp');
$mdMetadata->appendChild($dateStamp);
$dateTime=$doc->createElementNS($this->_gco,'DateTime','2008-10-17T13:00:17');//fecha del metadato
$dateTime->setAttributeNS($this->_xmlns,'xmlns:srv', $this->_srv);
$dateStamp->appendChild($dateTime);

$metadataStandardName=$doc->createElementNS($this->_gmd, 'metadataStandardName');
$mdMetadata->appendChild($metadataStandardName);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString','ISO 19115:2003/19139');
$characterString->setAttributeNS($this->_xmlns,'xmlns:srv', $this->_srv);
$metadataStandardName->appendChild($characterString);

$metadataStandardVersion=$doc->createElementNS($this->_gmd, 'metadataStandardVersion');
$mdMetadata->appendChild($metadataStandardVersion);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString','1.0');
$characterString->setAttributeNS($this->_xmlns,'xmlns:srv', $this->_srv);
$metadataStandardVersion->appendChild($characterString);

$spatialRepresentationInfo=$doc->createElementNS($this->_gmd,'spatialRepresentationInfo');
$mdMetadata->appendChild($spatialRepresentationInfo);
$mdVectorSpatialRepresentation=$doc->createElementNS($this->_gmd,'MD_VectorSpatialRepresentation');
$spatialRepresentationInfo->appendChild($mdVectorSpatialRepresentation);
$topologyLevel =$doc->createElementNS($this->_gmd, 'topologyLevel');
$mdVectorSpatialRepresentation->appendChild($topologyLevel);

$mdTopologyLevelCode=$doc->createElementNS($this->_gmd,'MD_TopologyLevelCode');
$mdTopologyLevelCode->setAttribute('codeListValue', '001');
$mdTopologyLevelCode->setAttribute('codeList', $this->_codeList.'#MD_TopologyLevelCode');
$topologyLevel->appendChild($mdTopologyLevelCode);

$geometricObjects=$doc->createElementNS($this->_gmd, 'geometricObjects');
$mdVectorSpatialRepresentation->appendChild($geometricObjects);
$mdgeometricObjects=$doc->createElementNS($this->_gmd,'MD_GeometricObjects');
$geometricObjects->appendChild($mdgeometricObjects);
$geometricObjectType=$doc->createElementNS($this->_gmd, 'geometricObjectType');
$mdgeometricObjects->appendChild($geometricObjectType);

$mdGeometricObjectTypeCode=$doc->createElementNS($this->_gmd,'MD_GeometricObjectTypeCode');
$mdGeometricObjectTypeCode->setAttribute('codeListValue', '001');
$mdGeometricObjectTypeCode->setAttribute('codeList', $this->_codeList.'#MD_GeometricObjectTypeCode');
$geometricObjectType->appendChild($mdGeometricObjectTypeCode);

$referenceSystemInfo =$doc->createElementNS($this->_gmd,'referenceSystemInfo');
$mdMetadata->appendChild($referenceSystemInfo);
$mdReferenceSystem= $doc->createElementNS($this->_gmd,'MD_ReferenceSystem');
$referenceSystemInfo->appendChild($mdReferenceSystem);

$referenceSysemIdentifier=$doc->createElementNS($this->_gmd,'referenceSystemIdentifier');
$mdReferenceSystem->appendChild($referenceSysemIdentifier);
$rsIdentifier=$doc->createElementNS($this->_gmd, 'RS_Identifier');
$referenceSysemIdentifier->appendChild($rsIdentifier);
$code=$doc->createElementNS($this->_gmd,'code');
$rsIdentifier->appendChild($code);
$characterString=$doc->createElementNS($this->_gco,'CharacterString','EPSG:32718');
$code->appendChild($characterString);
$codeSpace=$doc->createElementNS($this->_gmd,'codeSpace');
$rsIdentifier->appendChild($codeSpace);
$characterString=$doc->createElementNS($this->_gco,'CharacterString','WGS 84 / UTM zona 18S');
$codeSpace->appendChild($characterString);

$identificationInfo =$doc->createElementNS($this->_gmd, 'identificationInfo');
$mdMetadata->appendChild($identificationInfo);
$mdDataIdentification = $doc->createElementNS($this->_gmd,'MD_DataIdentification');
$identificationInfo->appendChild($mdDataIdentification);

$citation=$doc->createElementNS($this->_gmd,'citation');
$mdDataIdentification->appendChild($citation);
$ciCitation =$doc->createElementNS($this->_gmd, 'CI_Citation');
$citation->appendChild($ciCitation);
$title=$doc->createElementNS($this->_gmd, 'title');
$ciCitation->appendChild($title);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString','Plantilla de Metadatos Generado por Yoguer');//nombre de metadato
$title->appendChild($characterString);
$date =$doc->createElementNS($this->_gmd,'date');
$ciCitation->appendChild($date);
$ciDate=$doc->createElementNS($this->_gmd,'CI_Date');
$date->appendChild($ciDate);
$date =$doc->createElementNS($this->_gmd,'date');
$ciDate->appendChild($date);
$dateTime=$doc->createElementNS($this->_gco,'DateTime','2008-05-05T16:14:00');//fecha
$date->appendChild($dateTime);
$dateType=$doc->createElementNS($this->_gmd,'dateType');
$ciDate->appendChild($dateType);
$ciDateTypeCode= $doc->createElementNS($this->_gmd,'CI_DateTypeCode');
$ciDateTypeCode->setAttribute('codeListValue', '001');
$ciDateTypeCode->setAttribute('codeList', $this->_codeList.'#CI_DateTypeCode');
$dateType->appendChild($ciDateTypeCode);
$presentationForm= $doc->createElementNS($this->_gmd, 'presentationForm');
$ciCitation->appendChild($presentationForm);
$ciPresentationFormCode=$doc->createElementNS($this->_gmd,'CI_PresentationFormCode');
$ciPresentationFormCode->setAttribute('codeListValue', '005');
$ciPresentationFormCode->setAttribute('codeList', $this->_codeList.'#CI_PresentationFormCode');
$presentationForm->appendChild($ciPresentationFormCode);

$abstract=$doc->createElementNS($this->_gmd,'abstract');
$mdDataIdentification->appendChild($abstract);
$characterString=$doc->createElementNS($this->_gco,'CharacterString','Una sIntesis que proporcione un resumen narrativo del contenido de datos');//resumen
$abstract->appendChild($characterString);

$status = $doc->createElementNS($this->_gmd, 'status');
$mdDataIdentification->appendChild($status);
$mdProgressCode=$doc->createElementNS($this->_gmd, 'MD_ProgressCode');
$mdProgressCode->setAttribute('codeListValue', '001');
$mdProgressCode->setAttribute('codeList', $this->_codeList.'#MD_ProgressCode');
$status->appendChild($mdProgressCode);

$pointOfContact=$doc->createElementNS($this->_gmd,'pointOfContact');
$mdDataIdentification->appendChild($pointOfContact);
$ciResponsibleParty=$doc->createElementNS($this->_gmd,'CI_ResponsibleParty');
$pointOfContact->appendChild($ciResponsibleParty);
$individualName=$doc->createElementNS($this->_gmd,'individualName');
$ciResponsibleParty->appendChild($individualName);
$characterString=$doc->createElementNS($this->_gco,'CharacterString', 'Nombre del proveedor o creador de los datos');//author del dato
$individualName->appendChild($characterString);
$organisationName= $doc->createElementNS($this->_gmd, 'organisationName');
$ciResponsibleParty->appendChild($organisationName);
$characterString=$doc->createElementNS($this->_gco,'CharacterString', 'Institucion al que pertenece');//institucion del author
$organisationName->appendChild($characterString);

$contactInfo=$doc->createElementNS($this->_gmd,'contactInfo');
$ciResponsibleParty->appendChild($contactInfo);
$ciContact=$doc->createElementNS($this->_gmd, 'CI_Contact');
$contactInfo->appendChild($ciContact);

$phone=$doc->createElementNS($this->_gmd,'phone');
$ciContact->appendChild($phone);
$ciTelephone=$doc->createElementNS($this->_gmd, 'CI_Telephone');
$phone->appendChild($ciTelephone);

$address = $doc->createElementNS($this->_gmd, 'address');
$ciContact->appendChild($address);
$ciAddress = $doc->createElementNS($this->_gmd,'CI_Address');
$address->appendChild($ciAddress);
$electronicMailAddress = $doc->createElementNS($this->_gmd,'electronicMailAddress');
$ciAddress->appendChild($electronicMailAddress);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString','correo@institucion.gob.pe');//correo electronico del author
$electronicMailAddress->appendChild($characterString);

$role= $doc->createElementNS($this->_gmd,'role');
$ciResponsibleParty->appendChild($role);
$ciRoleCode = $doc->createElementNS($this->_gmd,'CI_RoleCode');
$ciRoleCode->setAttribute('codeListValue', '002');
$ciRoleCode->setAttribute('codeList', $this->_codeList.'#CI_RoleCode');
$role->appendChild($ciRoleCode);

$graphicOverview = $doc->createElementNS($this->_gmd, 'graphicOverview');
$mdDataIdentification->appendChild($graphicOverview);
$mdBrowseGraphic = $doc->createElementNS($this->_gmd,'MD_BrowseGraphic');
$graphicOverview->appendChild($mdBrowseGraphic);
$fileName = $doc->createElementNS($this->_gmd, 'fileName');
$mdBrowseGraphic->appendChild($fileName);
$characterString = $doc->createElementNS($this->_gco,'CharacterString','ideplogo_s.png');//logo de la institucion
$fileName->appendChild($characterString);
$fileDescription=$doc->createElementNS($this->_gmd,'fileDescription');
$mdBrowseGraphic->appendChild($fileDescription);
$characterString = $doc->createElementNS($this->_gco,'CharacterString','thumbnail');
$fileDescription->appendChild($characterString);
$fileType=$doc->createElementNS($this->_gmd,'fileType');
$mdBrowseGraphic->appendChild($fileType);
$characterString = $doc->createElementNS($this->_gco,'CharacterString','png');
$fileType->appendChild($characterString);

$descriptiveKeywords = $doc->createElementNS($this->_gmd,'descriptiveKeywords');
$mdDataIdentification->appendChild($descriptiveKeywords);
$mdKeywords=$doc->createElementNS($this->_gmd,'MD_Keywords');
$descriptiveKeywords->appendChild($mdKeywords);
$keyword = $doc->createElementNS($this->_gmd, 'keyword');
$mdKeywords->appendChild($keyword);
$characterString = $doc->createElementNS($this->_gco,'CharacterString','Ejemplo: Geologia, Fisica');//keywords
$keyword->appendChild($characterString);
$type = $doc->createElementNS($this->_gmd,'type');
$mdKeywords->appendChild($type);
$mdKeywordTypeCode=$doc->createElementNS($this->_gmd, 'MD_KeywordTypeCode');
$mdKeywordTypeCode->setAttribute('codeListValue', '005');
$mdKeywordTypeCode->setAttribute('codeList', $this->_codeList.'#MD_KeywordTypeCode');
$type->appendChild($mdKeywordTypeCode);

$spatialRepresentationType = $doc->createElementNS($this->_gmd, 'spatialRepresentationType');
$mdDataIdentification->appendChild($spatialRepresentationType);
$mdSpatialRepresentationTypeCode= $doc->createElementNS($this->_gmd, 'MD_SpatialRepresentationTypeCode');
$mdSpatialRepresentationTypeCode->setAttribute('codeListValue', '001');
$mdSpatialRepresentationTypeCode->setAttribute('codeList', $this->_codeList.'#MD_SpatialRepresentationTypeCode');
$spatialRepresentationType->appendChild($mdSpatialRepresentationTypeCode);

$spatialResolution = $doc->createElementNS($this->_gmd, 'spatialResolution');
$mdDataIdentification->appendChild($spatialResolution);
$mdResolution = $doc->createElementNS($this->_gmd,'MD_Resolution');
$spatialResolution->appendChild($mdResolution);
$equivalentScale= $doc->createElementNS($this->_gmd,'equivalentScale');
$mdResolution->appendChild($equivalentScale);
$mdRepresentativeFraction = $doc->createElementNS($this->_gmd,'MD_RepresentativeFraction');
$equivalentScale->appendChild($mdRepresentativeFraction);
$denominator= $doc->createElementNS($this->_gmd,'denominator');
$mdRepresentativeFraction->appendChild($denominator);
$integer = $doc->createElementNS($this->_gco,'Integer','50000');//la scala
$denominator->appendChild($integer);

$language = $doc->createElementNS($this->_gmd,'language');
$mdDataIdentification->appendChild($language);
$characterString=$doc->createElementNS($this->_gco, 'CharacterString','spa');
$language->appendChild($characterString);

$characterSet = $doc->createElementNS($this->_gmd, 'characterSet');
$mdDataIdentification->appendChild($characterSet);
$mdCharacterSetCode = $doc->createElementNS($this->_gmd,'MD_CharacterSetCode');
$mdCharacterSetCode->setAttribute('codeListValue', 'utf8');
$mdCharacterSetCode->setAttribute('codeList', $this->_codeList.'#MD_CharacterSetCode');
$characterSet->appendChild($mdCharacterSetCode);

$topicCategory = $doc->createElementNS($this->_gmd,'topicCategory');
$mdDataIdentification->appendChild($topicCategory);
$mdTopicCategoryCode = $doc->createElementNS($this->_gmd,'MD_TopicCategoryCode','geoscientificInformation');//categoría
$topicCategory->appendChild($mdTopicCategoryCode);

$extent = $doc->createElementNS($this->_gmd,'extent');
$mdDataIdentification->appendChild($extent);
$exExtent = $doc->createElementNS($this->_gmd, 'EX_Extent');
$extent->appendChild($exExtent);
$geographicElement = $doc->createElementNS($this->_gmd, 'geographicElement');
$exExtent->appendChild($geographicElement);
$exGeographicBoundingBox = $doc->createElementNS($this->_gmd,'EX_GeographicBoundingBox');
$geographicElement->appendChild($exGeographicBoundingBox);
$westBoundLongitude = $doc->createElementNS($this->_gmd,'westBoundLongitude');
$exGeographicBoundingBox->appendChild($westBoundLongitude);
$decimal = $doc->createElementNS($this->_gco,'Decimal', -81.35515);
$westBoundLongitude->appendChild($decimal);

$eastBoundLongitude = $doc->createElementNS($this->_gmd,'eastBoundLongitude');
$exGeographicBoundingBox->appendChild($eastBoundLongitude);
$decimal = $doc->createElementNS($this->_gco,'Decimal', -68.6739);
$eastBoundLongitude->appendChild($decimal);

$southBoundLatitude = $doc->createElementNS($this->_gmd,'southBoundLatitude');
$exGeographicBoundingBox->appendChild($southBoundLatitude);
$decimal = $doc->createElementNS($this->_gco,'Decimal', -18.34855);
$southBoundLatitude->appendChild($decimal);

$northBoundLatitude = $doc->createElementNS($this->_gmd,'northBoundLatitude');
$exGeographicBoundingBox->appendChild($northBoundLatitude);
$decimal = $doc->createElementNS($this->_gco,'Decimal', -0.03687);
$northBoundLatitude->appendChild($decimal);

$distributionInfo = $doc->createElementNS($this->_gmd, 'distributionInfo');
$mdMetadata->appendChild($distributionInfo);
$mdDistribution = $doc->createElementNS($this->_gmd, 'MD_Distribution');
$distributionInfo->appendChild($mdDistribution);
$distributionFormat = $doc->createElementNS($this->_gmd, 'distributionFormat');
$mdDistribution->appendChild($distributionFormat);
$mdFormat = $doc->createElementNS($this->_gmd,'MD_Format');
$distributionFormat->appendChild($mdFormat);
$name = $doc->createElementNS($this->_gmd,'name');
$mdFormat->appendChild($name);
$characterString = $doc->createElementNS($this->_gco,'CharacterString', 'ArcGIS');//formato
$name->appendChild($characterString);
$version = $doc->createElementNS($this->_gmd,'version');
$mdFormat->appendChild($version);
$characterString = $doc->createElementNS($this->_gco,'CharacterString', '10.0');//version
$version->appendChild($characterString);

$transferOptions = $doc->createElementNS($this->_gmd, 'transferOptions');
$mdDistribution->appendChild($transferOptions);
$mdDigitalTransferOptions = $doc->createElementNS($this->_gmd, 'MD_DigitalTransferOptions');
$transferOptions->appendChild($mdDigitalTransferOptions);

$onLine = $doc->createElementNS($this->_gmd, 'onLine');
$mdDigitalTransferOptions->appendChild($onLine);
$ciOnLineResource = $doc->createElementNS($this->_gmd, 'CI_OnlineResource');
$onLine->appendChild($ciOnLineResource);
$linkAge = $doc->createElementNS($this->_gmd, 'linkage');
$ciOnLineResource->appendChild($linkAge);
$url = $doc->createElementNS($this->_gmd, 'URL','www.institucion.com'); //url
$linkAge->appendChild($url);
$protocol = $doc->createElementNS($this->_gmd, 'protocol');
$ciOnLineResource->appendChild($protocol);
$characterString = $doc->createElementNS($this->_gco,'CharacterString','WWW:LINK-1.0-http--link' ); //protocolo
$protocol->appendChild($characterString);
$name = $doc->createElementNS($this->_gmd, 'name');
$name->setAttribute('gco:nilReason', 'missing');
$ciOnLineResource->appendChild($name);
$characterString = $doc->createElementNS($this->_gco,'CharacterString');
$name->appendChild($characterString);

$onLine = $doc->createElementNS($this->_gmd, 'onLine');
$mdDigitalTransferOptions->appendChild($onLine);
$ciOnLineResource = $doc->createElementNS($this->_gmd, 'CI_OnlineResource');
$onLine->appendChild($ciOnLineResource);
$linkAge = $doc->createElementNS($this->_gmd, 'linkage');
$ciOnLineResource->appendChild($linkAge);
$url = $doc->createElementNS($this->_gmd, 'URL','Direccion Sevicio WMS'); //url
$linkAge->appendChild($url);
$protocol = $doc->createElementNS($this->_gmd, 'protocol');
$ciOnLineResource->appendChild($protocol);
$characterString = $doc->createElementNS($this->_gco,'CharacterString','OGC:WMS-1.1.1-http-get-map' ); //protocolo
$protocol->appendChild($characterString);
$name = $doc->createElementNS($this->_gmd, 'name');
$ciOnLineResource->appendChild($name);
$characterString = $doc->createElementNS($this->_gco,'CharacterString','Nombre de capas o layer separado por comas');
$name->appendChild($characterString);
$description = $doc->createElementNS($this->_gmd, 'description');
$ciOnLineResource->appendChild($description);
$characterString = $doc->createElementNS($this->_gco,'CharacterString','Url del servicio WMS o Descripcion del servicio');
$description->appendChild($characterString);

$dataQualityInfo = $doc->createElementNS($this->_gmd,'dataQualityInfo');
$mdMetadata->appendChild($dataQualityInfo);
$dqDataQuality = $doc->createElementNS($this->_gmd, 'DQ_DataQuality');
$dataQualityInfo->appendChild($dqDataQuality);
$scope = $doc->createElementNS($this->_gmd, 'scope');
$dqDataQuality->appendChild($scope);
$dqScope = $doc->createElementNS($this->_gmd,'DQ_Scope');
$scope->appendChild($dqScope);
$level = $doc->createElementNS($this->_gmd,'level');
$dqScope->appendChild($level);
$mdScopeCode = $doc->createElementNS($this->_gmd, 'MD_ScopeCode');
$mdScopeCode->setAttribute('codeListValue', '001');
$mdScopeCode->setAttribute('codeList', $this->_codeList.'#MD_ScopeCode');
$level->appendChild($mdScopeCode);
$lineage = $doc->createElementNS($this->_gmd,'lineage');
$dqDataQuality->appendChild($lineage);
$liLineage = $doc->createElementNS($this->_gmd, 'LI_Lineage');
$lineage->appendChild($liLineage);
$statement = $doc->createElementNS($this->_gmd, 'statement');
$liLineage->appendChild($statement);
$characterString = $doc->createElementNS($this->_gco, 'CharacterString','Declaracion o resumen de como fueron producidos los datos bajo normas parametros estandares de medicion, Aproximaciones, errores minimos, etc.'); // norma de los metadatos
$statement->appendChild($characterString);

$metadataConstraints = $doc->createElementNS($this->_gmd,'metadataConstraints');
$mdMetadata->appendChild($metadataConstraints);
$mdLegalConstraints = $doc->createElementNS($this->_gmd, 'MD_LegalConstraints');
$metadataConstraints->appendChild($mdLegalConstraints);
$accessConstraints = $doc->createElementNS($this->_gmd, 'accessConstraints');
$mdLegalConstraints->appendChild($accessConstraints);
$mdRestrictionCode = $doc->createElementNS($this->_gmd, 'MD_RestrictionCode');
$mdRestrictionCode->setAttribute('codeListValue', '001');
$mdRestrictionCode->setAttribute('codeList', $this->_codeList.'#MD_RestrictionCode');
$accessConstraints->appendChild($mdRestrictionCode);
$useConstraints = $doc->createElementNS($this->_gmd, 'useConstraints');
$mdLegalConstraints->appendChild($useConstraints);
$mdRestrictionCode = $doc->createElementNS($this->_gmd, 'MD_RestrictionCode');
$mdRestrictionCode->setAttribute('codeListValue', '001');
$mdRestrictionCode->setAttribute('codeList', $this->_codeList.'#MD_RestrictionCode');
$useConstraints->appendChild($mdRestrictionCode);
$otherConstraints = $doc->createElementNS($this->_gmd,'otherConstraints');
$mdLegalConstraints->appendChild($otherConstraints);
$characterString = $doc->createElementNS($this->_gco,'CharacterString', 'Descripcion de otras restricciones');//otras restricciones
$otherConstraints->appendChild($characterString);

$metadataMaintenance = $doc->createElementNS($this->_gmd, 'metadataMaintenance');
$mdMetadata->appendChild($metadataMaintenance);
$mdMaintenanceInformation = $doc->createElementNS($this->_gmd, 'MD_MaintenanceInformation');
$metadataMaintenance->appendChild($mdMaintenanceInformation);
$maintenanceAndUpdateFrequency = $doc->createElementNS($this->_gmd, 'maintenanceAndUpdateFrequency');
$mdMaintenanceInformation->appendChild($maintenanceAndUpdateFrequency);
$mdMaintenanceFrequencyCode = $doc->createElementNS($this->_gmd,'MD_MaintenanceFrequencyCode');
$mdMaintenanceFrequencyCode->setAttribute('codeListValue', '001');
$mdMaintenanceFrequencyCode->setAttribute('codeList', $this->_codeList.'#MD_MaintenanceFrequencyCode');
$maintenanceAndUpdateFrequency->appendChild($mdMaintenanceFrequencyCode);
$metadata= $doc->saveXML();
return $metadata;
}
}

sábado, 27 de noviembre de 2010

DropDownList en GridView

en esta oportunidad les voy a postear una solución que le dí a un problema que tenía con el dropdownlist dentro de un gridview, aunque me tomó mucho(para ser rápido) tiempo encontrar esto.

el problema que tenía un gridview, pero las columnas no se generaban automáticamente, porque de hecho un campo era un dropdownlist(nada inofensivo), que me traía el estado de cualquier objeto, en mi caso eran capas geográficas, entonces al cambiar de estado tenía que actualizarme automáticamente el registro con el nuevo estado.

bueno sin más chamullo, entramos a ver el código.

No publico código completo porque no viene al caso, pero eso si aqui mi campo que contiene el dropdownlist

Lo primero que debemos de agregar es la propiedad autopostback al dropdownlist y ponerle a true para que automáticamente vaya al servidor, cuando cambiemos de estado.

Además debe de agregarse el evento OnSelectedIndexChanged=”evento_a_ejecutar”

Ahora viene como haremos que al cambiar de estado se ejecute ese evento del onselectedindexchanged??

Bueno para ello nos vamos al codebehind de la página y programamos el evento “evento_a_ejecutar”

protected void evento_a_ejecutar(object sender, EventArgs e)
{
GridViewRow gvr = (GridViewRow)(((Control)sender).NamingContainer);
string fileState = ((DropDownList)gvr.FindControl("ddlEstado")).SelectedValue;
//ahora ya tenemos el valor del dropdownlist y podemos hacer lo que queramos con el, por ejemplo actualizar, para ello sólo tendríamos que obtener el id de dicho registro.
}

Entonce el truco está en convertir el objeto sender en control y este a su vez en un gridview a traves de su propiedad NamingContainer, luego simplemente nos queda buscar los controles que pueda contener el gridview en dicha fila donde ocurrió el evento del dropdownlist.
Pudimos haber simplificado también de esta forma

string fileState = ((DropDownList)sender).SelectedValue;

pero yo necesitaba buscar otros controles en dicha fila del gridview.

Crear una clave SHA1 como la generada por FormsAuthentication.HashPasswordForStoringInConfigFile

Private Function GenerateSHA1(ByVal nombre As String) As String
Dim enc As New UTF8Encoding
Dim data() As Byte = enc.GetBytes(nombre)
Dim result() As Byte
Dim sha As New SHA1CryptoServiceProvider
result = sha.ComputeHash(data)
Dim sb As New StringBuilder
For i As Integer = 0 To result.Length - 1
If result(i) < 16 Then sb.Append("0") End If sb.Append(result(i).ToString("x")) Next Return sb.ToString.ToUpper End Function

viernes, 7 de agosto de 2009

Generador de Códigos en php

hoy navegando un rato por la red, me encontré con algo interesante como phpobjectgenerator.

pues genera la clase automáticamente, además de las tablas, para que prueben uds mismos les dejo el link.

http://www.phpobjectgenerator.com/