Archive for July, 2009

 

Detecting domain names in php ..

Jul 14, 2009 in php, Web

From http://www.webmasterworld.com/forum88/11417.htm

<? 
if (strpos(getenv('SERVER_name'), 'domain1.com')!==false) { 
  echo "<img src='1.jpg'>"; 
} elseif (strpos(getenv('SERVER_name'), 'domain2.com')!==false) { 
  echo "<img src='2.jpg'>"; 
}; 
?>

Joomla templates design tutorial ..

Jul 10, 2009 in Joomla

Good article on creating templates for Joomla

Joomla Template Tutorial

UML2 Diagrams Notes ..

Jul 02, 2009 in Uncategorized

— See http://www.agilemodeling.com/essays/umlDiagrams.htm

  • Activity Diagram
    — typically used for business process modeling, for modeling the logic
    captured by a single use case or usage scenario, or for modeling the
    detailed logic of a business rule.
    — See http://www.agilemodeling.com/artifacts/activityDiagram.htm
  • Class D..
  • Component D..
  • Composite Structures D..
  • Deployment D..
  • Profile Definition D..
  • State Machine D..
  • Use Case D..

Notes on “Java Web Services” ..

Jul 02, 2009 in Books, Java, Software, WebServices

This book is a bit old.. 2002..




  • — SOA – Service Oriented Architecture
    — 3 major roles: Provider, Registry (Broker) and Requester.
    — SOA is based on web services.
  • — SOAP – Simple Object Access Protocol
    — 2 major methods: Message-based Document Exchange AND RPC
    (Remote Procedure Calls).
    — All structures based on XML.
    — A SOAP message contains an Envelope and a Header.
    — A SOAP message may contain (MIME) attachments.
    — Main transport protocol is HTTP(S).
    — Providers (Receivers) are usually based on Servlets.
  • — SOAP-RPC
    — Method signatures contain a single SOAP structure.
    — SOAP service methods must match info in deployment descriptor.
    — Errors and Faults: VersionMismatch, MustUnderstand, DTDNotSupported, etc..
  • — WSDL – Web Services Description Language
    — WSDL is an XML grammar for describing a web service
    as a collection of access end-points capable of exchanging
    messages in a procedure- or document-oriented fashion (p. 72)
    — The reasonable flow is to create service methods and
    than generate WSDL from code using tools.
    — Best practices: web service is (functionally) coarse-grained
    and messages are more business-oriented than programmatic.
  • — UDDI – Universal Description, Discovery and Integration
    — Similar to an Internet search engine for businesses.
    — UBR – UDDI Business Registry (the Public Cloud).
    — Designed for B2B mostly.
    — 2 APIs: inquiry and publishing API.
    — JAXR = Java API for XML Registries.
    — Some details: Categorization (NAICS, ISO, etc..),
    Identifier (DUNS, Thomas Reg, etc),
    tModel (web service metadata)
  • — JAX-RPC and JAXM
    — JAXM = Java API for XML Messaging.
    — JAX-RPC = Java API for XML-based RPC.
    — JAXM may be used as a frontend to SOAP-based messaging
    frameworks through the use of “profiles”.
    — JAX-RPC covers code generation for client and server parts,
    dynamic SOAP, creating services within J2EE and J2SE environments,
    bindings, serialization, mapping of datatypes between WSDL and Java,
    etc..
  • — The Java Web Service (JWS) Standard
    — Proposed by BEA, using templates to create simple web services.
    — Example (HelloWorld.jws <- note the .jws extension)
    Note the annotations @operation, @conversation ..

    import com.bea.jws.*
    
    public class HelloWorld extends Service {
      /**
      * @operation
      * @conversation stateless
      */
      public String getHelloWorld() {
        return "Hello, World!";
      }
    }
    

    Other values for @conversation are ‘start’, ‘continue’ or
    ‘finish’. The ‘start’ directive, for example, starts a session.

  • — Security notes
    — Use of SSL (HTTPS), encryption, signing and secure hashing.
    — Security Assertion Markup Language (SAML) – used with Single Sign-On (SSO).
  • — Resources
    http://aws.amazon.com/
    http://seekda.com/
    http://www.programmableweb.com/
    http://www.webservices.org/
    http://xmethods.com/

Colophon – European (Alpine) Ibex – a wild goat.

Eclipse UML2 Tools notes..

Jul 01, 2009 in UML, Uncategorized

Great introductory article on Eclipse UML Tools

http://www.vogella.de/articles/UML/article.html#uml

Table of Contents

1. UML

    1.1. Overview
    1.2. Definition
    1.3. UML Profiles

2. Installation of Eclipse UML2 Tools
3. Eclipse UML2 Tools

    3.1. Creating UML Diagrams
    3.2. Multiplicity
    3.3. Interfaces
    3.4. Viewing the .uml file

4. Thank you
5. Questions and Discussion
6. Appendix: Class diagrams

    6.1. Overview
    6.2. Classes
    6.3. Attributes
    6.4. Interfaces
    6.5. Relationships

7. Appendix: Model-Driven Architecture (MDA)

    7.1. Overview
    7.2. Platform Independent Model (PIM)
    7.3. Platform Specific Model (PSM)
    7.4. Code Mode

8. Links and Literature

For reverse engineering, see “MoDisco” (Model Discovery)

http://www.eclipse.org/gmt/modisco/

For building UML models from legacy packages, here are some
tips:

http://dev.eclipse.org/newslists/news.eclipse.modeling.gmt.modisco/msg00055.html

...
- the first one builds a Java Abstract Syntax model (based on the JDT Java API) from a Java 
compilation unit, this Java model may be then transformed into a UML2 model using an ATL 
model-to-model transformation (http://www.eclipse.org/m2m/atl/);
- the second one builds a UML2 model from a Jar file.

Linux DNS configuration notes..

Jul 01, 2009 in Linux

  • — The DNS server is ‘named’
    — $ ps -ef | egrep named
    — $ /etc/init.d/named status
    — Config file is /etc/named.conf (see example below)
  • — Configuration examples in /etc/named.conf file
    -- // Reverse DNS map
    zone "10.168.192.in-addr.arpa" {
            type master;
            file "/var/named/192.168.10.rev";
            };
    
    -- // Forward DNS map
    zone "mydomain.com" {
            type master;
            file "/var/named/mydomain.com.hosts";
            };
    
  • — file “/var/named/mydomain.com.hosts”
    $ttl 38400
    @       IN      SOA     dns.mydomain.com. root (
                            2008081601
                            10800
                            3600
                            604800
                            38400 )
                    IN      NS      dns.mydomain.com.
                    IN      MX      10 dns.mydomain.com.
    dns             IN      A       192.168.10.2
    mach01          IN      A       192.168.10.50
    ;; .. other machines..
    machdbs01       IN      A       10.100.2.21
    ecnfs02         IN      CNAME   machdbs01
    ecnapp02        IN      CNAME   machdbs01
    ;; External machines
    machext01       IN      A       68.246.97.42
    ecnpart02       IN      A       68.246.97.43
    ....