Revision 4915 trunk/extensions/extWMS/src/com/iver/cit/gvsig/webmapcontext/WebMapContext.java
WebMapContext.java | ||
---|---|---|
43 | 43 |
* |
44 | 44 |
* $Id$ |
45 | 45 |
* $Log$ |
46 |
* Revision 1.3 2006-04-20 17:11:54 jaume |
|
46 |
* Revision 1.4 2006-04-21 10:27:32 jaume |
|
47 |
* exporting now supported |
|
48 |
* |
|
49 |
* Revision 1.3 2006/04/20 17:11:54 jaume |
|
47 | 50 |
* Attempting to export |
48 | 51 |
* |
49 | 52 |
* Revision 1.2 2006/04/19 16:34:29 jaume |
... | ... | |
122 | 125 |
public String logoURL = null; |
123 | 126 |
public String descriptionURLFormat = null; |
124 | 127 |
public String descriptionURL = null; |
128 |
public boolean contactInfo = false; |
|
125 | 129 |
public String contactPerson = null; |
126 | 130 |
public String contactOrganization = null; |
127 | 131 |
public String contactPosition = null; |
... | ... | |
157 | 161 |
* value: styles (FMapWMSStyle[]) |
158 | 162 |
*/ |
159 | 163 |
Hashtable layerStyles = null; |
164 |
|
|
160 | 165 |
|
161 | 166 |
static { |
162 | 167 |
supportedVersions.add("1.1.0"); |
... | ... | |
416 | 421 |
fax = parser.nextText(); |
417 | 422 |
} else if (parser.getName().compareTo(WebMapContextTags.CONTACT_ELECTRONIC_MAIL_ADDRESS) == 0) { |
418 | 423 |
email = parser.nextText(); |
424 |
} else if (parser.getName().compareTo(WebMapContextTags.CONTACT_PERSON_PRIMARY) == 0) { |
|
425 |
// DO NOTHING |
|
426 |
} else if (parser.getName().compareTo(WebMapContextTags.CONTACT_ADDRESS) == 0) { |
|
427 |
// DO NOTHING |
|
419 | 428 |
} else { |
420 | 429 |
System.out.println("Unrecognized "+parser.getName()); |
421 | 430 |
} |
... | ... | |
629 | 638 |
xmlAttrs.put(WebMapContextTags.XSI_SCHEMA_LOCATION, WebMapContextTags.XSI_SCHEMA_LOCATION_VALUE); |
630 | 639 |
xml.openTag(WebMapContextTags.VIEW_CONTEXT, xmlAttrs); |
631 | 640 |
xmlAttrs.clear(); |
641 |
|
|
632 | 642 |
// <General> |
633 | 643 |
xml.openTag(WebMapContextTags.GENERAL); |
644 |
|
|
634 | 645 |
// <Window> |
635 | 646 |
if (windowSize!=null) { |
636 | 647 |
xmlAttrs.put(WebMapContextTags.WIDTH, ((int) windowSize.getWidth())+""); |
... | ... | |
639 | 650 |
xmlAttrs.clear(); |
640 | 651 |
} |
641 | 652 |
// </Window> |
653 |
|
|
642 | 654 |
// <BoundingBox> |
643 | 655 |
xmlAttrs.put(WebMapContextTags.SRS, v.getProjection().getAbrev()); |
644 | 656 |
Rectangle2D rect = v.getMapContext().getViewPort().getAdjustedExtent(); |
... | ... | |
649 | 661 |
xml.writeTag(WebMapContextTags.BOUNDING_BOX, xmlAttrs); |
650 | 662 |
xmlAttrs.clear(); |
651 | 663 |
// </BoundingBox> |
664 |
|
|
652 | 665 |
// <Title> |
653 |
xml.writeTag(WebMapContextTags.TITLE, v.getName());
|
|
666 |
xml.writeTag(WebMapContextTags.TITLE, title.trim());
|
|
654 | 667 |
// </Title> |
668 |
|
|
669 |
// <Abstract> |
|
670 |
if (_abstract != null) |
|
671 |
xml.writeTag(WebMapContextTags.ABSTRACT, _abstract.trim()); |
|
672 |
// </Abstract> |
|
673 |
|
|
674 |
// <LogoURL> |
|
675 |
if (logoURL != null) |
|
676 |
xml.writeTag(WebMapContextTags.LOGO_URL, logoURL.trim()); |
|
677 |
// </LogoURL> |
|
678 |
|
|
679 |
// <DescriptionURL> |
|
680 |
if (descriptionURL != null) |
|
681 |
xml.writeTag(WebMapContextTags.DESCRIPTION_URL, descriptionURL.trim()); |
|
682 |
// </DescriptionURL> |
|
683 |
|
|
684 |
// <KeywordList> |
|
685 |
if (contactInfo) { |
|
686 |
|
|
687 |
// <ContactInformation> |
|
688 |
xml.openTag(WebMapContextTags.CONTACT_INFORMATION); |
|
689 |
if (contactPerson != null || contactOrganization != null) { |
|
690 |
|
|
691 |
// <ContactPersonPrimary> |
|
692 |
xml.openTag(WebMapContextTags.CONTACT_PERSON_PRIMARY); |
|
693 |
|
|
694 |
// <ContactPerson> |
|
695 |
if (contactPerson != null) |
|
696 |
xml.writeTag(WebMapContextTags.CONTACT_PERSON, contactPerson.trim()); |
|
697 |
// </ContactPerson> |
|
698 |
|
|
699 |
// <ContactOrganization> |
|
700 |
if (contactOrganization != null) |
|
701 |
xml.writeTag(WebMapContextTags.CONTACT_ORGANIZATION, contactOrganization.trim()); |
|
702 |
// </ContactOrganization> |
|
703 |
|
|
704 |
xml.closeTag(); |
|
705 |
// </ContactPersonPrimary> |
|
706 |
} |
|
707 |
xml.closeTag(); |
|
708 |
// </ContactInformation> |
|
709 |
|
|
710 |
// <ContactPosition> |
|
711 |
if (contactPosition != null) |
|
712 |
xml.writeTag(WebMapContextTags.CONTACT_POSITION, contactPosition.trim()); |
|
713 |
// </ContactPosition> |
|
714 |
|
|
715 |
// <ContactAddress> |
|
716 |
if (address != null || city != null || stateOrProvince != null || postCode != null || country != null) { |
|
717 |
xml.openTag(WebMapContextTags.CONTACT_ADDRESS); |
|
718 |
|
|
719 |
// <AddressType> |
|
720 |
xml.writeTag(WebMapContextTags.ADDRESS_TYPE, "Postal"); |
|
721 |
// </AddressType> |
|
722 |
|
|
723 |
// <Address> |
|
724 |
if (address != null) |
|
725 |
xml.writeTag(WebMapContextTags.ADDRESS, address.trim()); |
|
726 |
// </Address> |
|
727 |
|
|
728 |
// <City> |
|
729 |
if (city != null) |
|
730 |
xml.writeTag(WebMapContextTags.CITY, city.trim()); |
|
731 |
// </City> |
|
732 |
|
|
733 |
// <StateOrProvince> |
|
734 |
if (stateOrProvince != null) |
|
735 |
xml.writeTag(WebMapContextTags.STATE_OR_PROVINCE, stateOrProvince.trim()); |
|
736 |
// </StateOrProvince> |
|
737 |
|
|
738 |
// <PostCode> |
|
739 |
if (postCode != null) |
|
740 |
xml.writeTag(WebMapContextTags.POSTCODE, postCode.trim()); |
|
741 |
// </PostCode> |
|
742 |
|
|
743 |
// <Country> |
|
744 |
if (country != null) |
|
745 |
xml.writeTag(WebMapContextTags.COUNTRY, country.trim()); |
|
746 |
// </Country> |
|
747 |
xml.closeTag(); |
|
748 |
} |
|
749 |
// </ContactAddress> |
|
750 |
|
|
751 |
// <ContactVoiceTelephone> |
|
752 |
if (telephone != null) |
|
753 |
xml.writeTag(WebMapContextTags.CONTACT_VOICE_TELEPHONE, telephone.trim()); |
|
754 |
// </ContactVoiceTelephone> |
|
755 |
|
|
756 |
// <ContactFacsimileTelephone> |
|
757 |
if (fax != null) |
|
758 |
xml.writeTag(WebMapContextTags.CONTACT_FACSIMILE_TELEPHONE, fax.trim()); |
|
759 |
// </ContactFacsimileTelephone> |
|
760 |
|
|
761 |
// <ContactElectronicMailAddress> |
|
762 |
if (email != null) |
|
763 |
xml.writeTag(WebMapContextTags.CONTACT_ELECTRONIC_MAIL_ADDRESS, email.trim()); |
|
764 |
// </ContactElectronicMailAddress> |
|
765 |
} |
|
766 |
if (keywordList != null) { |
|
767 |
xml.openTag(WebMapContextTags.KEYWORD_LIST); |
|
768 |
for (int i = 0; i < keywordList.size(); i++) { |
|
769 |
xml.writeTag(WebMapContextTags.KEYWORD, ((String) keywordList.get(i)).trim()); |
|
770 |
} |
|
771 |
xml.closeTag(); |
|
772 |
} |
|
773 |
// </KeywordList> |
|
655 | 774 |
xml.closeTag(); |
656 | 775 |
// </General> |
776 |
|
|
657 | 777 |
// <LayerList> |
658 | 778 |
xml.openTag(WebMapContextTags.LAYER_LIST); |
659 | 779 |
for (int i = 0; i < layersToExport.size(); i++) { |
Also available in: Unified diff