com.wewebu.ow.server.util
Class OwStandardDBInvertedAttributeBag

java.lang.Object
  extended by com.wewebu.ow.server.util.OwStandardDBInvertedAttributeBag
All Implemented Interfaces:
OwAttributeBag

public class OwStandardDBInvertedAttributeBag
extends Object
implements OwAttributeBag

Implements a DB based read only attribute bag the inverts user- and attribute names.
Uses the following attribute scheme to access the database e.g.:

(Number)User (String)Name (String)AttributeName (String)AttributeValue (String)
1OW_SITE_USERViewerSizeX100
2OW_SITE_USERViewerSizeY100
3UserNameSelectedClassAccount1
4UserNameSelectedClassCredit1
5UserNameSelectedClassDepot1

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com


Field Summary
static String ATTRIBUTE_ATTR_NAME
          DB attribute name of the attribute name
static String ATTRIBUTE_ATTR_VALUE
          DB attribute name of the attribute value
static String ATTRIBUTE_BAGNAME
          DB attribute name of the Name
static String ATTRIBUTE_USER
          DB attribute name of the User
protected  HashMap m_attributes
          HashMap to store the attributes in
 
Constructor Summary
OwStandardDBInvertedAttributeBag(org.springframework.jdbc.core.JdbcTemplate jdbc_p, String bagname_p, String attributename_p, String strTable_p)
           
 
Method Summary
 int attributecount()
          get the number of attributes, or -1 if unknown
 Object getAttribute(int index_p)
          get a object at the specified index or throws OwObjectNotFoundException
 Object getAttribute(String strName_p)
          get the attribute with the given name or throws OwObjectNotFoundException
 Collection getAttributeNames()
          get all attribute names in the bag
 Object getSafeAttribute(String strName_p, Object default_p)
          get the attribute with the given name, returns default if not found.
 boolean hasAttribute(String strName_p)
          check if attribute exists
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTRIBUTE_USER

public static final String ATTRIBUTE_USER
DB attribute name of the User

See Also:
Constant Field Values

ATTRIBUTE_BAGNAME

public static final String ATTRIBUTE_BAGNAME
DB attribute name of the Name

See Also:
Constant Field Values

ATTRIBUTE_ATTR_NAME

public static final String ATTRIBUTE_ATTR_NAME
DB attribute name of the attribute name

See Also:
Constant Field Values

ATTRIBUTE_ATTR_VALUE

public static final String ATTRIBUTE_ATTR_VALUE
DB attribute name of the attribute value

See Also:
Constant Field Values

m_attributes

protected HashMap m_attributes
HashMap to store the attributes in

Constructor Detail

OwStandardDBInvertedAttributeBag

public OwStandardDBInvertedAttributeBag(org.springframework.jdbc.core.JdbcTemplate jdbc_p,
                                        String bagname_p,
                                        String attributename_p,
                                        String strTable_p)
                                 throws OwDataSourceException
Throws:
OwDataSourceException
Method Detail

attributecount

public int attributecount()
Description copied from interface: OwAttributeBag
get the number of attributes, or -1 if unknown

Specified by:
attributecount in interface OwAttributeBag

getAttribute

public Object getAttribute(int index_p)
                    throws Exception
Description copied from interface: OwAttributeBag
get a object at the specified index or throws OwObjectNotFoundException

Specified by:
getAttribute in interface OwAttributeBag
Parameters:
index_p - int index
Returns:
Object
Throws:
Exception

getAttribute

public Object getAttribute(String strName_p)
                    throws Exception
Description copied from interface: OwAttributeBag
get the attribute with the given name or throws OwObjectNotFoundException

Specified by:
getAttribute in interface OwAttributeBag
Throws:
Exception

getAttributeNames

public Collection getAttributeNames()
Description copied from interface: OwAttributeBag
get all attribute names in the bag

Specified by:
getAttributeNames in interface OwAttributeBag

getSafeAttribute

public Object getSafeAttribute(String strName_p,
                               Object default_p)
Description copied from interface: OwAttributeBag
get the attribute with the given name, returns default if not found.

Specified by:
getSafeAttribute in interface OwAttributeBag

hasAttribute

public boolean hasAttribute(String strName_p)
Description copied from interface: OwAttributeBag
check if attribute exists

Specified by:
hasAttribute in interface OwAttributeBag


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.