* GSWeb/GSWContext.h

add @class GSWResourceManager
add WOMarkupType
add _markupType;
reformat
* GSWeb/GSWContext.m
add - (WOMarkupType) markupType
* GSWeb/GSWComponent.h
add - (WOMarkupType) markupType
* GSWeb/GSWComponent.m
add - (WOMarkupType) markupType



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@31558 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Dave Wetzel 2010-10-25 00:39:36 +00:00
parent b375b9899e
commit 37a13f0222
5 changed files with 99 additions and 41 deletions

View file

@ -1,3 +1,16 @@
2010-10-24 David Wetzel <dave@turbocat.de>
* GSWeb/GSWContext.h
add @class GSWResourceManager
add WOMarkupType
add _markupType;
reformat
* GSWeb/GSWContext.m
add - (WOMarkupType) markupType
* GSWeb/GSWComponent.h
add - (WOMarkupType) markupType
* GSWeb/GSWComponent.m
add - (WOMarkupType) markupType
2010-06-25 David Wetzel <dave@turbocat.de>
* GSWeb/GSWResourceManager.m
+ GSLanguageFromISOLanguage:

View file

@ -42,6 +42,7 @@
@class GSWDynamicElement;
#include "GSWResponse.h"
#include "GSWContext.h"
@interface GSWComponent : GSWElement <NSCopying>
{
@ -258,6 +259,14 @@ Call this method before using a component which was cached in a variable.
-(NSString*)descriptionForResponse:(GSWResponse*)response
inContext:(GSWContext*)aContext;
/*
* the current default returns WOHTML401Markup
* override this in your page component for diffent
* behaviour.
*/
- (WOMarkupType) markupType;
+(void)_registerObserver:(id)observer;
-(void)validateAPIAssociations;

View file

@ -1544,6 +1544,11 @@ Call this method before using a component which was cached in a variable.
return _name;
}
- (WOMarkupType) markupType
{
return WOHTML401Markup;
}
+(void)_registerObserver:(id)observer
{
[self notImplemented: _cmd]; //TODOFN

View file

@ -39,6 +39,7 @@
@class GSWRequest;
@class GSWResponse;
@class GSWDynamicURLString;
@class GSWResourceManager;
typedef struct _GSWContextIMPs
{
@ -55,6 +56,14 @@ typedef struct _GSWContextIMPs
GSWIMP_BOOL _isSenderIDSearchOverIMP;
} GSWContextIMPs;
typedef enum {
WOUndefinedMarkup = 0,
WOHTML32Markup,
WOHTML401Markup,
WOXHTML10Markup,
WOXHTMLBasic11Markup
} WOMarkupType;
/** Fill impsPtr structure with IMPs for context **/
GSWEB_EXPORT void GetGSWContextIMPs(GSWContextIMPs* impsPtr,GSWContext* context);
@ -75,51 +84,51 @@ GSWEB_EXPORT BOOL GSWContext_isSenderIDSearchOver(GSWContext* aContext);
@interface GSWContext : NSObject <NSCopying>
{
@private
GSWResourceManager* _resourceManager;
GSWResourceManager* _resourceManager;
unsigned _contextID;
NSString* _senderID;
NSString* _requestSessionID;
NSString* _requestContextID;
NSString* _componentName;
GSWComponentDefinition* _tempComponentDefinition;
GSWElementID* _elementID;
GSWSession* _session;
GSWRequest* _request;
GSWResponse* _response;
GSWElement* _pageElement;
GSWComponent* _pageComponent;
GSWComponent* _currentComponent;
GSWDynamicURLString* _url;
NSMutableArray* _awakePageComponents;
int _secureMode;
int _urlApplicationNumber;
int _isClientComponentRequest;
BOOL _distributionEnabled;
BOOL _pageChanged;
BOOL _pageReplaced;
BOOL _generateCompleteURLs;
BOOL _inForm;
BOOL _isInEnabledForm;
BOOL _actionInvoked;
BOOL _formSubmitted;
BOOL _isMultipleSubmitForm;
BOOL _isValidate;
NSString* _senderID;
NSString* _requestSessionID;
NSString* _requestContextID;
NSString* _componentName;
GSWComponentDefinition* _tempComponentDefinition;
GSWElementID* _elementID;
GSWSession* _session;
GSWRequest* _request;
GSWResponse* _response;
GSWElement* _pageElement;
GSWComponent* _pageComponent;
GSWComponent* _currentComponent;
GSWDynamicURLString* _url;
NSMutableArray* _awakePageComponents;
int _secureMode;
WOMarkupType _markupType;
int _urlApplicationNumber;
int _isClientComponentRequest;
BOOL _distributionEnabled;
BOOL _pageChanged;
BOOL _pageReplaced;
BOOL _generateCompleteURLs;
BOOL _inForm;
BOOL _isInEnabledForm;
BOOL _actionInvoked;
BOOL _formSubmitted;
BOOL _isMultipleSubmitForm;
BOOL _isValidate;
#ifndef NDEBUG
int _loopLevel; //ForDebugging purpose: each repetition increment and next decrement it
NSMutableString* _docStructure; //ForDebugging purpose: array of all objects if the document during appendResponse, takeValues, invokeAction
NSMutableSet* _docStructureElements;
int _loopLevel; //ForDebugging purpose: each repetition increment and next decrement it
NSMutableString* _docStructure; //ForDebugging purpose: array of all objects if the document during appendResponse, takeValues, invokeAction
NSMutableSet* _docStructureElements;
#endif
NSMutableDictionary* _userInfo;
NSArray* _languages;
BOOL _isRefusingThisRequest;
BOOL _isSessionDisabled;
// IMPs for elementID manipulations
// As there's not many GSWContext objects, using some extra memory is not a problem
GSWElementIDIMPs _elementIDIMPs;
NSMutableDictionary* _userInfo;
NSArray* _languages;
BOOL _isRefusingThisRequest;
BOOL _isSessionDisabled;
// IMPs for elementID manipulations
// As there's not many GSWContext objects, using some extra memory is not a problem
GSWElementIDIMPs _elementIDIMPs;
@public // So we can use it in functions
GSWContextIMPs _selfIMPs;
GSWContextIMPs _selfIMPs;
};
/** Set GSWContext standard class (so we can use pre-build GSWContextIMPs) **/
@ -390,6 +399,16 @@ If none, try request languages
-(BOOL)secureMode;
-(void)setSecureMode:(BOOL) value;
/**
* returns the WOMarkupType of the context's page.
* this is cached in the context.
* Dynamic Elements can query the context for the markupType
* in order to generate standards compatible
* markup.
*/
- (WOMarkupType) markupType;
@end
#endif //_GSWContext_h__

View file

@ -303,6 +303,7 @@ GSWEB_EXPORT BOOL GSWContext_isSenderIDSearchOver(GSWContext* aContext)
_formSubmitted = NO;
_inForm = NO;
_secureMode = -2;
_markupType = WOUndefinedMarkup;
DESTROY(_resourceManager);
_resourceManager = RETAIN([GSWApp resourceManager]);
@ -2191,6 +2192,17 @@ If none, try request languages
port:0];
}
- (WOMarkupType) markupType
{
if ((_markupType == WOUndefinedMarkup))
{
GSWComponent* thePage = [self page];
if (thePage) {
_markupType = [thePage markupType];
}
}
return _markupType;
}
@end